This plugins extends default behavior of the RainLab's Translate plugin with following features:
- detect browser language (optional)
- display (and save into session) most preferred browser language instead of the default one (optional)
- force browser language detection on every visit (optional)
- prefix all routes with SEO-friendly locale short code (optional)
New in 1.0.6
- added support for translated URLs
- added support for websites that are not in domain root directory
important!!! if you created custom ExtendedLocalePicker you have to update it! check
plugins/excodus/translateextended/components/extendedlocalepicker/default.htm for new href value
New in 1.0.4
- added extended locale picker for routes prefixed with locale short code
New in 1.0.2
- backend switch to opt-out from route prefixing
- backend switch to opt-out from browser language detection
- backend switch to force browser language detection (ignore user session)
- improved preferred language matching
- opting-in prefixing "|app" filter routes
Free and open-source
If you have any problems please submit them to the support forum or github page. I will try to solve them as quickly as possible.
The Rainlab's Translate Plugin have two scenarios of displaying translated content:
http://website/lang/will display the site in the language with 'lang' short code.
http://website/will display the site in the default language unless the user chooses preferred language
After installing the Translate Extended, when user visits the website for the first time:
- plugin will get most preferred user languages (from browser settings) and try to match them with the enabled translations in Rainlab's Tranlsate plugin
- if match is found, this preference will be saved into user session and displayed immediately
- if there is no match, website will be displayed in default language (from the Rainlab's Tranlsate plugin settings)
- route will be SEO-friendly, automatically prefixed with proper language shortcode
After you change the route, it will be automatically prefixed with chosen language. If you manually enter the language URI in the address bar it will be saved in the user session and displayed immediately .
Note: by default, most preferred browser language is saved into user session on first visit. So next time user enters the website, locale won't be automatically detected anymore (it will be restored from the user session). There is possibility to force language detection on every visit in Translate Extended settings in backend area.
Extended Locale Picker
There is custom locale picker component in the plugin. If you want to use locale prefixes in the URL, default locale picker from Rainlab's Translate probably won't work correctly. Extended Locale Picker "forces" correct locale prefixes, because it uses href attribute instead of ajax handler.
Translate Extended have few setting available in the backend area under "Translate" category (so where Translate plugin settings reside)
Language short codes
In order to work property Translate Extended needs correct language codes to be set in the Rainlab's Tranlsate plugin. Language codes need to be identical with the ISO 639 Language Codes that are transmitted in the HTTP header "HTTP_ACCEPT_LANGUAGE". See Web browser language identification codes for a full list of language codes.
Found the plugin useful on 1 Sep, 2019
Found the plugin useful on 29 Nov, 2018
Looks good. Can page titles be translated in Rainlab CMS ?
Found the plugin useful on 20 Apr, 2017
works out of the box, thank you
Found the plugin useful on 4 Apr, 2017
Thank you for this. Works as expected!
Found the plugin useful on 9 Jan, 2017
It works for the first try. Thanks for great work!
Specified 'web' middleware for Laravel 5.5 support
Apr 24, 2018
Support for translated page URLs
May 09, 2017
May 09, 2016
Added extended locale picker
Apr 25, 2016
Fixed default plugin settings
Apr 20, 2016
Apr 20, 2016
First version of Translate Extended
Apr 14, 2016