Kiko Balco
Kiko Balco

Hi there, I've got one problem with Translate plugin. I'm creating website, which needs to be translated into 2 languages. Everything is being transalted well, but there is one bug I need to fix.When reaching root url of website there is not loaded default language, but last loaded language. It means, that if I have default language English and then I load German translation with localhost/de a and turn back to localhost/, german translation will remain loaded instead of loading english version.

Problem is that I need deafult language urls without language shortcut.

Thank you for any suggestions

pavsid
pavsid

Testing out the Translate plugin now and just noticed this - anyone know a solution? I am migrating a multi-regional site to OctoberCMS which has all root URLs e.g. /, /about, /contact as the default lang (en), and all other locales under their respective code e.g. /de/, /de/about, /de/contact.

pavsid
pavsid

Just found the config option prefixDefaultLocale which solves my problem when set to false. Not sure if there is risk of this being overwritten on next plugin update though. There should be an option in the backend, or a way to override it from the theme.

mjauvin
mjauvin

actually, you need to use forceUrl=1 to solve this particular problem (in the localepicker component wizard when inserting it to your page/layout).

the prefixDefaultLocale config value is only to prefix the default locale to the URL when not present. If you do not want the default locale URL to be prefixed, set this to false.

Note: you need to install the plugin's config.php file into ~/config/rainlab/translate/config.php if you want to change its settings without losing changes when plugin is updated.

pavsid
pavsid

Thank you @marc.jauvin24240

bycel56556
bycel56556

mjauvin said:

actually, you need to use forceUrl=1 to solve this particular problem (in the localepicker component wizard when inserting it to your page/layout).

the prefixDefaultLocale config value is only to prefix the default locale to the URL when not present. If you do not want the default locale URL to be prefixed, set this to false.

Note: you need to install the plugin's config.php file into ~/config/rainlab/translate/config.php if you want to change its settings without losing changes when plugin is updated.

Thank you very much! I wont to add 2 step to get SEO friendly site.

  1. set 'prefixDefaultLocale' to false in the plugin's config.php file
  2. check 'Force URL schema' in Locale Picker or set forceUrl=1in htm file. In this case you can get correct sitemap.xml and alternate links in head.
klas.wirholm
klas.wirholm

Install the Translate Extended for RainLab:

https://octobercms.com/plugin/excodus-translateextended

Then you can force language prefix. If enabled, all GET requests for URLs without a shortcode will be prefixed with the locale shortcode

1-7 of 7