[Solar-talk] Solar_Locale & ISO 3166 + ISO 639 + RFC1766
Dmytro Konstantinov
umka.dk at gmail.com
Wed Apr 30 11:57:34 CDT 2008
Hi guys,
Just spent a day looking at the way Solar_Locale works and trying to
integrate that functionality into a multi-lingual app that I'm
writing. At first I thought it will be really easy but then I came
across an interesting thing... (If this came up before please point me
to the right place!)
I use "xml:lang" attribute to define the language of the page that is
displayed and at first I thought placing the output of Solar_Locale-
>getCode() as it's value would do the trick. However, as it turned
out, Solar' locale is a bit different to that defined by RFC1766 and
expected by XHTML 1.1. This leads me to a few basic question:
1. Am I right in thinking that Solar_Locale->getCode() returns a
locale of the following format: [language code as defined by ISO 639
alpha-2]_[country code as defined by ISO 3166 alpha-2]?
2. What is the advantage in separating language code from country
codes by an "_" [underscore] instead of a "-" [dash], as defined by
RFC 1766?
Also, while we are on the subject of locale, what does everyone think
about adding Solar_Locale->setCountryCode(), Solar_Locale-
>getLanguageCode() and Solar_Locale->setLanguageCode()? This way it
would be possible to adjust current locale based on the country or
language of origin, without having to manually rebuilding the entire
locale string. For example, this might come in handy when dealing
with: en-US vs. en-GB, es-ES vs. es-BR / en-CA vs. fr-CA, etc.
Thanks guys,
Dima
More information about the Solar-talk
mailing list