[ic] Re: Locale fixes

Toni Mueller interchange-users@icdevgroup.org
Fri Jan 24 18:58:01 2003


Hi Mike,

On Thu, Jan 23, 2003 at 02:23:38PM -0500, Mike Heins wrote:
> I have made numerous Locale fixes to the DEVEL branch of Interchange.

thank you for the effort. I made an attempt to stress your code with
a bogus config... While developing, I usually run my personal
Interchange server from my home, like ~/interchange/bin/restart, and
as me. I'm using the CVS from some 15 hours ago.
Here is what I get (hope you can use it):

Platform: Debian unstable/testing... I upgrade about twice a week
to unstable. I have generated all locales that the system offers,
including the (unused) Chinese etc. ones.


In my environment:

LC_MESSAGES=C
LC_COLLATE=C
LANG=de_DE@euro


In catalog.cfg:

Locale          de_DE@euro
Locale          fr_FR@euro
Locale          en_US
Locale          sv_SE

Locale          de_DE@euro currency_symbol     " €"
Locale          de_DE@euro mon_decimal_point  ,
Locale          de_DE@euro mon_thousands_sep   .
Locale          fr_FR@euro currency_symbol     " €"
Locale          fr_FR@euro mon_decimal_point   ,
Locale          fr_FR@euro mon_thousands_sep   "‘"
Locale		sv_SE PriceDivide        .1081209657364659581
Locale          sv_SE currency_symbol     " SEK"
Locale          sv_SE mon_thousands_sep    


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

[setlocale de_DE@euro]
x [item-price]
[setlocale de_DE@euro]
[currency][calc][item-price noformat]*0.16[/calc][/currency]<br>
[currency]
    [calc]
    [item-price noformat]*1.16
    [/calc]
[/currency]
<br>
[setlocale fr_FR@euro]
[currency][calc][item-price noformat]*0.16[/calc][/currency]<br>
[currency]
    [calc]
    [item-price noformat]*1.16
    [/calc]
[/currency]
<br>
[setlocale sv_SE]
[currency][calc][item-price noformat]*0.25[/calc][/currency]<br>
[currency]
    [calc]
    [item-price noformat]*1.25
    [/calc]
[/currency]


The intention was to show a net price, a VAT amount, and a price
of net + VAT in the respective currencies. The VAT and some of the
locale data is really bogus and only serves the purpose of exercising
code.


The results:

With the settings above, and Interchange started just like described
above, I get for an item with net price 1495,-:

x 1'495,00 ¤
    239,20 ¤
  1.734,20 ¤
    239,20 ¤
  1'734,20 ¤
    373,75 SEK
  1 868,75 SEK 

[ The currency symbol isn't displayed correctly using cut&paste,
unfortunately, but it comes out correctly on the web page. ]

One thing that immediately jumps into the face is that PriceDivide
doesn't seem to have any effect - I've tried other numbers as
well, without success. Another problem is that the locale settings
are somehow honored only partially, with the french setting in
force while trying to display a german price.

If you have suggestions on what I should test in addition, or if you
want me to perform something more specific, please let me know.


Thank you!


Best,
--Toni++