# Example of Translation

Translation of wordings can be easily done by adding functions to template tags.

Example below shows you 2 flavours in translating messages into different languages.

    # in controller
    $data['dynamic_msg'] = 'This can be translated';
    $data['dynamic_key_msg'] = array('welcome_user', 'Welcome to my site, Mr. User!');
    $data['dynamic_key_msg2'] = array('input_invalid', 'Invalid input for email address.');

    # in view
    {{t(dynamic_msg)}}
    {{t2(dynamic_key_msg)}}
    {{t2(dynamic_key_msg2)}}

BACK TO TOP