localization issue |
go to app config ci4
in this exmple two lang en ,fa so use Accept-Language header. = en or fa, ... change back end lng PHP Code: public $defaultLocale = 'en';
Enlightenment Is Freedom
(05-04-2021, 02:13 AM)InsiteFX Wrote: Read this may help you to understand what were talking about. Thanks for your link. I have always used language file in Codeigniter. In Codeigniter 3 was very easy and all worked perfectly. In Codeigniter 4 i'm having some problems and all is more complicated. So, my question is always the same. How can i use localization in Codigniter 4 (Controller and Routes)? Why localization is been implemented if i have to use a database for build a simple multilingual site?
You don’t have to use a database. It’s useful if you have long text like blog articles in multiple languages. But for single words or sentences you can still use language files like in CI3. The only thing that changed in CI4 I think is the routing with {locale} in the URL.
CodeIgniter 4 tutorials (EN/FR) - https://includebeer.com
/*** NO support in private message - Use the forum! ***/ (05-11-2021, 04:31 AM)includebeer Wrote: You don’t have to use a database. It’s useful if you have long text like blog articles in multiple languages. But for single words or sentences you can still use language files like in CI3. The only thing that changed in CI4 I think is the routing with {locale} in the URL.Thanks for reply @includebeer. No there are some difference. I would like find an example because the documentation is poor. I searched on Google but there isn't anything. I would like understand how to set a controller and routes. I have used localization and it works perfectly but there are some problems and i'm not understanding if i wrong something or if there are possible bug in CI 4. Someone has a project with localization to show me please? A little example...THANKS!
CodeIgniter 4 Language Localization
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 |