Hi!

I did not find a way to do it in the manual or in the code. How do I
set in PHP? And how is it possible to use it as default for all
further calls (no matter which class/method)?

Locale::setDefault() and Locale::DEFAULT.

That's why I would prefer an array (as named arguments). The keys

We aimed to create a wrapper for ICU, not reinvent how PHP language works. So we accept arguments the usual way - through function parameters, not through arrays.

The locale as 1st argument always looked weird to me when I was
writing my test code. The reason is certainly because of the default

I guess that's a matter of personal taste.

If right now is not within days but within 2 weeks, I can try to do
it. But I first like to hear Derick's idea on the topic before. Please
let us know your thoughts (wiki?) about this topic, it will certainly
spare us some precious time.

Well, the thoughts here are pretty simple - where date formatting functions accept timestamp and localtime array, they should accept DateTime object too. Also, there should be parse function returning DateTime, like one that returns timestamp. I think if you look in CVS in doc folder, early versions of date formatter API mention that.

The idea is to have a way to get a code for a language, or to valid a
given code, etc. Many applications actually duplicate this list
internally, it would be very nice to be able to deal with the ICU
lists (display, validation, listings, etc.).

You mean create API translating from language name in given locale to language code? I'm not sure ICU has this API. Locale class allows you to get components and display strings for the locales, but you have to have locale IDs first. There also are some matching functions in Locale, but I don't see any ICU functions allowing you to know IDs from external information, only to choose from set of IDs and enquire about ID.

As for validity, since locale mechanism has a bunch of fallbacks, I understand the validity concept is a bit blurred. I.e. you can have regexp to check all the -'s or _'s are in place but beyond that it's kind of hard to know what the question "is en_RU locale valid?" means.
--
Stanislav Malyshev, Zend Software Architect
[EMAIL PROTECTED]   http://www.zend.com/
(408)253-8829   MSN: [EMAIL PROTECTED]

--
PHP Internals - PHP Runtime Development Mailing List
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to