Results 1 to 2 of 2

Thread: [RESOLVED] Problem with changing locale

  1. #1
    Join Date
    Jul 2011

    resolved [RESOLVED] Problem with changing locale

    Hi, I need to change locale in runtime.
    I use Kohana 2.3.4.
    I defined default locale in file locale.php
    PHP Code:
    $config['language'] = array('no''Norsk'); 
    When site language is changed I also change locale
    PHP Code:
    Kohana::config_set('locale.language', array('en''United States')); 
    But after redirection to any page locale gets it default value from locale.php.
    I didn't find any method to change locale in documentation.
    Does anyone know why it doesn't work?
    Last edited by kromol; 11-09-2011 at 07:28 AM.

  2. #2
    Join Date
    Jul 2011
    I solved the problem moving changing locale in the constructor of the parent controller.
    Kohana uses default locale defined in file locale.php, that's why it didn't work after redirection.
    So when user changes the language, I save it in the session and then I change locale in the parent controller using chosen language from session.

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
HTML5 Development Center