beaureg
(Louerent)
March 28, 2015, 9:19pm
1
My site was built with Yii
On desktop: the translation from French to English works perfectly
On mobile:
1- The site first loads Homepage in French
2- then I click on English and instead of a translated Homepage, the script loads another page.
This is the site: www.louerent.ca
Anyone has a suggestion?
oligalma
(Marc Oliveras)
March 28, 2015, 10:31pm
2
It seems that you are storing the language variable in session, which is wrong. You need to have different url for the same page for different languages. For exammple:
http://www.louerent.ca/en/catalogue
http://www.louerent.ca/fr/catalogue
http://www.louerent.ca/en/contact
http://www.louerent.ca/fr/contact
You can write this on Controller.php:
public function beforeAction($action)
{
if(isset($_GET['lang']))
{
Yii::app()->setLanguage($_GET['lang']);
}
elseif($action->id != 'error')
{
throw new CHttpException(404,'Page not found');
}
return true;
}
You have errors on your html code. For example, a script tag between head and body.
Your site is not responsive at all.
alirz23
(Ali Raza)
March 29, 2015, 7:35am
3
the cookies should not be an issue in this case, what phone device and browser are you using on your phone