MiniVend Akopia Services

[Date Prev][Date Next][Thread Prev][Thread Next][Minivend by date ][Minivend by thread ]

Re: Internationalisation and Currency



In-Reply-To: <19990618074712.A28501@bill.iac.net>
In article <19990618074712.A28501@bill.iac.net>, mikeh@minivend.com () 
wrote:

> ******    message to minivend-users from mikeh@minivend.com     ******
> 
> Quoting Christian J. M&#252;ller (cmueller@polinet.ch):
> > 
> > Both exist: one currency, several languages (e.g. Switzerland, EC with
> > Euro) and one language, several currencies (e.g. english, USD, UKP
> > etc.). I have established one column for each language/currency pair 
> > in
> > my locale.asc. I admit that this results in an inflated locale.asc 
> > file.
> > You could also set your country/currency default and then change
> > currency as required with the [setlocale language= xxx
> > currency=xxx][/setlocale] or the [page
> > process/locale/xxx/currency/xxx/page/catalog] tags as described in the
> > docs under "Internationalization", "Setting the locale".
> > I agree that a separation of language and currency would be a more
> > elegant solution. 
> 
> I assume you are talking about not having to repeat the 
> mon_decimal_point and mon_thousands_sep and currency_symbol.
> (If you don't require that, the current setup will suffice).
> That allows [setlocale locale=de_DE currency=eu_EU] to only
> change the number and symbol but not change the mon_decimal_point etc.
> 
> A simple change to Vend::Util::setlocale will enable that:
> 
>     if ($currency) {
>         my $curr = $Vend::Cfg->{Locale_repository}{$currency};
> 
>         for(@Vend::Config::Locale_directives_currency) {
>             $Vend::Cfg->{$_} = $curr->{$_}
>                 if defined $curr->{$_};
>         }
>         @{$Vend::Cfg->{Locale}}{@Vend::Config::Locale_keys_currency} =
>                 @{$curr}{@Vend::Config::Locale_keys_currency};
>     }
> 
> should become
> 
>     if ($currency) {
>         my $curr = $Vend::Cfg->{Locale_repository}{$currency};
> 
>         for(@Vend::Config::Locale_directives_currency) {
>             $Vend::Cfg->{$_} = $curr->{$_}
>                 if defined $curr->{$_};
>         }
>         @{$Vend::Cfg->{Locale}}{@Vend::Config::Locale_keys_currency} =
>                 @{$curr}{ grep defined $curr->{$_},
>                                                       
@Vend::Config::Locale_keys_currency};
>     }
> 
> i.e.
> 
> <                 @{$curr}{@Vend::Config::Locale_keys_currency};
> ---
> >                 @{$curr}{ grep defined $curr->{$_},
> >                               @Vend::Config::Locale_keys_currency};
> 
> That will retain everything that you don't explicitly set (already
> the behavior for PriceDivide, PriceField, and friends).
> 
> I will probably add this as an option in MV4 -- I am going to
> redo the locale mechanism completely because of the easy
> new action capability (i.e. /de_DE/ as a standard way to select
> any page for that locale, defineable by the user). Don't worry, all
> of your [L] and [LC] stuff will still work, and Locale definitions
> won't change. 8-)
> 

Thanks Mike, you really are on top of it, Minivend is getting better and 
better!!

Bye :-)=
hutch@cix.co.uk





Search for: Match: Format: Sort by: