Internationalisation

Mark strings displayed to a user with the customary underscore notation, eg _('some message').

Reahl provides tools based on Babel that allows you to search all your source code to find such translatable messages and to manage the process of providing translated versions.

Try it out

  • Click on the pills below to switch languages.

This is a translated message. The current URL is "/i18nexample/some_page".

class I18nExample(Widget):
    def __init__(self, view):
        super(I18nExample, self).__init__(view)

        menu = Nav(self.view).use_layout(PillLayout()).with_languages()
        self.add_child(menu)

        current_url = Url.get_current_url()
        message = _('This is a translated message. The current URL is "%s".') % current_url.path
        self.add_child(P(view, text=message))