Thanks for the hint, I'll try to make a helper function.
https://ellislab.com/codeigniter/user-guide/general/helpers.html
Do I have to extend language helper?
This is the language_helper.php
if ( ! function_exists('lang'))
{
function lang($line, $id = '')
{
$CI =& get_instance();
$line = $CI->lang->line($line);
if ($id != '')
{
$line = '<label for="'.$id.'">'.$line."</label>";
}
return $line;
}
}
MY_language_helper.php should be:
if ($this->lang->lang() == "de") $crud->set_language("german");
else
if ($this->lang->lang() == "fr") $crud->set_language("french");
else
if ($this->lang->lang() == "ba") $crud->set_language("bosnian");
else
if ($this->lang->lang() == "hr") $crud->set_language("croatian");
What does this?
$crud = buildCrud();
I think it would be better to change core/MY_Lang, I only have to get the current language name to load the same CRUD language.
// languages
var $languages = array(
'en' => 'english',
'de' => 'german',
'fr' => 'french',
'ba' => 'bosnian',
'hr' => 'croatian'
);
Maybe I could move CRUD languages from assets to the language folder?
Or it would be the easiest way to rename CRUD language files to "en", "de", "fr" etc?