Product support

Visit this product's website for support.


  • Developer Tools
  • Miscellaneous
  • Utility

Selecting a language

Different languages can be set up in the back-end area, with a single default language selected. This activates the use of the language on the front-end and in the back-end UI.

A visitor can select a language by prefixing the language code to the URL, this is then stored in the user's session as their chosen language. For example:

  • http://website/ru/ will display the site in Russian
  • http://website/fr/ will display the site in French
  • http://website/ will display the site in the default language or the user's chosen language.

Language Picker Component

A visitor can select their chosen language using the LocalePicker component. This component will display a simple dropdown that changes the page language depending on the selection.

title = "Home"
url = "/"


<h3>{{ 'Please select your language:'|_ }}</h3>
{% component 'localePicker' %}

If translated, the text above will appear as whatever language is selected by the user. The dropdown is very basic and is intended to be restyled. A simpler example might be:


    Switch language to:
    <a href="#" data-request="onSwitchLocale" data-request-data="locale: 'en'">English</a>,
    <a href="#" data-request="onSwitchLocale" data-request-data="locale: 'ru'">Russian</a>

Message translation

Message or string translation is the conversion of adhoc strings used throughout the site. A message can be translated with parameters.

{{ 'site.name'|_ }}

{{ 'Welcome to our website!'|_ }}

{{ 'Hello :name!'|_({ name: 'Friend' }) }}

A message can also be translated for a choice usage.

{{ 'There are no apples|There are :number applies!'|__(2, { number: 'two' }) }}

Themes can provide default values for these messages by defining a translate key in the theme.yaml file, located in the theme directory.

name: My Theme
# [...]

        site.name: 'My Website'
        nav.home: 'Home'
        nav.video: 'Video'
        title.home: 'Welcome Home'
        title.video: 'Screencast Video'

You may also define the translations in a separate file, where the path is relative to the theme. The following definition will source the default messages from the file config/lang.yaml inside the theme.

name: My Theme
# [...]

translate: config/lang.yaml

Content translation

This plugin activates a feature in the CMS that allows content files to use language suffixes, for example:

  • welcome.htm will contain the content in the default language.
  • welcome.ru.htm will contain the content in Russian.
  • welcome.fr.htm will contain the content in French.

Model translation

Models can have their attributes translated by using the RainLab.Translate.Behaviors.TranslatableModel behavior and specifying which attributes to translate in the class.

class User
    public $implement = ['RainLab.Translate.Behaviors.TranslatableModel'];

    public $translatable = ['name'];

The attribute will then contain the default language value and other language code values can be created by using the translateContext() method.

$user = User::first();

// Outputs the name in the default language
echo $user->name;


// Sets the name in French
$user->name = 'Giselle';

// Outputs the name in French
echo $user->name;

The lang() method is a shorthand version of translateContext() and is also chainable.

// Outputs the name in French
echo $user->lang('fr')->name;

This can be useful inside a Twig template.

{{ user.lang('fr').name }}

There are ways to get and set attributes without changing the context.

// Gets a single translated attribute for a language
$user->getTranslateAttribute('name', 'fr');

// Sets a single translated attribute for a language
$user->setTranslateAttribute('name', 'Jean-Claude', 'fr');

Conditionally extending plugins


It is possible to conditionally extend a plugin's models to support translation by placing an @ symbol before the behavior definition. This is a soft implement will only use TranslatableModel if the Translate plugin is installed, otherwise it will not cause any errors.

 * Blog Post Model
class Post extends Model


     * Softly implement the TranslatableModel behavior.
    public $implement = ['@RainLab.Translate.Behaviors.TranslatableModel'];

     * @var array Attributes that support translation, if available.
    public $translatable = ['title'];



The back-end forms will automatically detect the presence of translatable fields and replace their controls for multilingual equivalents.


Since the Twig filter will not be available all the time, we can pipe them to the native Laravel translation methods instead. This ensures translated messages will always work on the front end.

 * Register new Twig variables
 * @return array
