Universeorange.com/Docs/

R3m/framework Function reference __

{__(String $attribute)}

Get the attribute value from the translation file.

An example of a translation file:

{ 
    "route" : {
        "index" : {
            "en" : "{route.get('index', ['en'])}",
            "nl" : "{route.get('index', ['nl'])}"
    }
}

Before you can use {__()}, {import.translation()} needs to be loaded first.

Example:

{import.translation()}
{$route = __('route.index')} // https://example.com/en/index.html
{session('language', 'nl')} // default language is 'en'
{$route = __('route.index')} // https://example.com/nl/index.html
Last modified: 2021-06-07

© 2021 universeorange.com