Retrive lang string from URI Language Identifier |
[eluser]John-Doe[/eluser]
Hello, Im using URI Language Identifier (https://github.com/EllisLab/CodeIgniter/...Identifier). I have set up so the URL changes right, like following: http://example.com/fi/test http://example.com/en/test http://example.com/de/test The following is in my config file: Code: $config['language'] = 'english'; In application/core I have the file MY_Lang.php with the code: https://github.com/EllisLab/CodeIgniter/...Identifier (application/core/MY_Lang.php) But how should I retrive the "fi", "en" or "de" param? I have tried the following - which is stated on the GITHUB page - in my controller: Use the $config['language'] value or $config['lang_abbr'] to determine the active language when loading your application or module. With the above codes I get: Code: Severity: Notice I have also tried $this->config->item('lang_uri_abbr'); which is stated in this Stackoverflow thread: http://stackoverflow.com/questions/13237...identifier This generates an array with all the short codes for the language, but not the active language. How do I retrieve the language param?
[eluser]John-Doe[/eluser]
I went with this as a solution instead: https://github.com/EllisLab/CodeIgniter/...ation-i18n Works flawless! |
Welcome Guest, Not a member yet? Register Sign In |