Check if my codeigniter 4 runs in multilingual mode. |
Hi, How do I know if CI4 is running in multilingual mode?
in other words how to know if segment 1 of url presents the key of the language not another variable? because the methode PHP Code: $this->request->getLocale() if no language key founded it return the default value of: PHP Code: $defaultLocale I think even if I use PHP Code: $this->request->getLocale() in_array( this-> request-> config-> supportedLocales)... Please How to be sure of my mode? Thank you all
The multi-language in CodeIgniter should only be used for internal errors and strings.
all major new web browsers now support multi-language and they should do the conversion. You can change the <html lang="en". to a different language and the web browser should pick it up. What did you Try? What did you Get? What did you Expect?
Joined CodeIgniter Community 2009. ( Skype: insitfx )
(05-06-2021, 11:30 AM)InsiteFX Wrote: The multi-language in CodeIgniter should only be used for internal errors and strings. Thanks, but I am working on a back-end solution with 3 different languages. Maybe, I didn't explain it to you well! My problem is whether the current page uses the language key or if the key is just a variable. How can I add a boolean variable when Codeigniter parses the fisrt key as a language key and that variable should be callable anywhere in my program. For example: $ in_multilingual_mode = false; When CodeIgniter interprets the first segment as a key the variable turns it would change to $ in_multilingual_mode = true; I have a specific case for that. Thank you
05-10-2021, 01:52 AM
(This post was last modified: 05-10-2021, 01:54 AM by InsiteFX. Edit Reason: Added array usage )
You may need to use the _remap method.
Remapping Method Calls PHP Code: public function _remap($method, $params = array()) What did you Try? What did you Get? What did you Expect?
Joined CodeIgniter Community 2009. ( Skype: insitfx )
|
Welcome Guest, Not a member yet? Register Sign In |