public function registerMarkupTags()
    // Check the translate plugin is installed
    if (!class_exists('RainLab\Translate\Behaviors\TranslatableModel'))

    return [
        'filters' => [
            '_' => ['Lang', 'get'],
            '__' => ['Lang', 'choice'],
  • Found the plugin useful on 14 Aug, 2018

    Manage cities for your app, countries with their cities coming soon

  • Found the plugin useful on 26 Mar, 2018

    Hi guys, menu titles do not change. How can I fix this? The menu does not change when I change the language. I am creating a static [email protected] Help Please

  • Found the plugin useful on 17 Dec, 2017

    I use this plugin and plugin news , but I do not want the slug in the post as multi-language. I want the slug to be fixed. How do I do ? I have a suggestion that, when changing the language at a certain position, all languages in the other position will change. For example: I clicked change language from English to English in the title textbox, the other positions (such as content, summary, ...) are automatically selected in English.

    And... This is great plugin ! Thanks

  • Found the plugin not useful on 23 Oct, 2017

    This plugin broke my whole site ...

    BadMethodCallException in CmsObjectQuery.php line 128: Call to undefined method Cms\Classes\CmsObjectQuery::extend() in CmsObjectQuery.php line 128 at CmsObjectQuery->call('extend', array(object(Closure))) at call_user_func_array(array(object(CmsObjectQuery), 'extend'), array(object(Closure))) in CmsObject.php line 555 at CmsObject->__call('extend', array(object(Closure))) at call_user_func_array(array(object(Page), 'extend'), array(object(Closure))) in CmsObject.php line 571 at CmsObject::callStatic('extend', array(object(Closure))) in Plugin.php line 47 at Plugin->register() in PluginManager.php line 185 at PluginManager->registerPlugin(object(Plugin), 'RainLab.Translate') in PluginManager.php line 151 at PluginManager->registerAll() in ServiceProvider.php line 46 at ServiceProvider->register() in Application.php line 494 at Application->register(object(ServiceProvider)) in ProviderRepository.php line 75 at ProviderRepository->load(array('Illuminate\Bus\BusServiceProvider', 'Illuminate\Cache\CacheServiceProvider', 'Illuminate\Foundation\Providers\ConsoleSupportServiceProvider', 'Illuminate\Routing\ControllerServiceProvider', 'Illuminate\Cookie\CookieServiceProvider', 'Illuminate\Encryption\EncryptionServiceProvider', 'Illuminate\Foundation\Providers\FoundationServiceProvider', 'Illuminate\Hashing\HashServiceProvider', 'Illuminate\Pagination\PaginationServiceProvider', 'Illuminate\Pipeline\PipelineServiceProvider', 'Illuminate\Queue\QueueServiceProvider', 'Illuminate\Redis\RedisServiceProvider', 'Illuminate\Session\SessionServiceProvider', 'Illuminate\Validation\ValidationServiceProvider', 'Illuminate\View\ViewServiceProvider', 'October\Rain\Foundation\Providers\ArtisanServiceProvider', 'October\Rain\Database\DatabaseServiceProvider', 'October\Rain\Filesystem\FilesystemServiceProvider', 'October\Rain\Parse\ParseServiceProvider', 'October\Rain\Html\HtmlServiceProvider', 'October\Rain\Html\UrlServiceProvider', 'October\Rain\Network\NetworkServiceProvider', 'October\Rain\Scaffold\ScaffoldServiceProvider', 'October\Rain\Flash\FlashServiceProvider', 'October\Rain\Mail\MailServiceProvider', 'System\ServiceProvider')) in Application.php line 468 at Application->registerConfiguredProviders() in RegisterProviders.php line 15 at RegisterProviders->bootstrap(object(Application)) in Application.php line 183 at Application->bootstrapWith(array('October\Rain\Foundation\Bootstrap\RegisterClassLoader', 'Illuminate\Foundation\Bootstrap\DetectEnvironment', 'October\Rain\Foundation\Bootstrap\LoadConfiguration', 'October\Rain\Foundation\Bootstrap\LoadTranslation', 'October\Rain\Foundation\Bootstrap\ConfigureLogging', 'Illuminate\Foundation\Bootstrap\HandleExceptions', 'Illuminate\Foundation\Bootstrap\RegisterFacades', 'October\Rain\Foundation\Bootstrap\RegisterOctober', 'Illuminate\Foundation\Bootstrap\RegisterProviders', 'Illuminate\Foundation\Bootstrap\BootProviders')) in Kernel.php line 199 at Kernel->bootstrap() in Kernel.php line 110 at Kernel->sendRequestThroughRouter(object(Request)) in Kernel.php line 84 at Kernel->handle(object(Request)) in index.php line 43

    Any fix for this?

  • Found the plugin useful on 21 Apr, 2017

    Nice work :)

  • Found the plugin useful on 5 Mar, 2017

    F - A - N - T - A - S - T - I - C

  • Found the plugin useful on 10 Feb, 2017

    i download the theme vega pro and i have an error because i don't have the layout clean.https://octobercms.com/theme/vojtasvoboda-vega-pro

  • Found the plugin useful on 27 Jan, 2017

    is there a local language file for welsh if not how do I go about creating one

  • Found the plugin useful on 19 Jan, 2017

    Hello, good plugin but how translate static menu?

  • Found the plugin useful on 30 Oct, 2016

    Really useful, specially with the new url translation feature! Thank you very much!

  • Found the plugin useful on 5 Oct, 2016

    if you need to access the active language from the code, use the Translator class: $this-&gt;translator = Translator::instance(); $this-&gt;locale = $this-&gt;translator-&gt;getLocale();

  • Found the plugin useful on 17 Jul, 2016

    Hey i didnt find any option to identify the lang in process. i want to change RTL for hebrew lang, for custom css. anyway i can do it? thanks.

  • Found the plugin useful on 30 Jun, 2016

    I find this plugin really useful!!! Some Bug... Hebrew not work! I Changed he to heb but steel Translate Messages not works! You may Look at the my site www.ghiml.co.il. Content in hebrew header and footer in english.

  • Found the plugin useful on 28 Jun, 2016

    It is amazing!!!!

  • Found the plugin useful on 10 Jun, 2016

    Thanks! That's what I was looking for! But not figure out possibility to use partials files as content files.

  • Found the plugin useful on 28 May, 2016

    Very nice plugin! I there an option to convert cyrillic characters to latin only? Like on button click

  • Found the plugin useful on 12 Apr, 2016

    Love this plugin! @Hessel, it will be perfect real soon! It already works in our testing website with the option for "Bleeding edge updates" turned on. I think it all wil be part of the upcoming version 1

  • Found the plugin not useful on 21 Mar, 2016

    It would be perfect if it worked with Static Pages!! But unfortunatelly it doesn't =( Rainlab doesn't respond to any questions or feedback from users since 2014

  • Found the plugin useful on 16 Feb, 2016

    It is the most useful translation system. Thanks ans sorry for my english :D

  • Found the plugin useful on 5 Feb, 2016


  • Found the plugin useful on 18 Oct, 2015

    This is quite good plugin and the methods are easy enough but unfortunately without url translation it negatively infects the SEO so cannot be used for paying customers.

  • Found the plugin useful on 11 Oct, 2015

    very awosem loving october deep down!

  • Found the plugin useful on 5 Oct, 2015

    Awesome plugin, thanks for that!

  • Found the plugin useful on 17 Aug, 2015

    This is a great plugin but I am having a hard time with caching.

    For example if I navigate to the Pirate's language URL then switch back to English I still view the Pirate language messages. I tried clearing the cache thousand times in my console, in the plugin interface, using a cache cleaner plugin /disabling cache and settings English as default language!

    I'd like to know if this is a bug and if not why is this happening. Am I missing something ?

    Again Thank you Samuel for this life-saver CMS / plugins.

  • Found the plugin useful on 1 Aug, 2015

    Thank you! This plugin is life-saver! ;)

  • Found the plugin useful on 31 May, 2015

    it's very useful for my project

  • Found the plugin useful on 4 May, 2015

    Hi, many thanks for this quality work. I live in Belgium and here, any site must be multilingual, we have three national languages. How to directly detect the browser language?

  • Found the plugin not useful on 30 Apr, 2015

    Hello. This not working in home page

  • Found the plugin useful on 29 Apr, 2015

    cool...thanks :D

  • Found the plugin useful on 5 Mar, 2015

    Amazing plugin! Thanks for all the hard work! :)

  • Found the plugin useful on 15 Feb, 2015

    Спасибо! :)

  • Found the plugin useful on 22 Dec, 2014

    Really helpful. @VoipDeploy Why don't you just open an issue in github?

  • Found the plugin not useful on 5 Nov, 2014

    because of the reported issues, plugin is useless for me. i ended up putting translations directly to the database as i gone tired and really frustrated with messages not saving from the GUI.

  • Found the plugin useful on 3 Nov, 2014

    How about translating the url itself? it would be nice to translate the path when creating new pages...

  • Found the plugin useful on 22 Oct, 2014

    how to handle content translation inside blog post? such as wordpress plugin qtranslate.

  • Found the plugin useful on 12 Aug, 2014

    Oh yeas I find this plugin really useful. Thank you very much, it's awesome.


