"Configure::write('Config.language', 'ja');"  is NOT working.

Yes I have "default.po"  at app/local/jpn/LC_MESSAGES/default.po



On Wed, Jul 27, 2011 at 5:28 PM, gloop <[email protected]> wrote:

> Correct is:
>
> Configure::write('Config.language', 'ja');
>
> You can take a look on cake/libs/l10n.php
>
> Did you create app/local/jpn/LC_MESSAGES/default.po ?
>
> On 28 Jul., 02:14, leafchild book <[email protected]> wrote:
> > mmmm.....
> >
> > I set .po file for "en" and "jpn"
> >
> > I set default language to Japanese:
> > app/config/core.php:
> > Configure::write('Config.language', 'jpn');
> >
> > but when I access site
> >
> > Either
> > mydomain.com/en/something/    or    mydomain.com/something/
> >
> > show EN translation.
> >
> > then I put this line (Configure::write('Config.language', 'jpn');)
> directly
> > to controller file (I thought it will show Japanese ) then still local is
> in
> > EN
> >
> > I can't set default language which I want to! What is missing???
> >
> >
> >
> >
> >
> >
> >
> > On Wed, Jul 27, 2011 at 4:14 PM, gloop <[email protected]> wrote:
> > > When you have diffrent count pages you must set diffrent routes (for
> > > en / jp).
> >
> > > And set diffrent views for these pages.
> >
> > > On 27 Jul., 23:27, leafchild book <[email protected]> wrote:
> > > > Also I wander,,, how other people doing for this kind of site,,,
> >
> > > > #1)
> > > > So like I said 2nd language page has much less pages than dealt page.
> > > > ex)  site map page is not work for just translation. I have to show
> only
> > > > available page link to the page.
> >
> > > > #2)
> > > > Some image is different  at EN and JP page.
> > > > ex) submit button
> >
> > > > On Wed, Jul 27, 2011 at 2:23 PM, gloop <[email protected]> wrote:
> > > > > I use .po files
> >
> > > > > kind regards
> >
> > > > > On 27 Jul., 23:10, leafchild <[email protected]> wrote:
> > > > > > Thanks gloop for the response.
> >
> > > > > > Did you use .pot file or DB??
> >
> > > > > > lc
> >
> > > > > > On Jul 27, 1:32 pm, gloop <[email protected]> wrote:
> >
> > > > > > > Hello leafchild,
> >
> > > > > > > same problem for 1 day :-D
> >
> > > > > > > routes.php
> >
> > > > > > >     Router::connect(
> > > > > > >         '/:lang/:controller/:action/*',
> > > > > > >         array(),
> > > > > > >         array('lang' => '[a-z]{2}')
> > > > > > >     );
> > > > > > >     Router::connect(
> > > > > > >         '/:lang/:controller',
> > > > > > >         array('action' => 'index'),
> > > > > > >         array('lang' => '[a-z]{2}')
> > > > > > >     );
> >
> > > > > > > app/config/core.php
> >
> > > > > > > // Set default language
> > > > > > > Configure::write('Config.language', 'de');
> >
> > > > > > > cake/libs/controller
> >
> > > > > > >   var $components = array('Session', 'Cookie');
> >
> > > > > > >   function beforeFilter() {
> > > > > > >       $this->_setLanguage();
> > > > > > >   }
> >
> > > > > > >   function _setLanguage() {
> > > > > > >       if ($this->Cookie->read('lang') &&
> > > > > !$this->Session->check('Config.language')) {
> >
> > > > > > >           $this->Session->write('Config.language',
> > > > > $this->Cookie->read('lang'));
> >
> > > > > > >       }
> > > > > > >       else if (isset($this->params['lang']) &&
> > > ($this->params['lang']
> > > > > > >                !=  $this->Session->read('Config.language'))) {
> >
> > > > > > >           $this->Session->write('Config.language',
> > > > > $this->params['lang']);
> >
> > > > > > >           $this->Cookie->write('lang', $this->params['lang'],
> > > false,
> > > > > > > '20 days');
> > > > > > >       }
> > > > > > >   }
> >
> > > > > > > Link musst looks like
> > > > > > > domain/en/controller
> > > > > > > domain/jp/controller
> >
> > > > > > > Have fun :)
> >
> > > > > > > On 27 Jul., 21:19, leafchild <[email protected]> wrote:
> >
> > > > > > > > I want to have 2 languages site (en/jp) and JP is default
> > > language.
> > > > > > > > I look at multi-language pages but still confusing,,,
> >
> > > > > > > > ex)
> > > > >
> http://book.cakephp.org/view/1228/Internationalization-Localizationht.
> > > ..
> >
> > > > > > > > and url will be:
> > > > > > > > JP : mydomain.com/whatever
> > > > > > > > EN: mydomain.com/en/whatever
> >
> > > > > > > > also EN pages has less page than JP pages which mean EN
> doesn't
> > > have
> > > > > > > > all pages for JP pages.
> > > > > > > > What should I do when there is no EN page?
> >
> > > > > > > > I don't thinkhttp://
> > > > > book.cakephp.org/view/1228/Internationalization-Localization
> > > > > > > > works for my site.
> > > > > > > > There are a lot of long sentence that need to be covered,
> plus
> > > this
> > > > > > > > one not changing URL but changing contents.
> >
> > > > > > > > Should I just use Configure::write('Routing.prefixes',
> > > > > array('en'));??
> > > > > > > > because structure of 2 sites are not exactly same but share
> some
> > > > > > > > section.
> >
> > > > > --
> > > > > Our newest site for the community: CakePHP Video Tutorials
> > > > >http://tv.cakephp.org
> > > > > Check out the new CakePHP Questions
> sitehttp://ask.cakephp.organdhelp
> > > > > others with their CakePHP related questions.
> >
> > > > > To unsubscribe from this group, send email to
> > > > > [email protected] For more options, visit this
> > > group
> > > > > athttp://groups.google.com/group/cake-php
> >
> > > --
> > > Our newest site for the community: CakePHP Video Tutorials
> > >http://tv.cakephp.org
> > > Check out the new CakePHP Questions sitehttp://ask.cakephp.organd help
> > > others with their CakePHP related questions.
> >
> > > To unsubscribe from this group, send email to
> > > [email protected] For more options, visit this
> group
> > > athttp://groups.google.com/group/cake-php
>
> --
> Our newest site for the community: CakePHP Video Tutorials
> http://tv.cakephp.org
> Check out the new CakePHP Questions site http://ask.cakephp.org and help
> others with their CakePHP related questions.
>
>
> To unsubscribe from this group, send email to
> [email protected] For more options, visit this group
> at http://groups.google.com/group/cake-php
>

-- 
Our newest site for the community: CakePHP Video Tutorials 
http://tv.cakephp.org 
Check out the new CakePHP Questions site http://ask.cakephp.org and help others 
with their CakePHP related questions.


To unsubscribe from this group, send email to
[email protected] For more options, visit this group at 
http://groups.google.com/group/cake-php

Reply via email to