form_validation language not loading |
[eluser]egonr82[/eluser]
Hello, system: windows 7, wamp server, php 5.3.0 and CI 1.7.2 form_validation library does not change language: Code: $this->lang->load('estonian','estonian'): in form_validation.php Code: function _translate_fieldname($fieldname) fragment: Code: $this->CI->lang->line($line) returns nothing estonian_lang.php includes: Code: $lang['register_username'] = 'Soovitud kasutajanimi'; functions like Code: lang('register_username'); why i cant change language for errors?
[eluser]imn.codeartist[/eluser]
to change your system error message in your local language go to the system/language folder and add new folder of your language copy all the files from the system/language/english into system/language/yourlanguage open all files from system/language/yourlanguage and change the message according to your language. It should solve your problem. Dixanta Shrestha [email protected]
[eluser]egonr82[/eluser]
thnx, i got it loading wrong language file. I have header view where i call function to set language: Code: function set_lang() so default is estonian. I also have change language function: Code: function lang() this doesnt do the trick for me. form_validation still uses english for variables and error messages. If my form validation function looks like this: Code: $this->lang->load('estonian','estonian'); i get variables in estonian, but error messages in english. If i try to autoload ($autoload['language'] = array('english', 'estonian') estonian i get error like this: Unable to load the requested language file: language/english/estonian_lang.php PS! Both language folders are in place /system/languages/estonian - form_validation_lang.php with edited messages /system/application/estonian/ - estonian_lang.php with mentioned variable so what is the right way for setting and changing languages in allover system? I dont even understand why there is two language folders needed??
[eluser]egonr82[/eluser]
so is this bug or not??? that it does not load estonian error messages from ./system/language/estonian/form_validation_lang.php ?
[eluser]imn.codeartist[/eluser]
its not a bug as mine works perfectly fine. there should be some problem u ur coding please place all the codes
[eluser]egonr82[/eluser]
i made test controller for this: Code: <?php if ( ! defined('BASEPATH')) exit('No direct script access allowed'); test view for this: Code: <?php this outputs: The Kasutajanimi field is required. Kasutajanimi is right and is from ./system/application/language/estonian_lang.php Code: $lang['username'] = 'Kasutajanimi'; But error message should be "Kasutajanimi on nõutud." as stated in ./system/language/estonian/form_validation_lang.php Code: $lang['required'] = "%s on nõutud."; my config file: Code: $config['language'] = "english"; my autload file: Code: $autoload['language'] = array(); i in trouble help me out please.
[eluser]imn.codeartist[/eluser]
since, there is still english at ur config. the error messages are displaying in english
[eluser]imn.codeartist[/eluser]
[quote author="dixcoder" date="1254467000"]since, there is still english at ur config. the error messages are displaying in english[/quote] I have made bit modification in your controller. Code: <?php if ( ! defined('BASEPATH')) exit('No direct script access allowed');
|
Welcome Guest, Not a member yet? Register Sign In |