Welcome Guest, Not a member yet? Register   Sign In
Localization - In routes method
#1

(This post was last modified: 12-26-2020, 03:36 AM by manager.)

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:
Code:
$routes->get('/{locale}', 'Home::index');

When i open domain.com/ in the browser it shows me content in english.
When i open domain.com/en  - it gives me same content as above.
when i open domain.com/en/home - 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 domain.com/ should give me 404 error, but not? Why?
And what is the best way to make multilanguage app in CI4?

Thanks in advance.
Reply
#2

How to set specific language for all pages in Codeigniter 4
What did you Try? What did you Get? What did you Expect?

Joined CodeIgniter Community 2009.  ( Skype: insitfx )
Reply




Theme © iAndrew 2016 - Forum software by © MyBB