Thomas,
Thanks for the reply. I did read the manual and what you stated was
pretty much what I concluded.
Shouldn't there be a way to manually OVERRIDE the autodetection and SET
THE LOCALE that all "locale aware classes" should use? Otherwise, you
have to create the locale object and use it to create the locale aware
objects (no convenience). Frankly, I don't even know which classes ARE
locale aware. I think it is much more intuitive for setDefault to be
the *highest *quality, not the lowest. Don't you think? Lowest should
be something like 'setFailsafe' or 'setFallback'.
Let me give you a use case. You create a site where users register and
can select their language of choice. As long as the user is sending
HTTP_ACCEPT_LANGUAGE with the language of choice, defaults should work
fine and there is no need to pass locale objects. Right? Then, one of
your users goes to a different country and logs in to your site via an
internet cafe. That cafe has a different set for HTTP_ACCEPT_LANGUAGE
and they do not allow you to change their settings. The user cannot see
their selected language UNLESS the site was created using a locale
object and all locale aware classes where created explicitly with a
locale. This eliminates all "convenience" of the locale aware classes.
The developer needs to continually monitor which classes are "locale
aware" and instantiate them with the correct locale.
*It would truly be convenient *if you could set a locale either via
setDefault or another method, and then all locale aware classes would
*just *use that locale, overriding everything else..
Maybe I'm missing the boat on this...
If you don't see the need for this, maybe you could give me some insight
on how I could achieve this. Looks like all of the locale aware classes
specifically call Zend_Locale so does it doesn't make any sense to
subclass. How else could I do this? I don't want to modify the ZF code.
Thanks for the help.
Arthur
Thomas Weidner wrote:
Arthur...
The manual is you friend:
http://framework.zend.com/manual/en/zend.locale.html#zend.locale.introduction
See "using a default locale".
As you can read the "default" locale is the last line of defense when
no way of detection has worked.
If you want to use a fixed locale you have to set it with setLocale().
Also to mention: There is no way to set a higher level than 1.0
because 100% is the maximum. For this reason you would never know
which locale is used if there are multiple at the same level... when
this happens the user states that he doesn't mind which is used. But
you do, so you must not use the autodetection but a manual set one.
Greetings
Thomas Weidner, I18N Team Leader
http://www.thomasweidner.com
----- Original Message ----- From: "Arthur M. Kang"
<[EMAIL PROTECTED]>
To: <[email protected]>
Sent: Thursday, March 06, 2008 2:14 AM
Subject: [fw-general] Zend_Locale Quality
Is there any way to set the default locale where the quality will be
greater than the browser? If I set a default locale, it never gets used
by the locale aware classes as it gets a quality rating of 0.1 and the
browser locales get 1.0.
Arthur