[ic] Re: Locale fixes

Toni Mueller interchange-users@icdevgroup.org
Sat Jan 25 11:03:00 2003


Hi Mike,

On Fri, Jan 24, 2003 at 08:37:22PM -0500, Mike Heins wrote:
> With the code you have, you would need to use
> 
> 	[currency convert=1] .... [/currency]
> 
> This is now obviated with [currency locale=sv_SV] ... [/currency], which
> forces convert=1.

so I should get some current documentation first in order to do the
right thing...

> > In flypage.html (with most of the HTML in between removed):

I've transported this to the standard foundation shop, and it
appears to work so far, but it badly breaks with a former example
shop, applying the (wrong) PriceDivide at least once, and sometimes
twice.

> With a patch I put in yesterday, you would say:
> 
> 	[currency locale=sv_SE][item-price noformat][/currency]

This is what I converted everything to. I tried to set the default
locale like this: Locale de_DE@euro in catalog.cfg. Tests are
done with a fictious item priced 1495,- Euros. This time I
checked across catalogue templates.

The result is that if you don't use the locale data base as in
locale.txt in foundation, the result you get is -VERY- dependend
on the order of Locale statements in catalog.cfg. The default
locale needs to be placed last.

I would have preferred to be able setting the locale specific
attributes in any order and have the default locale be determined
either by saying

Locale	a_A
Locale	b_B

and have the first/last be the default, or to be able to say

LocaleDefault a_A

and list the other locales that are present.


> Of course the calc would still need to be in the body for the calculated
> values...

Yes. That makes for a clumsy source code, but hey - it works!

> No setlocale need be done, and conversion is automatic.

I found that using setlocale doesn't affect the result anymore
when I write [currency locale=...] in the pages.

> Likewise, I enabled:
> 
> 	[subtotal locale=sv_SV]
> 	[salestax locale=sv_SV]
> 	[shipping locale=sv_SV]
> 	[handling locale=sv_SV]
> 	[total-cost locale=sv_SV]

This I had yet no time to test, but will come back later to you.

While you are at it, this is on my wishlist:    ;-)

[salestax [item-price noformat] locale=de_CH]

to display the individual localized sales tax (taking into account
the different taxing rules according to destination, product type
etc) of an item in eg a flypage or a browse page, and likewise for
the other tags. That would spare me to write all the clumsy [calc]
sections or mangle my own UserTag-s for this purpose.


Best,
--Toni++