News:

Looking for documentation? Take a look on our wiki

Main Menu

set language via method call

Started by mhs_pro, March 07, 2019, 15:23:43 PM

Previous topic - Next topic

mhs_pro

Hello
I set language by this code
vmLanguage::setLanguage('fa-IR')
but when get language from VmConfig::$vmlang
var_dump(VmConfig::$vmlang);                                      ---Result--> en_gb
return default site language??? :-[ :-[ :-[

and when set $vmlang, $vmlangTag doesn't change

VmConfig::$vmlang = $this->config->get("lan", "fa_ir", "STRING");
var_dump(VmConfig::$vmlang);                                      ---Result--> fa_ir
var_dump(VmConfig::$vmlangTag);                                   ---Result--> en-GB





Milbo

Just use setLanguageByTag instead
Should I fix your bug, please support the VirtueMart project and become a member
______________________________________
Extensions approved by the core team: http://extensions.virtuemart.net/

mhs_pro


Milbo

Be aware, you dont need to reload the language files in the other language! VM does that for you!
Should I fix your bug, please support the VirtueMart project and become a member
______________________________________
Extensions approved by the core team: http://extensions.virtuemart.net/