Thomas, How I would expect it to work:
1) I set Zend_Locale in the registry. 2) I let Zend_Translate autohandle the language and auto add it's source. 3) There's one tmx file added to Zend_Translate, located in the tmx source file are the 'nl' and 'en' language. 4) The browser supports nl_NL, which is not defined in the tmx source. 5) Zend_Translate downgrades to 'nl', which is the closest match. 6) Zend_Translate finds/fetches the 'nl' sources in the tmx file and translates the (given) string. It's probably me who's not up to par on this subject (haven't checked the source code of Zend_Translate and Zend_Translate_Adapter_Tmx yet), so bear with me to get a grasp of how it actually works. Regards, TJ. On Fri, Sep 5, 2008 at 9:30 PM, Thomas Weidner <[EMAIL PROTECTED]>wrote: > Prior to be able to set a wished language you must add it's source. > > Example: > You add "nl" and "en"... > So you can not set "fr". > > Also you have not set "nl_NL" so you can't set it as language to use for > default translations. > > Greetings > Thomas Weidner, I18N Team Leader, Zend Framework > http://www.thomasweidner.com > > ----- Original Message ----- From: "Taco Jung" <[EMAIL PROTECTED]> > To: <[email protected]> > Sent: Friday, September 05, 2008 8:53 PM > > Subject: Re: [fw-general] Zend_Translate TMX doesn't downgrade? > > > Hi Thomas, >> >> Could you elaborate a bit more on your remark about "You can not set a >> language where you have not defined a single string." . It's unclear to me >> what you mean by that? Perhaps an example helps? >> >> Regards, TJ. >> >> >> On Fri, Sep 5, 2008 at 8:41 PM, Thomas Weidner <[EMAIL PROTECTED] >> >wrote: >> >> There is one mistake in your thoughts. >>> >>> Zend_Translate will automatically translate and downgrade when a >>> translation is not available. >>> BUT: >>> You can not set a language where you have not defined a single string. >>> >>> And regarding to you sourcefile you just defined "en" and "nl"... but no >>> other language. >>> So you can only set those two languages for translation as no other was >>> defined. >>> >>> Greetings >>> Thomas Weidner, I18N Team Leader, Zend Framework >>> http://www.thomasweidner.com >>> >>> ----- Original Message ----- From: "Taco Jung" <[EMAIL PROTECTED]> >>> To: <[email protected]> >>> Sent: Friday, September 05, 2008 8:10 PM >>> Subject: Re: [fw-general] Zend_Translate TMX doesn't downgrade? >>> >>> >>> >>> Thomas, >>> >>>> >>>> The nl (not nl_NL) translations are in the source file: >>>> >>>> <?xml version="1.0" encoding="UTF-8"?> >>>> <tmx version="2.0" xmlns="http://www.lisa.org/tmx20"> >>>> <header adminlang="en" creationtool="locale4j" >>>> creationtoolversion="1.1" >>>> o-tmf="unknown" segtype="block" srclang="*all*"/> >>>> <body> >>>> <tu tuid="Add"> >>>> <tuv xml:lang="nl"> >>>> <seg>Toevoegen</seg> >>>> </tuv> >>>> <tuv xml:lang="en"> >>>> <seg>Add</seg> >>>> </tuv> >>>> </tu> >>>> >>>> I'm trying to autohandle the languages, so I'm especially interested in >>>> your >>>> remark about "The locale parameter is ignored for sourcefiles which >>>> define >>>> there locale themself". >>>> >>>> What does that actually mean? That I can't autohandle the language? From >>>> the >>>> manual I read: >>>> >>>> " TMX files can have several languages within the same file. All other >>>> included languages are added automatically, so you do not have to call >>>> addLanguage()." >>>> >>>> Shouldn't nl_NL downgrade to nl and therefore the language is >>>> autohandled >>>> and fetched when translating? >>>> >>>> Regards, TJ. >>>> >>>> >>>> >>>> On Fri, Sep 5, 2008 at 7:29 PM, Thomas Weidner <[EMAIL PROTECTED] >>>> >wrote: >>>> >>>> Simply said, you wanted to change the language to a language where no >>>> >>>>> translation is available at all. >>>>> It seems that you have only empty 'nl_NL' files and wanted to >>>>> setLocale('nl_NL'); >>>>> >>>>> This has nothing to do with downgrading. Downgrading does work and is >>>>> always done when translating. >>>>> But you can not set a language where you have not added translations >>>>> before >>>>> as then there would nothing be there to downgrade to. >>>>> >>>>> And beware: The TMX format defines the language within the source file. >>>>> The >>>>> locale parameter is ignored for sourcefiles which define there locale >>>>> themself. >>>>> >>>>> Greetings >>>>> Thomas Weidner, I18N Team Leader, Zend Framework >>>>> http://www.thomasweidner.com >>>>> >>>>> ----- Original Message ----- From: "Codiac" <[EMAIL PROTECTED]> >>>>> To: <[email protected]> >>>>> Sent: Friday, September 05, 2008 5:00 PM >>>>> Subject: [fw-general] Zend_Translate TMX doesn't downgrade? >>>>> >>>>> >>>>> >>>>> >>>>> Hi all, >>>>> >>>>>> >>>>>> I've switched from a CSV file to using TMX for my translations, but it >>>>>> seems >>>>>> there's a problem with the TMX adapter. According to the manual, if a >>>>>> language can't be found it downgrades the language code (without the >>>>>> region). However I get the following message, even with language 'nl' >>>>>> in >>>>>> my >>>>>> TMX file: >>>>>> >>>>>> Fatal error: Uncaught exception 'Zend_Translate_Exception' with >>>>>> message >>>>>> 'No >>>>>> translation for the language 'nl_NL' available.' >>>>>> >>>>>> This is in my bootstrap: >>>>>> >>>>>> $locale = new Zend_Locale(); >>>>>> self::$registry->Zend_Locale = $locale; >>>>>> >>>>>> $translate = new Zend_Translate('tmx', self::$basepath . >>>>>> '/languages'); >>>>>> self::$registry->Zend_Translate = $translate; >>>>>> >>>>>> >>>>>> However, if I adjust the following line: >>>>>> $translate = new Zend_Translate('tmx', self::$basepath . '/languages', >>>>>> 'nl'); >>>>>> >>>>>> Everything works fine. Can someone verify if this is a bug? >>>>>> >>>>>> Regards, TJ. >>>>>> -- >>>>>> View this message in context: >>>>>> >>>>>> >>>>>> http://www.nabble.com/Zend_Translate-TMX-doesn%27t-downgrade--tp19333160p19333160.html >>>>>> Sent from the Zend Framework mailing list archive at Nabble.com. >>>>>> >>>>>> >>>>>> >>>>> >>>>> >>>> >>> >> >
