translation problem in application\mdoels

edited April 2012 in Modules
for example i create

\fuel\application\models -> articles_model.php

i add

function __construct() { parent::__construct('articles'); // table name $this->load->language('articles'); }

and i create

fuel\application\language\slovenian -> articles_lang.php file

but it always choose

fuel\application\language\english-> articles_lang.php file

even if i choose language slovenian in user preferences. translation works fine for modules. why not working here?

Comments

  • edited 3:20PM
    Do you mean:
    $this->load->language('authors');
    Instead of "articles"?
  • edited April 2012
    sorry i misspell. I mean articles_lang.php so $this->load->language('articles'); is correct but not working.

    Even if language is set to slovenian i get this error:

    An Error Was Encountered Unable to load the requested language file: language/english/authors_lang.php

    i thing problem is in config.php where is set

    $config['language'] = "english";

    and even if i change in admin to "slovenian" still choose english in some modules...

    if i change to

    $this->load->language('articles', 'slovenian');

    then works. But i don't want use fixed language...
  • edited 3:20PM
    i also translate blog_lang.php

    $lang['form_label_formatting'] = 'Formatiranje'; $lang['form_label_author'] = 'Avtor'; $lang['form_label_sticky'] = 'Lepljiv'; $lang['form_label_allow_comments'] = 'Dovoli komentarje'; $lang['form_label_categories'] = 'Kategorije';

    but at form is half english half in our language. Why?
  • edited April 2012
    You can do:
    $this->config->set_item('language', 'slovenian'); $this->load->language('articles', 'slovenian');
    When you say 'i change in admin to "slovenian" still choose english' where are you referring?
  • edited April 2012
    Thx I know this but this solution is not generic. Then if I changed language back to english forms will still be in slovenian language.

    I want to change all form languages when I go to http://url/fuel/my_profile/edit and when I change here language to slovenian all forsm must be translated... the same when I click english...

    what can I do? now

    $this->load->language('articles');

    use english language if I set slovenian in admin (http://url/fuel/my_profile/edit)
  • edited 3:20PM
    When you say "Then if I changed language back to english forms" how are you doing that and is that value being set in a variable that can be used to set the "language" config value?
    $this->config->set_item('language', $my_lang);
  • edited 3:20PM
    i change language alwas by admin (http://url/fuel/my_profile/edit). but $this->load->language('authors'); choose english language instead of slovenian. slovenian is ofcourse choosen by admin (http://url/fuel/my_profile/edit).
  • edited 3:20PM
    Try this for now:
    $user_lang = $this->fuel_auth->user_lang(); $this->config->set_item('language', $user_lang); $this->load->language('articles');
    I'll look into perhaps having that set automatically
  • edited 3:20PM
    Thank you. For automatically i set in Fuel_base_controller.php:

    // set the language based on first the users profile and then what is in the config... (FYI... fuel_auth is loaded in the hooks) $language = $this->fuel_auth->user_data('language'); $this->config->set_item('language', $language);
  • edited 3:20PM
    $this->config->set_item('language', $language);

    I am still having problems, Now i get error "Unable to load the requested language file: fuel/fuel/codeigniter/language/english/fuel_lang.php". I don't know why searching it there!
  • edited 3:20PM
    Is the error happening in the same place in the CMS or is it somewhere else?
  • edited 3:20PM
    when i go to fuel admin: url /fuel/fuel/
Sign In or Register to comment.