Documentation versions

Module reahl.component.i18n

Translator

class reahl.component.i18n.Translator(domain)

Create an instance of this class at the top of your module, in module scope and assign it to the name _ for use in translating literal strings to the language of the current locale.

Parameters:domain – A name identifying which translation catalogue use with this Translator. Always set this to the name of the component where the code resides where this Translator instance is instantiated.
gettext(message)

Returns a six.text_type literal containing a translation of message to the correct language according to the current locale.

ngettext(message_singular, message_plural, n)

Returns a six.text_type literal containing a translation of the given messages in the correct plural (or singular) form of the target language for n items.

current_locale

Returns a string identifying the current locale to be used for the interface.

Documentation versions