Re: i18n 1.2 - database tables
Fantastic -- thanks. On Feb 4, 11:17 pm, "Larry E. Masters aka PhpNut" <[EMAIL PROTECTED]> wrote: > Richard, > > Before 1.2.x.x is released stable I will have a CLI script that will > generate the .pot files for an application. I have it working with all the > possible translations functions now but need to refactor it a little more > before I am ready to merge it into the core. > > It will work very much like our Bake script. > > https://trac.cakephp.org/browser/trunk/cake/1.2.x.x/cake/scripts/extr... > > On 2/4/07, Richard <[EMAIL PROTECTED]> wrote: > > > > > > > Hi Mariano > > > I have done some reading on gettext since your post and wondered if > > creating the pot files is possible using 'xgettext' command? since the > > strings that need translating in the cake views are not wrapped using > > PHP's gettext() function. > > > I found this useful for anyone else that is researching this topic: > >http://www.onlamp.com/pub/a/php/2002/06/13/php.html?page=1 > > > Thanks, Richard > > > On Feb 4, 9:31 pm, "Mariano Iglesias" <[EMAIL PROTECTED]> > > wrote: > > > CakePHP 1.2 uses gettext for i18n, which places the contents on text > > files, > > > as you can read here: > > > >http://ar.php.net/gettext > > > > So if you need your text elements to be on a database (thus allowing > > your > > > application to easily modify them) you'll need to implement i18n DB > > support > > > by yourself, or better yet integrate an existing i18n DB based package > > on > > > Cake. > > > > Since I needed i18n DB support on my app, which is currently running on > > > CakePHP 1.1.12 I'm using PEAR::Translation2 available at: > > > >http://pear.php.net/package/Translation2 > > > > There may be better i18n packages (I've used others in the past) but I'm > > > always inclined to use PEAR packages. > > > > Simply installing it as a PEAR library on your vendors dir, and then > > > building a small component (so your controllers don't know about the > > > internals of Translation2, making it easier to change the library in the > > > future) to fetch the text elements will do the trick. > > > > -MI > > > --- > > > > Remember, smart coders answer ten questions for every question they ask. > > > So be smart, be cool, and share your knowledge. > > > > BAKE ON! > > > > -Mensaje original- > > > De: cake-php@googlegroups.com [mailto:[EMAIL PROTECTED] En > > nombre > > > de Richard > > > Enviado el: Domingo, 04 de Febrero de 2007 07:42 a.m. > > > Para: Cake PHP > > > Asunto: i18n 1.2 - database tables > > > > I would like to create a multi-lingual website with editable content > > > through a CMS. Will this be possible with release of 1.2? > > -- > /** > * @author Larry E. Masters > * @var string $userName > * @param string $realName > * @returns string aka PhpNut > * @access public > */ --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Cake PHP" group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
RE: i18n 1.2 - database tables
As you clearly stated, xgettext will look for gettext() function calls while CakePHP uses __() as the function call. You can use the option --keyword to change which function calls should xgettext will look: $ xgettext --keyword=gettext,__:1 --language=PHP -n *.ctp In there we're enabling the normal gettext function call (in case you have any) and also the __() function call looking for the string on the first parameter to the function. PS: I haven't tried this, tell me if it works. -MI --- Remember, smart coders answer ten questions for every question they ask. So be smart, be cool, and share your knowledge. BAKE ON! blog: http://www.MarianoIglesias.com.ar -Mensaje original- De: cake-php@googlegroups.com [mailto:[EMAIL PROTECTED] En nombre de Richard Enviado el: Domingo, 04 de Febrero de 2007 03:58 p.m. Para: Cake PHP Asunto: Re: i18n 1.2 - database tables I have done some reading on gettext since your post and wondered if creating the pot files is possible using 'xgettext' command? since the strings that need translating in the cake views are not wrapped using PHP's gettext() function. --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Cake PHP" group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
Re: i18n 1.2 - database tables
Richard, Before 1.2.x.x is released stable I will have a CLI script that will generate the .pot files for an application. I have it working with all the possible translations functions now but need to refactor it a little more before I am ready to merge it into the core. It will work very much like our Bake script. https://trac.cakephp.org/browser/trunk/cake/1.2.x.x/cake/scripts/extract.php On 2/4/07, Richard <[EMAIL PROTECTED]> wrote: > > > Hi Mariano > > I have done some reading on gettext since your post and wondered if > creating the pot files is possible using 'xgettext' command? since the > strings that need translating in the cake views are not wrapped using > PHP's gettext() function. > > I found this useful for anyone else that is researching this topic: > http://www.onlamp.com/pub/a/php/2002/06/13/php.html?page=1 > > Thanks, Richard > > On Feb 4, 9:31 pm, "Mariano Iglesias" <[EMAIL PROTECTED]> > wrote: > > CakePHP 1.2 uses gettext for i18n, which places the contents on text > files, > > as you can read here: > > > > http://ar.php.net/gettext > > > > So if you need your text elements to be on a database (thus allowing > your > > application to easily modify them) you'll need to implement i18n DB > support > > by yourself, or better yet integrate an existing i18n DB based package > on > > Cake. > > > > Since I needed i18n DB support on my app, which is currently running on > > CakePHP 1.1.12 I'm using PEAR::Translation2 available at: > > > > http://pear.php.net/package/Translation2 > > > > There may be better i18n packages (I've used others in the past) but I'm > > always inclined to use PEAR packages. > > > > Simply installing it as a PEAR library on your vendors dir, and then > > building a small component (so your controllers don't know about the > > internals of Translation2, making it easier to change the library in the > > future) to fetch the text elements will do the trick. > > > > -MI > > > > > --- > > > > Remember, smart coders answer ten questions for every question they ask. > > So be smart, be cool, and share your knowledge. > > > > BAKE ON! > > > > -Mensaje original- > > De: cake-php@googlegroups.com [mailto:[EMAIL PROTECTED] En > nombre > > de Richard > > Enviado el: Domingo, 04 de Febrero de 2007 07:42 a.m. > > Para: Cake PHP > > Asunto: i18n 1.2 - database tables > > > > I would like to create a multi-lingual website with editable content > > through a CMS. Will this be possible with release of 1.2? > > > > > -- /** * @author Larry E. Masters * @var string $userName * @param string $realName * @returns string aka PhpNut * @access public */ --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Cake PHP" group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
Re: i18n 1.2 - database tables
Hi Mariano I have done some reading on gettext since your post and wondered if creating the pot files is possible using 'xgettext' command? since the strings that need translating in the cake views are not wrapped using PHP's gettext() function. I found this useful for anyone else that is researching this topic: http://www.onlamp.com/pub/a/php/2002/06/13/php.html?page=1 Thanks, Richard On Feb 4, 9:31 pm, "Mariano Iglesias" <[EMAIL PROTECTED]> wrote: > CakePHP 1.2 uses gettext for i18n, which places the contents on text files, > as you can read here: > > http://ar.php.net/gettext > > So if you need your text elements to be on a database (thus allowing your > application to easily modify them) you'll need to implement i18n DB support > by yourself, or better yet integrate an existing i18n DB based package on > Cake. > > Since I needed i18n DB support on my app, which is currently running on > CakePHP 1.1.12 I'm using PEAR::Translation2 available at: > > http://pear.php.net/package/Translation2 > > There may be better i18n packages (I've used others in the past) but I'm > always inclined to use PEAR packages. > > Simply installing it as a PEAR library on your vendors dir, and then > building a small component (so your controllers don't know about the > internals of Translation2, making it easier to change the library in the > future) to fetch the text elements will do the trick. > > -MI > > --- > > Remember, smart coders answer ten questions for every question they ask. > So be smart, be cool, and share your knowledge. > > BAKE ON! > > -Mensaje original- > De: cake-php@googlegroups.com [mailto:[EMAIL PROTECTED] En nombre > de Richard > Enviado el: Domingo, 04 de Febrero de 2007 07:42 a.m. > Para: Cake PHP > Asunto: i18n 1.2 - database tables > > I would like to create a multi-lingual website with editable content > through a CMS. Will this be possible with release of 1.2? --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Cake PHP" group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
RE: i18n 1.2 - database tables
CakePHP 1.2 uses gettext for i18n, which places the contents on text files, as you can read here: http://ar.php.net/gettext So if you need your text elements to be on a database (thus allowing your application to easily modify them) you'll need to implement i18n DB support by yourself, or better yet integrate an existing i18n DB based package on Cake. Since I needed i18n DB support on my app, which is currently running on CakePHP 1.1.12 I'm using PEAR::Translation2 available at: http://pear.php.net/package/Translation2 There may be better i18n packages (I've used others in the past) but I'm always inclined to use PEAR packages. Simply installing it as a PEAR library on your vendors dir, and then building a small component (so your controllers don't know about the internals of Translation2, making it easier to change the library in the future) to fetch the text elements will do the trick. -MI --- Remember, smart coders answer ten questions for every question they ask. So be smart, be cool, and share your knowledge. BAKE ON! -Mensaje original- De: cake-php@googlegroups.com [mailto:[EMAIL PROTECTED] En nombre de Richard Enviado el: Domingo, 04 de Febrero de 2007 07:42 a.m. Para: Cake PHP Asunto: i18n 1.2 - database tables I would like to create a multi-lingual website with editable content through a CMS. Will this be possible with release of 1.2? --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Cake PHP" group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---