Thanks for your messages. It helped me finding how to do what I want
to achieve.
So the solution is to set <?php $_SESSION['Config']['language'] =
'fr_fr'; ?> to the view of the part I wanna display in French (yes I
have another view just for this part since it's AJAX generated).
This way, the po file used for this view only is locale/fr_fr/
default.po and the rest stays in English.
Thanks!
On Jan 23, 7:48 pm, euromark <dereurom...@googlemail.com> wrote:
> i guess john's example implied that you could stay in the current
> language scope
> although it might not be the cleanest approach, it would be the
> simpliest for thomaus' need
>
> anyway
> the cookbook proposes to use i18n elements:http://book.cakephp.org/view/162/Internationalizing-Your-Application
> (bottom)
>
> On 23 Jan., 19:27, brian <zijn.digi...@gmail.com> wrote:
>
> > On Sat, Jan 23, 2010 at 9:38 AM, euromark <dereurom...@googlemail.com> wrote:
> > > or did you mean that you want to stay in "English"?
> > > and just load ONE static text in French? the rest of the page remains
> > > "English"?
> > > => no "language switch" used
>
> > > then john's approach would actually fit
>
> > Both __() & __d() use I18n::translate(), which checks
> > $_SESSION['Config']['language']. So you need to switch that in order
> > to switch the lang back and forth within the same view. A really basic
> > example:
>
> > $_SESSION['Config']['language'] = 'fr';
> > echo __('some text', true);
> > $_SESSION['Config']['language'] = 'en';
Check out the new CakePHP Questions site http://cakeqs.org and help others with their CakePHP related questions.
You received this message because you are subscribed to the Google Groups "CakePHP" group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to
cake-php+unsubscribe@googlegroups.com For more options, visit this group at http://groups.google.com/group/cake-php?hl=en
No comments:
Post a Comment