>> Please read the manual.
>> I can't teach you how translation works when you don't even know the
>> simplest things.
>>
>> As I said... en_us is not en_US... according to the manual regions are
>> uppercased. Otherwise there would be no way to detect if you want to have
>> the language en or the language us as you use the same seperator for all
>> tokens.
>>
>
> Thank you for your 'kind' words! I have read the manual back to front, it
> really isn't the clearest thing when coming to translation from scratch.
> It
> never once clearly states how to name your files. The chapter
> "56.3.9.2.3.
> Filename tokens" needs a simple statement "name your files name-en_US.mo"
> or
> equivalent. Everything works perfectly if I preface the locale with a -
> instead of an _ but this wasn't clear from the documentation or from the
> messages above.
How locales are named can be read in the documentation of Zend_Locale:
Chapter 31.1.3: How are locales represented:
http://framework.zend.com/manual/en/zend.locale.html#zend.locale.representationHow the detection of filenames is proceeded is described in Zend_Translate:
Chapter: 56.3.9.2.3: Filename tokens
http://framework.zend.com/manual/en/zend.translate.using.html#zend.translate.using.detection.filename.token"The first found string delimited by a token which can be interpreted as a
locale will be used."
and
"When the filename contains multiple tokens, the first found token depends
on the order of the tokens which are used."
All paragraphs even contain examples to see how filenames should be written.
I would not know how to write it better than using some examples.
As you used the same token, as already described, the detection did not work
like expected by you.
name_en_us... detects only name, en, us
name-en_us... detects name, en_us, name-en, en_us
name_en-us... detects name, en-us, name_en, en-us
but
en_US would work
> The examples shown are only now clear once I know what I'm looking for!
> Where does it state when discussing directory scanning that regions are
> upper-cased?
Within Zend_Locale. As you said that your filenames are named like locales
we expect that you also know how locales are noted. ;-)
I don't think that they even need to be uppercased when you are using the
tokens as described.
Greetings
Thomas Weidner, I18N Team Leader, Zend Framework
http://www.thomasweidner.com