In manual there is an example of modern plural translations:
$translate->translate(array('Car', 'Cars first plural', 'Cars second plural', $number, 'ru')); i use poedit to update translation strings from sources, by searching for translate keyword. Since this param is an array, poedit can't find it, so it always go to obsolete translations. Putting keyword translate(array didn't help. Any ideas? Regards, Saša Stamenković |
poEdit can not handle modern plural translations.
It is fixed to english notation (one plural form). Greetings Thomas Weidner, I18N Team Leader, Zend Framework http://www.thomasweidner.com ----- Original Message ----- From: "Саша Стаменковић" <[hidden email]> To: "Nabble Zend Framework General" <[hidden email]> Sent: Sunday, May 30, 2010 2:26 PM Subject: [fw-general] Zend_Translate plural forms and poedit In manual there is an example of modern plural translations: $translate->translate(array('Car', 'Cars first plural', 'Cars second plural', $number, 'ru')); i use poedit to update translation strings from sources, by searching for translate keyword. Since this param is an array, poedit can't find it, so it always go to obsolete translations. Putting keyword translate(array didn't help. Any ideas? Regards, Saša Stamenković |
Hm, but we should create interfaces that makes translation easier.
Thanks anyway.
Regards, Saša Stamenković On Sun, May 30, 2010 at 3:19 PM, Thomas Weidner <[hidden email]> wrote: poEdit can not handle modern plural translations. |
But still, with traditional plural form, poedit works, but is able to parse onlly strings under ngettext, but not pural forms under translate keyword.
Ex: $translate->plural('Pronađen je %s auto oglas', 'Pronađeno je %s auto oglasa', $count); // Not found
ngettext('Pronađen je %s auto oglas', 'Pronađeno je %s auto oglasa', $count); // found by poedit I added plural to keywords. Where did I go wrong?
Do you use parsing from sources at all? Regards, Saša Stamenković On Sun, May 30, 2010 at 3:57 PM, Саша Стаменковић <[hidden email]> wrote: Hm, but we should create interfaces that makes translation easier. |
Hello,
Zend_Translate_Adapter_Gettext (used to translate with gettext compatatible files as translation sources) do not relay on standard functions like gettext(1) or ngettext(2) at all. Instead it parses given file line by line. [1] http://www.php.net/manual/en/function.gettext.php [2] http://www.php.net/manual/en/function.ngettext.php 2010/5/30 Саша Стаменковић <[hidden email]>: > But still, with traditional plural form, poedit works, but is able to parse > onlly strings under ngettext, but not pural forms under translate keyword. > Ex: > $translate->plural('Pronađen je %s auto oglas', 'Pronađeno je %s auto > oglasa', $count); // Not found > ngettext('Pronađen je %s auto oglas', 'Pronađeno je %s auto oglasa', > $count); // found by poedit > I added plural to keywords. > Where did I go wrong? > Do you use parsing from sources at all? > Regards, > Saša Stamenković > > > On Sun, May 30, 2010 at 3:57 PM, Саша Стаменковић <[hidden email]> > wrote: >> >> Hm, but we should create interfaces that makes translation easier. >> Thanks anyway. >> >> Regards, >> Saša Stamenković >> >> >> On Sun, May 30, 2010 at 3:19 PM, Thomas Weidner <[hidden email]> >> wrote: >>> >>> poEdit can not handle modern plural translations. >>> It is fixed to english notation (one plural form). >>> >>> Greetings >>> Thomas Weidner, I18N Team Leader, Zend Framework >>> http://www.thomasweidner.com >>> >>> ----- Original Message ----- From: "Саша Стаменковић" >>> <[hidden email]> >>> To: "Nabble Zend Framework General" <[hidden email]> >>> Sent: Sunday, May 30, 2010 2:26 PM >>> Subject: [fw-general] Zend_Translate plural forms and poedit >>> >>> >>> In manual there is an example of modern plural translations: >>> >>> $translate->translate(array('Car', 'Cars first >>> plural', 'Cars second plural', >>> $number, 'ru')); >>> >>> i use poedit to update translation strings from sources, by searching for >>> translate keyword. >>> >>> Since this param is an array, poedit can't find it, so it always go to >>> obsolete translations. >>> >>> Putting keyword translate(array didn't help. >>> >>> Any ideas? >>> >>> Regards, >>> Saša Stamenković >>> >> > > -- Sincerely yours, Aleksey V. Zapparov A.K.A. ixti FSF Member #7118 Mobile Phone: +34 617 179 344 Homepage: http://www.ixti.ru JID: [hidden email] *Origin: Happy Hacking! |
Wrong,
Zend_Translate_Adapter_Gettext does not parse files at all. It reads the binary *.mo file to know what it should translate. For parsing you need to run gettext's utilities or poEdit (which itself is very buggy). Greetings Thomas Weidner, I18N Team Leader, Zend Framework http://www.thomasweidner.com ----- Original Message ----- From: "Aleksey Zapparov" <[hidden email]> To: "Саша Стаменковић" <[hidden email]> Cc: "Thomas Weidner" <[hidden email]>; "Nabble Zend Framework General" <[hidden email]> Sent: Monday, May 31, 2010 12:11 AM Subject: Re: [fw-general] Zend_Translate plural forms and poedit Hello, Zend_Translate_Adapter_Gettext (used to translate with gettext compatatible files as translation sources) do not relay on standard functions like gettext(1) or ngettext(2) at all. Instead it parses given file line by line. [1] http://www.php.net/manual/en/function.gettext.php [2] http://www.php.net/manual/en/function.ngettext.php 2010/5/30 Саша Стаменковић <[hidden email]>: > But still, with traditional plural form, poedit works, but is able to > parse > onlly strings under ngettext, but not pural forms under translate keyword. > Ex: > $translate->plural('Pronađen je %s auto oglas', 'Pronađeno je %s auto > oglasa', $count); // Not found > ngettext('Pronađen je %s auto oglas', 'Pronađeno je %s auto oglasa', > $count); // found by poedit > I added plural to keywords. > Where did I go wrong? > Do you use parsing from sources at all? > Regards, > Saša Stamenković > > > On Sun, May 30, 2010 at 3:57 PM, Саша Стаменковић <[hidden email]> > wrote: >> >> Hm, but we should create interfaces that makes translation easier. >> Thanks anyway. >> >> Regards, >> Saša Stamenković >> >> >> On Sun, May 30, 2010 at 3:19 PM, Thomas Weidner <[hidden email]> >> wrote: >>> >>> poEdit can not handle modern plural translations. >>> It is fixed to english notation (one plural form). >>> >>> Greetings >>> Thomas Weidner, I18N Team Leader, Zend Framework >>> http://www.thomasweidner.com >>> >>> ----- Original Message ----- From: "Саша Стаменковић" >>> <[hidden email]> >>> To: "Nabble Zend Framework General" <[hidden email]> >>> Sent: Sunday, May 30, 2010 2:26 PM >>> Subject: [fw-general] Zend_Translate plural forms and poedit >>> >>> >>> In manual there is an example of modern plural translations: >>> >>> $translate->translate(array('Car', 'Cars first >>> plural', 'Cars second plural', >>> $number, 'ru')); >>> >>> i use poedit to update translation strings from sources, by searching >>> for >>> translate keyword. >>> >>> Since this param is an array, poedit can't find it, so it always go to >>> obsolete translations. >>> >>> Putting keyword translate(array didn't help. >>> >>> Any ideas? >>> >>> Regards, >>> Saša Stamenković >>> >> > > -- Sincerely yours, Aleksey V. Zapparov A.K.A. ixti FSF Member #7118 Mobile Phone: +34 617 179 344 Homepage: http://www.ixti.ru JID: [hidden email] *Origin: Happy Hacking! |
I know, but poedit parses files very well when you have ordinary keywords for plural forms. I just don't know how to force it to pick plurals from 'plural' keyword instead from 'ngettext' - that was my question.
Regards, Saša Stamenković On Mon, May 31, 2010 at 6:47 AM, Thomas Weidner <[hidden email]> wrote: Wrong, |
In reply to this post by Thomas Weidner
Hello,
Sorry, seems like I mis-used the word :)) I was sure that reading and processing file the way Adapter does: 112 fseek($this->_file, $origtemp[$count * 2 + 2]); 113 $original = @fread($this->_file, $origtemp[$count * 2 + 1]); 114 $original = explode(chr(00), $original); called parsing. And, to be honest, I don't see big difference between processing .mo file and processing .csv file, except with .mo your parser will be little bit more complicated. But I may be wrong in terms. Correct me if I'm wrong so next time I'll distinguish difference (1) and will use correct term. :)) [1] http://xkcd.com/747/ 2010/5/31 Thomas Weidner <[hidden email]>: > Wrong, > > Zend_Translate_Adapter_Gettext does not parse files at all. > It reads the binary *.mo file to know what it should translate. > > For parsing you need to run gettext's utilities or poEdit (which itself is > very buggy). > > Greetings > Thomas Weidner, I18N Team Leader, Zend Framework > http://www.thomasweidner.com > > ----- Original Message ----- From: "Aleksey Zapparov" <[hidden email]> > To: "Саша Стаменковић" <[hidden email]> > Cc: "Thomas Weidner" <[hidden email]>; "Nabble Zend Framework > General" <[hidden email]> > Sent: Monday, May 31, 2010 12:11 AM > Subject: Re: [fw-general] Zend_Translate plural forms and poedit > > > Hello, > > Zend_Translate_Adapter_Gettext (used to translate with gettext compatatible > files as translation sources) do not relay on standard functions like > gettext(1) or > ngettext(2) at all. Instead it parses given file line by line. > > [1] http://www.php.net/manual/en/function.gettext.php > [2] http://www.php.net/manual/en/function.ngettext.php > > > 2010/5/30 Саша Стаменковић <[hidden email]>: >> >> But still, with traditional plural form, poedit works, but is able to >> parse >> onlly strings under ngettext, but not pural forms under translate keyword. >> Ex: >> $translate->plural('Pronađen je %s auto oglas', 'Pronađeno je %s auto >> oglasa', $count); // Not found >> ngettext('Pronađen je %s auto oglas', 'Pronađeno je %s auto oglasa', >> $count); // found by poedit >> I added plural to keywords. >> Where did I go wrong? >> Do you use parsing from sources at all? >> Regards, >> Saša Stamenković >> >> >> On Sun, May 30, 2010 at 3:57 PM, Саша Стаменковић <[hidden email]> >> wrote: >>> >>> Hm, but we should create interfaces that makes translation easier. >>> Thanks anyway. >>> >>> Regards, >>> Saša Stamenković >>> >>> >>> On Sun, May 30, 2010 at 3:19 PM, Thomas Weidner <[hidden email]> >>> wrote: >>>> >>>> poEdit can not handle modern plural translations. >>>> It is fixed to english notation (one plural form). >>>> >>>> Greetings >>>> Thomas Weidner, I18N Team Leader, Zend Framework >>>> http://www.thomasweidner.com >>>> >>>> ----- Original Message ----- From: "Саша Стаменковић" >>>> <[hidden email]> >>>> To: "Nabble Zend Framework General" <[hidden email]> >>>> Sent: Sunday, May 30, 2010 2:26 PM >>>> Subject: [fw-general] Zend_Translate plural forms and poedit >>>> >>>> >>>> In manual there is an example of modern plural translations: >>>> >>>> $translate->translate(array('Car', 'Cars first >>>> plural', 'Cars second plural', >>>> $number, 'ru')); >>>> >>>> i use poedit to update translation strings from sources, by searching >>>> for >>>> translate keyword. >>>> >>>> Since this param is an array, poedit can't find it, so it always go to >>>> obsolete translations. >>>> >>>> Putting keyword translate(array didn't help. >>>> >>>> Any ideas? >>>> >>>> Regards, >>>> Saša Stamenković >>>> >>> >> >> > > > > -- > Sincerely yours, > Aleksey V. Zapparov A.K.A. ixti > FSF Member #7118 > Mobile Phone: +34 617 179 344 > Homepage: http://www.ixti.ru > JID: [hidden email] > > *Origin: Happy Hacking! > -- Sincerely yours, Aleksey V. Zapparov A.K.A. ixti FSF Member #7118 Mobile Phone: +34 617 179 344 Homepage: http://www.ixti.ru JID: [hidden email] *Origin: Happy Hacking! |
I think you missed the problem itself.
He can not run poEdit to create plural form po files. This has nothing to do with Zend_Translate_Adapter_Gettext or with how Zend_Translate parses the translation files. Greetings Thomas Weidner, I18N Team Leader, Zend Framework http://www.thomasweidner.com ----- Original Message ----- From: "Aleksey Zapparov" <[hidden email]> To: "Thomas Weidner" <[hidden email]> Cc: "Nabble Zend Framework General" <[hidden email]> Sent: Monday, May 31, 2010 9:54 AM Subject: Re: [fw-general] Zend_Translate plural forms and poedit Hello, Sorry, seems like I mis-used the word :)) I was sure that reading and processing file the way Adapter does: 112 fseek($this->_file, $origtemp[$count * 2 + 2]); 113 $original = @fread($this->_file, $origtemp[$count * 2 + 1]); 114 $original = explode(chr(00), $original); called parsing. And, to be honest, I don't see big difference between processing .mo file and processing .csv file, except with .mo your parser will be little bit more complicated. But I may be wrong in terms. Correct me if I'm wrong so next time I'll distinguish difference (1) and will use correct term. :)) [1] http://xkcd.com/747/ 2010/5/31 Thomas Weidner <[hidden email]>: > Wrong, > > Zend_Translate_Adapter_Gettext does not parse files at all. > It reads the binary *.mo file to know what it should translate. > > For parsing you need to run gettext's utilities or poEdit (which itself is > very buggy). > > Greetings > Thomas Weidner, I18N Team Leader, Zend Framework > http://www.thomasweidner.com > > ----- Original Message ----- From: "Aleksey Zapparov" > <[hidden email]> > To: "Саша Стаменковић" <[hidden email]> > Cc: "Thomas Weidner" <[hidden email]>; "Nabble Zend Framework > General" <[hidden email]> > Sent: Monday, May 31, 2010 12:11 AM > Subject: Re: [fw-general] Zend_Translate plural forms and poedit > > > Hello, > > Zend_Translate_Adapter_Gettext (used to translate with gettext > compatatible > files as translation sources) do not relay on standard functions like > gettext(1) or > ngettext(2) at all. Instead it parses given file line by line. > > [1] http://www.php.net/manual/en/function.gettext.php > [2] http://www.php.net/manual/en/function.ngettext.php > > > 2010/5/30 Саша Стаменковић <[hidden email]>: >> >> But still, with traditional plural form, poedit works, but is able to >> parse >> onlly strings under ngettext, but not pural forms under translate >> keyword. >> Ex: >> $translate->plural('Pronađen je %s auto oglas', 'Pronađeno je %s auto >> oglasa', $count); // Not found >> ngettext('Pronađen je %s auto oglas', 'Pronađeno je %s auto oglasa', >> $count); // found by poedit >> I added plural to keywords. >> Where did I go wrong? >> Do you use parsing from sources at all? >> Regards, >> Saša Stamenković >> >> >> On Sun, May 30, 2010 at 3:57 PM, Саша Стаменковић <[hidden email]> >> wrote: >>> >>> Hm, but we should create interfaces that makes translation easier. >>> Thanks anyway. >>> >>> Regards, >>> Saša Stamenković >>> >>> >>> On Sun, May 30, 2010 at 3:19 PM, Thomas Weidner <[hidden email]> >>> wrote: >>>> >>>> poEdit can not handle modern plural translations. >>>> It is fixed to english notation (one plural form). >>>> >>>> Greetings >>>> Thomas Weidner, I18N Team Leader, Zend Framework >>>> http://www.thomasweidner.com >>>> >>>> ----- Original Message ----- From: "Саша Стаменковић" >>>> <[hidden email]> >>>> To: "Nabble Zend Framework General" <[hidden email]> >>>> Sent: Sunday, May 30, 2010 2:26 PM >>>> Subject: [fw-general] Zend_Translate plural forms and poedit >>>> >>>> >>>> In manual there is an example of modern plural translations: >>>> >>>> $translate->translate(array('Car', 'Cars first >>>> plural', 'Cars second plural', >>>> $number, 'ru')); >>>> >>>> i use poedit to update translation strings from sources, by searching >>>> for >>>> translate keyword. >>>> >>>> Since this param is an array, poedit can't find it, so it always go to >>>> obsolete translations. >>>> >>>> Putting keyword translate(array didn't help. >>>> >>>> Any ideas? >>>> >>>> Regards, >>>> Saša Stamenković >>>> >>> >> >> > > > > -- > Sincerely yours, > Aleksey V. Zapparov A.K.A. ixti > FSF Member #7118 > Mobile Phone: +34 617 179 344 > Homepage: http://www.ixti.ru > JID: [hidden email] > > *Origin: Happy Hacking! > -- Sincerely yours, Aleksey V. Zapparov A.K.A. ixti FSF Member #7118 Mobile Phone: +34 617 179 344 Homepage: http://www.ixti.ru JID: [hidden email] *Origin: Happy Hacking! |
Ahh!.. Indeed, sorry.
2010/5/31 Thomas Weidner <[hidden email]>: > I think you missed the problem itself. > > He can not run poEdit to create plural form po files. > This has nothing to do with Zend_Translate_Adapter_Gettext or with how > Zend_Translate parses the translation files. > > Greetings > Thomas Weidner, I18N Team Leader, Zend Framework > http://www.thomasweidner.com > > ----- Original Message ----- From: "Aleksey Zapparov" <[hidden email]> > To: "Thomas Weidner" <[hidden email]> > Cc: "Nabble Zend Framework General" <[hidden email]> > Sent: Monday, May 31, 2010 9:54 AM > Subject: Re: [fw-general] Zend_Translate plural forms and poedit > > > Hello, > > Sorry, seems like I mis-used the word :)) > I was sure that reading and processing file the way Adapter does: > > 112 fseek($this->_file, $origtemp[$count * 2 + 2]); > 113 $original = @fread($this->_file, $origtemp[$count * 2 + > 1]); > 114 $original = explode(chr(00), $original); > > called parsing. And, to be honest, I don't see big difference between > processing .mo file and processing .csv file, except with .mo your parser > will be little bit more complicated. > > But I may be wrong in terms. Correct me if I'm wrong so next time I'll > distinguish difference (1) and will use correct term. :)) > > [1] http://xkcd.com/747/ > > > 2010/5/31 Thomas Weidner <[hidden email]>: >> >> Wrong, >> >> Zend_Translate_Adapter_Gettext does not parse files at all. >> It reads the binary *.mo file to know what it should translate. >> >> For parsing you need to run gettext's utilities or poEdit (which itself is >> very buggy). >> >> Greetings >> Thomas Weidner, I18N Team Leader, Zend Framework >> http://www.thomasweidner.com >> >> ----- Original Message ----- From: "Aleksey Zapparov" >> <[hidden email]> >> To: "Саша Стаменковић" <[hidden email]> >> Cc: "Thomas Weidner" <[hidden email]>; "Nabble Zend Framework >> General" <[hidden email]> >> Sent: Monday, May 31, 2010 12:11 AM >> Subject: Re: [fw-general] Zend_Translate plural forms and poedit >> >> >> Hello, >> >> Zend_Translate_Adapter_Gettext (used to translate with gettext >> compatatible >> files as translation sources) do not relay on standard functions like >> gettext(1) or >> ngettext(2) at all. Instead it parses given file line by line. >> >> [1] http://www.php.net/manual/en/function.gettext.php >> [2] http://www.php.net/manual/en/function.ngettext.php >> >> >> 2010/5/30 Саша Стаменковић <[hidden email]>: >>> >>> But still, with traditional plural form, poedit works, but is able to >>> parse >>> onlly strings under ngettext, but not pural forms under translate >>> keyword. >>> Ex: >>> $translate->plural('Pronađen je %s auto oglas', 'Pronađeno je %s auto >>> oglasa', $count); // Not found >>> ngettext('Pronađen je %s auto oglas', 'Pronađeno je %s auto oglasa', >>> $count); // found by poedit >>> I added plural to keywords. >>> Where did I go wrong? >>> Do you use parsing from sources at all? >>> Regards, >>> Saša Stamenković >>> >>> >>> On Sun, May 30, 2010 at 3:57 PM, Саша Стаменковић <[hidden email]> >>> wrote: >>>> >>>> Hm, but we should create interfaces that makes translation easier. >>>> Thanks anyway. >>>> >>>> Regards, >>>> Saša Stamenković >>>> >>>> >>>> On Sun, May 30, 2010 at 3:19 PM, Thomas Weidner <[hidden email]> >>>> wrote: >>>>> >>>>> poEdit can not handle modern plural translations. >>>>> It is fixed to english notation (one plural form). >>>>> >>>>> Greetings >>>>> Thomas Weidner, I18N Team Leader, Zend Framework >>>>> http://www.thomasweidner.com >>>>> >>>>> ----- Original Message ----- From: "Саша Стаменковић" >>>>> <[hidden email]> >>>>> To: "Nabble Zend Framework General" <[hidden email]> >>>>> Sent: Sunday, May 30, 2010 2:26 PM >>>>> Subject: [fw-general] Zend_Translate plural forms and poedit >>>>> >>>>> >>>>> In manual there is an example of modern plural translations: >>>>> >>>>> $translate->translate(array('Car', 'Cars first >>>>> plural', 'Cars second plural', >>>>> $number, 'ru')); >>>>> >>>>> i use poedit to update translation strings from sources, by searching >>>>> for >>>>> translate keyword. >>>>> >>>>> Since this param is an array, poedit can't find it, so it always go to >>>>> obsolete translations. >>>>> >>>>> Putting keyword translate(array didn't help. >>>>> >>>>> Any ideas? >>>>> >>>>> Regards, >>>>> Saša Stamenković >>>>> >>>> >>> >>> >> >> >> >> -- >> Sincerely yours, >> Aleksey V. Zapparov A.K.A. ixti >> FSF Member #7118 >> Mobile Phone: +34 617 179 344 >> Homepage: http://www.ixti.ru >> JID: [hidden email] >> >> *Origin: Happy Hacking! >> > > > > -- > Sincerely yours, > Aleksey V. Zapparov A.K.A. ixti > FSF Member #7118 > Mobile Phone: +34 617 179 344 > Homepage: http://www.ixti.ru > JID: [hidden email] > > *Origin: Happy Hacking! > > -- Sincerely yours, Aleksey V. Zapparov A.K.A. ixti FSF Member #7118 Mobile Phone: +34 617 179 344 Homepage: http://www.ixti.ru JID: [hidden email] *Origin: Happy Hacking! |
Yes, but if Zend_Translate have alias method named ngettext() which redelagates to plural(), poedit would be able to parse sources and generate plural forms. I know it's a bit strnage to add it, maybe I can go with overriding Zend_Translate in order to achieve this.
Because even if I do this by hand, on next update from sources string goes to obsolete strings, this is maybe more poedit problem, rather then Zend_Translate problem.
Regards, Saša Stamenković On Mon, May 31, 2010 at 2:00 PM, Aleksey Zapparov <[hidden email]> wrote: Ahh!.. Indeed, sorry. |
Free forum by Nabble | Edit this page |