Issue for loading language in controller |
Hi, i would like compile the meta hreflang tag dynamically and navigate the pages like in Joomla.
My site is in italian and english. Default language should be italian. My code: Config/App.php PHP Code: public $defaultLocale = 'it'; Controller Main.php PHP Code: <?php namespace App\Controllers\It; View main.php PHP Code: <link rel="alternate" hreflang="it" href="<?php echo base_url($ita);?>" /> The meta tag are ok but the site (in italian too) is always translate in english. If i change the order in controller like this: PHP Code: <?php namespace App\Controllers\It; the site is always translate in italian. What happens? Why i have this behavior? Thanks for help me! ![]()
Because you need to check to see which language should be displayed first
then add it to the data. What did you Try? What did you Get? What did you Expect?
Joined CodeIgniter Community 2009. ( Skype: insitfx )
You should have a dropdown and allow the user to select the language or get the local setting.
Read this: 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 |