• 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
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.
Test your translation files with Translation Tester
Reply


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

Digg   Delicious   Reddit   Facebook   Twitter   StumbleUpon  


  Theme © 2014 iAndrew  
Powered By MyBB, © 2002-2020 MyBB Group.