Updated Hungarian translation. Added Arabic translation. Fixed issue where default texts are overwritten by import. Fixed issue where the language switcher for repeater fields would overlap with the first repeater row.

Aug 30, 2018


Add importer and exporter for messages

Feb 14, 2018


Keep query string when switching locales

Jan 28, 2018


Fix config reference in LocaleMiddleware

Jan 11, 2018


Fix Middleware to use the prefixDefaultLocale setting introduced in 1.3.4

Jan 07, 2018


Fix MLRepeater bug when switching locales.

Dec 22, 2017


Add alternate hreflang elements and adds prefixDefaultLocale setting.

Nov 17, 2017


Fix to the locale picker session handling in Build 420 onwards.

Nov 02, 2017


Improved compatibility with RainLab.Pages, added ability to scan Mail Messages for translatable variables.

Oct 26, 2017


Added reordering to languages

Aug 29, 2017


Added search to the translate messages page.

Jul 14, 2017


Add support for translating the new grouped repeater feature.

Apr 23, 2017


Fixes translation not working with partials loaded via AJAX

Apr 10, 2017


Minor UI fix to the multilingual repeater.

Feb 02, 2017


Fixes context for translated strings when used with Static Pages.

Jan 10, 2017


Improvements to code for latest October build compatibility.

