Hi everyone,
I’ve made a website in french (it will be the default language) and I want know to make the english version. I followed the guide but it doesn’t work. Maybe I missed something.
What I do step by step :
-
I create the “config” folder.
-
I create the “config.php” file.
-
In “config.php”, I copy-paste the code given in the guide to enable to switch between languages.
<?phpreturn [
‘languages’ => true,
];
At this point nothing has changed, the website is still running. Now I have to set the default language.
So 4) I create the “languages” folder.
5) I create the “fr.php” file, since my default language will be french.
6) I configure the “fr.php” to french :
<?php
return [
'code' => 'fr',
'default' => true,
'direction' => 'ltr',
'locale' => 'fr_FR',
'name' => 'Francais',
];
At this point, everything seems ok in the panel, I can see the french language in the settings. My main URL redirect to “mainurl/fr”, wich is a default page that only show a title (home). Next steps of the guide may fix it.
-
I add " ‘url’ => ‘/’, " to the fr.php. In this file, the code seems to have automatically changed, probably when I clicked on the edit button of the language in the site settings panel. Now it looks like
<?phpreturn [
‘code’ => ‘fr’,
‘default’ => true,
‘direction’ => ‘ltr’,
‘locale’ => [
‘LC_ALL’ => ‘fr_FR’
],
‘name’ => ‘Francais’,
‘translations’ => [], 'url' => '/',
];
Next steps doesn’t concerns me so I skip it.
At this point the main url is not redirecting to “mailurl/fr” but the page shown is still showing a default page only containing the title (home). All pages have disappeared in the panel.
Do I’ve missed something ?
Thx for your help
Edit :
Something very strange is that some pages are showing the right template but without any content (wich I fix by copy-pasting the content of my “page.txt” into the automatically created “page.fr.txt” wich was empty) whereas some are showing the default template. This looks arbitrary : some main pages uses the right template, some aren’t, some of the sub pages uses the right template, some of the subpages of the same page aren’t.