Welcome Guest, Not a member yet? Register   Sign In
Multi-language support - How to change language in the view?
#5

(06-30-2019, 04:20 AM)yamahdico Wrote: Thanks for your reply but I'm still having this issue. Exclamation
It is intended to display on one page five languages simultaneously in the view.

Idea for example "$request->setLocale('ru')". This command only works in the control.

We need to run this command or same code in the view for switch languages concurrently.

All the “hard work” should be done in the controller, never in the view. It can be done in a model or library but the final result should be fetched by the controller and passed to the view. 

If you want to get the same language string in five different languages, you can call setLocale for each languages, get the translated text string and store the result in an array, and then pass this array of text to the view so it can be displayed in the HTML document or used in JavaScript.
CodeIgniter 4 tutorials (EN/FR) - https://includebeer.com
/*** NO support in private message - Use the forum! ***/
Reply


Messages In This Thread
RE: Multi-language support - How to change language in the view? - by includebeer - 07-01-2019, 06:00 AM



Theme © iAndrew 2016 - Forum software by © MyBB