Dec 13, 2016


Fixes placeholder usage with static pages plugin.

Nov 11, 2016


Fixes repeater usage with static pages plugin.

Nov 04, 2016


Adds new multilingual repeater form widget.

Oct 22, 2016


Translatable attributes can now be declared as indexes.

Aug 19, 2016


Fixes Rich Editor when inserting a page link.

Aug 12, 2016


Static Pages now support translating the URL.

Aug 05, 2016


Minor update in the rich editor and code editor language control position.

Jul 31, 2016


CMS pages now support translating the URL.

Jul 29, 2016


Fixes bug not showing content when first loading multilingual textarea controls.

Jul 12, 2016


Minor improvements in the message editor.

Jul 11, 2016


Minor update to the multilingual control API.

Jul 04, 2016


Adds new multilingual markdown editor.

May 25, 2016


Improved support for the multilingual rich editor.

May 23, 2016


Add support for translating Static Content files.

May 06, 2016


Minor UI fix to the language picker.

Apr 20, 2016


Introduce compatibility with RainLab.Pages plugin.

Apr 01, 2016


Fix multilingual rich editor when used in stretch mode.

May 15, 2015


Minor fix for latest build.

Apr 28, 2015


Fixes an issue where newly created models lose their translated values.

Mar 13, 2015


Minor bug fixes

Mar 04, 2015


Fixes major bug where translations are skipped entirely!

Feb 26, 2015


Minor improvements to the code.

Feb 13, 2015


Add spanish language and fix config plugin .

Nov 21, 2014


Locale cache will clear when updating a language.

Oct 10, 2014


Minor updates for latest October release.

Sep 28, 2014


Languages and Messages can now be deleted.

Aug 05, 2014


First version of Translate

Aug 02, 2014