Re: How do I use i18n and l10n in CakePHP 1.2?
Ok guys, that's nice. But how I should set up (choose) a specific language to be used? Thank you On Apr 18, 7:39 pm, "[EMAIL PROTECTED]" <[EMAIL PROTECTED]> wrote: > To anyone who is looking for answer to this I discovered the answer. > Here are my quick notes on it so far. > > INTERNATIONALIZATION > > - at top of controller: uses('L10n'); > - create /app/locale/eng/LC_MESSAGES/default.po (French is fre/fra) >http://www.loc.gov/standards/iso639-2/php/code_list.php > - create entries in default.po as such: > > msgid "close_window" > msgstr "Close" > > msgid "where_pin" > msgstr "Where is my PIN?" > > - call translations in view: ) ("close_window" > is msgid from default.po) > this is going to echo out the msgstr for the given msgid, else it > wil display the msgid given > use __("button_submit", true) to return the value as opposed to > echoing it > > I hope this saves others the time it took me to track it down. > > On Apr 13, 4:31 pm, "Aaron Thies" <[EMAIL PROTECTED]> wrote:> I have been > trying to find any kind of documentation on how to use > > i18n and l10n in CakePHP 1.2. Any help would be appreciated. > > > -- > > Aaron Thies > > > "When you're married you'll understand the value of fresh produce." > > - Tony Soprano --~--~-~--~~~---~--~~ 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: How do I use i18n and l10n in CakePHP 1.2?
To anyone who is looking for answer to this I discovered the answer. Here are my quick notes on it so far. INTERNATIONALIZATION - at top of controller: uses('L10n'); - create /app/locale/eng/LC_MESSAGES/default.po (French is fre/fra) http://www.loc.gov/standards/iso639-2/php/code_list.php - create entries in default.po as such: msgid "close_window" msgstr "Close" msgid "where_pin" msgstr "Where is my PIN?" - call translations in view: ) ("close_window" is msgid from default.po) this is going to echo out the msgstr for the given msgid, else it wil display the msgid given use __("button_submit", true) to return the value as opposed to echoing it I hope this saves others the time it took me to track it down. On Apr 13, 4:31 pm, "Aaron Thies" <[EMAIL PROTECTED]> wrote: > I have been trying to find any kind of documentation on how to use > i18n and l10n in CakePHP 1.2. Any help would be appreciated. > > -- > Aaron Thies > > "When you're married you'll understand the value of fresh produce." > - Tony Soprano --~--~-~--~~~---~--~~ 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 -~--~~~~--~~--~--~---
How do I use i18n and l10n in CakePHP 1.2?
I have been trying to find any kind of documentation on how to use i18n and l10n in CakePHP 1.2. Any help would be appreciated. -- Aaron Thies "When you're married you'll understand the value of fresh produce." - Tony Soprano --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Cake PHP" group. To post to this group, send email to [EMAIL PROTECTED] 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 -~--~~~~--~~--~--~---
I18n and Localization support
We are building a site that needs to support multiple languages - content ( titles of topics etc), user names and DB strings etc. will be in multiple languages - including chinese. >From the information I found on the site, the 1.1 version will not support this right? Will the alpha version (1.2) available on the download page support what we are looking for? If you can point me to a version that we can use, that would be great. Thanks Krishnan --~--~-~--~~~---~--~~ 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 language name
I had similar problem, try __("TableFieldName", 0) In my case it was right solution. --~--~-~--~~~---~--~~ 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 language name
Ok, sorry found it myself. The problem resides in the xampp apache of my windows box. On the linux apache its working fine with the first example, __('your text',true); But its still wired why my qindows box is crashing with it. The error reports some errors on the zendoptimizer.dll. So i have to wait for my linux box.. Never mind. Hawk On Mar 22, 10:30 am, "Hawk|" <[EMAIL PROTECTED]> wrote: > OK, this works for links and normal input fields without the helper. > > But if i use this: > > echo $form->input('fieldDefinitions/field', > array('label'=> __("TableFieldName",true), > 'size'=>'40'))."\n"; > > It crashes my Apache ?! > > I tried it both way's > __("TableFieldName",true) > and > __("TableFieldName") > both versions are crashing the server.. > > Got some Idea? > > Greetings Hawk > > On Feb 24, 6:43 am, "jitka" <[EMAIL PROTECTED]> wrote: > > > e($html->link(__("LABEL_TERMS_CONDITIONS", true), "/terms")); --~--~-~--~~~---~--~~ 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 language name
OK, this works for links and normal input fields without the helper. But if i use this: echo $form->input('fieldDefinitions/field', array('label'=> __("TableFieldName",true), 'size'=>'40'))."\n"; It crashes my Apache ?! I tried it both way's __("TableFieldName",true) and __("TableFieldName") both versions are crashing the server.. Got some Idea? Greetings Hawk On Feb 24, 6:43 am, "jitka" <[EMAIL PROTECTED]> wrote: > e($html->link(__("LABEL_TERMS_CONDITIONS", true), "/terms")); --~--~-~--~~~---~--~~ 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
I read this post. --~--~-~--~~~---~--~~ 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
You could start by reading what people have posted before.. http://groups.google.com/group/cake-php/browse_thread/thread/996b916448eb9d6a/ecdcdf40b16387ae?lnk=gst&q=i18n&rnum=1#ecdcdf40b16387ae --~--~-~--~~~---~--~~ 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 -~--~~~~--~~--~--~---
i18n
How I can do the translations of fields of a database table? --~--~-~--~~~---~--~~ 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 language name
e($html->link(__("LABEL_TERMS_CONDITIONS", true), "/terms")); --~--~-~--~~~---~--~~ 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 language name
Ok, I understand. Something about the __() function: I wanted to translate the title of a link : e($html- >link(__("LABEL_TERMS_CONDITIONS"), "/terms")); gives : Règles et Conditions, title outside the tags. The right solution : e($html->link(__("LABEL_TERMS_CONDITIONS", true), "/terms")); That's not a big deal, but most of the texts are inside html helper functions (link, form functions, table functions, etc), so maybe using e(_("translation")) means less code. And it's like the other basics functions, which don't have the $return argument. --~--~-~--~~~---~--~~ 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 language name
The error happens because on cake/libs/I10n.php you see: var $__l10nMap = array( // ... 'fra' => 'fr', 'fre' => 'fr', // ... ); That's a mapping from ISO639-3 to language catalog. Further down: var $__l10nCatalog = array( // ... 'fr' => array('language' => 'French (Standard)', 'locale' => 'fre', 'localeFallback' => 'fre', 'charset' => 'utf-8'), ); So both FRA and FRE are mapped to FR, and FR sets the local to FRE. Now on I10n:: __setLanguage() you see: $this->languagePath = array( 0 => $this->__l10nCatalog[$this->__l10nMap[$language]]['locale'], 1 => $this->__l10nCatalog[$this->__l10nMap[$language]]['localeFallback'] ); So even if you set your language to FRA, CakePHP will expect your local files to be on directory FRE. Which makes sense, doesn't it? -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 Stefan Enviado el: Viernes, 23 de Febrero de 2007 10:47 p.m. Para: Cake PHP Asunto: i18n language name Hi, The ISO language name for french is fra , fre. I made a directory app/locale/fra/LC_MESSAGES/ and put there a default.po and default.mo and followed the instructions about using i18n : But the translation didn't appeared. $I18n::__bindTextDomain() searched 4 times for app/locale/fre/ LC_MESSAGES/default.po. Only 'fre' is working as a language directory name. --~--~-~--~~~---~--~~ 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 -~--~~~~--~~--~--~---
i18n language name
Hi, The ISO language name for french is fra , fre. I made a directory app/locale/fra/LC_MESSAGES/ and put there a default.po and default.mo and followed the instructions about using i18n : $language = 'fra'; $this->Session->write('Config.language', $language); with a very simple page ( no controller only a view template ), Cake 1.2. But the translation didn't appeared. $I18n::__bindTextDomain() searched 4 times for app/locale/fre/ LC_MESSAGES/default.po. Only 'fre' is working as a language directory name. --~--~-~--~~~---~--~~ 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: How to use i18n with database in CakePHP 1.2
You sent me a private email but I'll respond on this thread so other people may find answers useful: I'm using PEAR Translation2 package, installed on my vendors dir as a PEAR package. I have a component that lets me forget about Translation2 internals when fetching language terms from within the controllers, here's the component: http://bin.cakephp.org/view/1156751993 -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 palPalani Enviado el: Sábado, 10 de Febrero de 2007 11:48 a.m. Para: Cake PHP Asunto: Re: How to use i18n with database in CakePHP 1.2 Thanks for you reply. Now i can able to translate static text using your answer. Can you provide database based i18n support in CakePHP. --~--~-~--~~~---~--~~ 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: How to use i18n with database in CakePHP 1.2
Hi Kathrin, Thanks for you reply. Now i can able to translate static text using your answer. Can you provide database based i18n support in CakePHP. Once again thanks for your reply. thanks, palPalani. On 4 Feb, 15:58, "Kathrin" <[EMAIL PROTECTED]> wrote: > In CakePHP 1.2 the function gettext is implement. You can write in > cake/local/LCMESSAGE/DEU/ in the core.po datei your msgid and > msgstring. Call msgfmt core.po >core.mo. Change in your view the > source (your msgid) like __('msgid') thats > all.http://www.gnu.org/software/gettext/ > its realy simple > Kathrin > > On 31 Jan., 16:52, "palPalani" <[EMAIL PROTECTED]> wrote: > > > hi, > > I have found solution for implementing multilingual static content in > > CakePHP 1.2. I want to know, how to use database based multilingual > > content. please help me. --~--~-~--~~~---~--~~ 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 and routing (1.2)
Ámon Tamás wrote: > Hello, > > I have a site, what I like to make multilangual and I like to change my > urls from /controller/action to /lng/controller/action. How can I make this? > Hmmm? There was a little example in the wiki about it, but I do not find in the new bakery. Is there a possible way to put somewhere this? -- Ámon Tamás http://linkfelho.amon.hu --~--~-~--~~~---~--~~ 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
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 -~--~~~~--~~--~--~---
i18n and routing (1.2)
Hello, I have a site, what I like to make multilangual and I like to change my urls from /controller/action to /lng/controller/action. How can I make this? -- Ámon Tamás http://linkfelho.amon.hu --~--~-~--~~~---~--~~ 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 -~--~~~~--~~--~--~---
Re: How to use i18n with database in CakePHP 1.2
In CakePHP 1.2 the function gettext is implement. You can write in cake/local/LCMESSAGE/DEU/ in the core.po datei your msgid and msgstring. Call msgfmt core.po >core.mo. Change in your view the source (your msgid) like __('msgid') thats all. http://www.gnu.org/software/gettext/ its realy simple Kathrin On 31 Jan., 16:52, "palPalani" <[EMAIL PROTECTED]> wrote: > hi, > I have found solution for implementing multilingual static content in > CakePHP 1.2. I want to know, how to use database based multilingual > content. please help me. --~--~-~--~~~---~--~~ 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 -~--~~~~--~~--~--~---
i18n 1.2 - database tables
Hi, I would like to create a multi-lingual website with editable content through a CMS. Will this be possible with release of 1.2? The stuff I have read places all the text into files opposed to database tables. Thanks in advance, Richard --~--~-~--~~~---~--~~ 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
Maybe they could make the route something like http://www.site.com / :lng / :controller /:action is $lng is not a good language then $lng will be set to the default lng of the browser On Feb 1, 11:12 am, "Na" <[EMAIL PROTECTED]> wrote: > For your question 2 : use of translation table isn't implemented at > time, as you can see in file Translate.php > > On Jan 31, 9:49 am, Ámon Tamás <[EMAIL PROTECTED]> wrote: > > > Larry E. Masters aka PhpNut wrote: > > > > $language = 'deu'; > > > Configure::write('Config.language', $language); > > > > You can also use: > > > > $language = 'deu'; > > > $this->Session->write('Config.language', $language); > > > Thanks, bud I have a lot of other question about it: > > 1. I like the url's look like > > this:http://sitename/en/controller/actionhowcan I make it? (There was > > something about it in the old wiki site, but I don't find it) > > > 2. There is a sql definition file i18n.sql. How can I use it? > > > 3. The drupal working a very similar way, but there when I get a page > > with __() function (the drupal name is t()) the drupal put the new > > string to the database, and after there is a front-and for translating. > > In drupal is an other way to import .po files to the database too. Is > > there a same way in cake? > > > 4. How I see there is no hungarian translation for locales. If I make > > it, where can I put it? > > > -- > > Ámon Tamáshttp://linkfelho.amon.hu --~--~-~--~~~---~--~~ 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
For your question 2 : use of translation table isn't implemented at time, as you can see in file Translate.php On Jan 31, 9:49 am, Ámon Tamás <[EMAIL PROTECTED]> wrote: > Larry E. Masters aka PhpNut wrote: > > > > > $language = 'deu'; > > Configure::write('Config.language', $language); > > > You can also use: > > > $language = 'deu'; > > $this->Session->write('Config.language', $language); > > Thanks, bud I have a lot of other question about it: > 1. I like the url's look like this:http://sitename/en/controller/actionhow > can I make it? (There was > something about it in the old wiki site, but I don't find it) > > 2. There is a sql definition file i18n.sql. How can I use it? > > 3. The drupal working a very similar way, but there when I get a page > with __() function (the drupal name is t()) the drupal put the new > string to the database, and after there is a front-and for translating. > In drupal is an other way to import .po files to the database too. Is > there a same way in cake? > > 4. How I see there is no hungarian translation for locales. If I make > it, where can I put it? > > -- > Ámon Tamáshttp://linkfelho.amon.hu --~--~-~--~~~---~--~~ 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: How to use the new Cake PHP i18N and l10N
Hi, Checkout the link, http://groups.google.com/group/cake-php/browse_thread/thread/2f9d4367bfd43f38/?lnk=igtc# On Jan 10, 12:05 am, "Sebastian Macias" <[EMAIL PROTECTED]> wrote: > Can anybody post a short example of this new feature usage? > > I found this in the bakery: > > "Its mostly automagic, just use the __() method to wrap your static > text. Then put some po in the locale and get jiggy with it. You can see > it in action now[5], the site should display in the language your > browser sends through HTTP_ACCEPT_LANGUAGE if we have the translation. > You can see the current languages we have[6]. If you would like to > translate to a language we do not currently have you can use the > default file[7]" > > But I haven't really been able to figure out what I need to do to get > it working. > > Thanks, > > Sebastian Macias --~--~-~--~~~---~--~~ 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 -~--~~~~--~~--~--~---
How to use i18n with database in CakePHP 1.2
hi, I have found solution for implementing multilingual static content in CakePHP 1.2. I want to know, how to use database based multilingual content. please help me. --~--~-~--~~~---~--~~ 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
Larry E. Masters aka PhpNut wrote: > > $language = 'deu'; > Configure::write('Config.language', $language); > > > You can also use: > > $language = 'deu'; > $this->Session->write('Config.language', $language); > Thanks, bud I have a lot of other question about it: 1. I like the url's look like this: http://sitename/en/controller/action how can I make it? (There was something about it in the old wiki site, but I don't find it) 2. There is a sql definition file i18n.sql. How can I use it? 3. The drupal working a very similar way, but there when I get a page with __() function (the drupal name is t()) the drupal put the new string to the database, and after there is a front-and for translating. In drupal is an other way to import .po files to the database too. Is there a same way in cake? 4. How I see there is no hungarian translation for locales. If I make it, where can I put it? -- Ámon Tamás http://linkfelho.amon.hu --~--~-~--~~~---~--~~ 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
Thanks a lot :-) Larry E. Masters aka PhpNut wrote: > > I found one way, is that the proper way? > > > The correct way would be: > > $language = 'deu'; > Configure::write('Config.language', $language); > > > > -- > /** > * @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
> $language = 'deu'; > Configure::write('Config.language', $language); > You can also use: $language = 'deu'; $this->Session->write('Config.language', $language); -- /** * @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
> I found one way, is that the proper way? The correct way would be: $language = 'deu'; Configure::write('Config.language', $language); -- /** * @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
I found one way, is that the proper way? In my app_controller.php i have uses('L10n') Then I use the following code: function AppController() { parent::Controller(); $this->L10n=new L10n(); $this->L10n->get('deu'); } Michael Grunewalder wrote: > That was a good start. Thanks. > How do I select a language so that the user can change the language > while browsing.? > thanks in advance :-) > Kaste wrote: > >>> How does working this i18n feature in 1.2? I like to make a multilangual >>> site with it... >>> >>> >>> >> first steps should be easy. >> >> >> in your view >> >> [index.ctp] >> >> >> create /app/locale/deu/LC_MESSAGES/default.po >> (** deu = your LANGUAGE code **) >> >> [default.po] >> msgid "Hello, my friend" >> msgstr "Hallo mein Freund" >> >> >> >> >> >> >> > > > > > > > > --~--~-~--~~~---~--~~ 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
That was a good start. Thanks. How do I select a language so that the user can change the language while browsing.? thanks in advance :-) Kaste wrote: >> How does working this i18n feature in 1.2? I like to make a multilangual >> site with it... >> >> > > first steps should be easy. > > > in your view > > [index.ctp] > > > create /app/locale/deu/LC_MESSAGES/default.po > (** deu = your LANGUAGE code **) > > [default.po] > msgid "Hello, my friend" > msgstr "Hallo mein Freund" > > > > > > > > > --~--~-~--~~~---~--~~ 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
> > How does working this i18n feature in 1.2? I like to make a multilangual > site with it... > first steps should be easy. in your view [index.ctp] create /app/locale/deu/LC_MESSAGES/default.po (** deu = your LANGUAGE code **) [default.po] msgid "Hello, my friend" msgstr "Hallo mein Freund" --~--~-~--~~~---~--~~ 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 -~--~~~~--~~--~--~---
i18n 1.2
How does working this i18n feature in 1.2? I like to make a multilangual site with it... -- Ámon Tamás http://linkfelho.amon.hu --~--~-~--~~~---~--~~ 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 -~--~~~~--~~--~--~---
How to use the new Cake PHP i18N and l10N
Can anybody post a short example of this new feature usage? I found this in the bakery: "Its mostly automagic, just use the __() method to wrap your static text. Then put some po in the locale and get jiggy with it. You can see it in action now[5], the site should display in the language your browser sends through HTTP_ACCEPT_LANGUAGE if we have the translation. You can see the current languages we have[6]. If you would like to translate to a language we do not currently have you can use the default file[7]" But I haven't really been able to figure out what I need to do to get it working. Thanks, Sebastian Macias --~--~-~--~~~---~--~~ 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 -~--~~~~--~~--~--~---
i18n working with locale component, Help!
Hi, All, I am creating a website tht have 3 different lanuage version. And I try to use the Locale Package. It great. But, Create or edit this file /app/views/layouts/default.thtml, adding this line anywhere. renderElement('language', $params) ?> Now the user need only press a button to be able to select any of the languages available, and will automatically be redirected to the page they were viewing in the requested language. I create a element called language.thtml, but dont know how to do it... HOW Can I dealing with this? Can someone help me , just give me simple sample that how to do it? Thanks in advance. --~--~-~--~~~---~--~~ 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: About internationalization (i18n)
The locale code isn't in the nightly, it's here: https://trac.cakephp.org/browser/whiteboard/proposals/bundt/1.x.x.x/ However, there are several complete implementations which are being used in production settings, most notably Andy Dawson's (AD7six) implementation, which I believe you can find on CakeForge. --~--~-~--~~~---~--~~ 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 -~--~~~~--~~--~--~---
About internationalization (i18n)
I am starting a new web project, and I want to give Cake a try. But there's a caveat: I have to create a multilanguage site. After searching this group and the Cake docs, I have found only a couple of "hand made" solutions, and the promise to have i18n in version 2 of CakePHP, but with a mention of it being "almost done" (https://trac.cakephp.org/wiki/Proposals/2.0ToDoList). If this is true, is there any information or source code of the current progress? I have searched a nightly build for "locale", "language", "i18n" with no success... Before coding my own solution, I would like to have an idea of the proposed "official" one. --~--~-~--~~~---~--~~ 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 -~--~~~~--~~--~--~---