Re: I18N(_Currency)
| From: | Stig S. Bakken | Date: | Fri, 22 Nov 2002 23:07:26 +0000 |
| Subject: | Re: I18N(_Currency) | ||
| References: | 1 | Groups: | php.pear.dev |
| Request: | Send a blank email to pear-dev+get-11022@lists.php.net to get a copy of this message | ||
On Fri, 2002-11-22 at 15:06, Wolfram Kriesing wrote:
> now the I18N does also handle localization for
> - DateTime
> - Number
> - Currency
>
> it would be great if some langauge packages could be added by those
> who speak the langauges, that are still missing or incomplete.
> the files that need to be adapted are in I18N/Common
> it's a very simple structure :-)
>
>
>
> one problem i got
> there are different representation for those special currency signs,
> such as Euro, Yen, etc. now the Currency-class currently works with
> the HTML representation of those, such as €
> What do i.e. GTK-appl's need, unicode?
> Most probably we need to change something here, i.e. by like setting a
> 'mode' for the currency which could be smthg like:
> new I18N_Currency( 'de_DE' , I18N_[CURRENCY_]MODE_HTML );
> or
> new I18N_Currency( 'de_DE' , I18N_[CURRENCY_]MODE_UNICODE );
>
> any other ideas? or am i thinking to complicated?
Just to help you break it down into something less obtuse than "mode":
What you are trying to do here is to let the user choose a way of
encoding text, as HTML entities, UTF-8 or maybe just ISO-8859-15.
I don't know what Gtk needs, but being able to choose encoding is a must
when you are dealing with i18n after all. What about introducing some
new constants:
I18N_ENCODING_HTML_ENT
I18N_ENCODING_UTF_8
I18N_ENCODING_SHIFT_JIS
I18N_ENCODING_EUC_KR
I18N_ENCODING_ISO_8859_1
I18N_ENCODING_ISO_8859_15
...and then use encoding as a parameter/option to all I18N constructors,
or maybe have a way of setting a "global default" with
I18N::setDefaultEncoding().
- Stig