CodeIgniter Forums
Localization - In routes method - Printable Version

+- CodeIgniter Forums (
+-- Forum: Using CodeIgniter (
+--- Forum: General Help (
+--- Thread: Localization - In routes method (/showthread.php?tid=78271)

Localization - In routes method - manager - 12-26-2020

Hi everyone. 
I'm trying to make multilanguage site with two languages (en, ru).
In app/config default lang set as 'en'.
I have a route with a locale placeholder like this:
$routes->get('/{locale}', 'Home::index');

When i open in the browser it shows me content in english.
When i open  - it gives me same content as above.
when i open - it gives me same content as above

The first question is how to avoid this kind of situation?
And i thought if i added 'locale' placeholder , then should give me 404 error, but not? Why?
And what is the best way to make multilanguage app in CI4?

Thanks in advance.

RE: Localization - In routes method - InsiteFX - 12-26-2020

How to set specific language for all pages in Codeigniter 4