b.i18n : module documentation

Part of bzrlib

i18n and l10n support for Bazaar.
Function gettext Translate message.
Function ngettext Translate message with plural forms based on number.
Function N_ Mark message for translation but don't translate it right away.
Function gettext_per_paragraph Translate message per paragraph.
Function disable_i18n Do not allow i18n to be enabled. Useful for third party users
Function installed Returns whether translations are in use or not.
Function install Enables gettext translations in bzr.
Function install_translations Create a gettext translation object.
Function add_fallback Add a fallback translations object. Typically used by plugins.
Function uninstall Disables gettext translations.
Function load_plugin_translations Load the translations for a specific plugin.
Function _get_locale_dir Returns directory to find .mo translations file in, either local or system
Function _check_win32_locale Undocumented
Function _get_current_locale Undocumented
def gettext(message):
Translate message.
Returnstranslated message as unicode.
def ngettext(singular, plural, number):
Translate message with plural forms based on number.
ParameterssingularEnglish language message in singular form
pluralEnglish language message in plural form
numberthe number this message should be translated for
Returnstranslated message as unicode.
def N_(msg):
Mark message for translation but don't translate it right away.
def gettext_per_paragraph(message):
Translate message per paragraph.
Returnsconcatenated translated message as unicode.
def disable_i18n():
Do not allow i18n to be enabled. Useful for third party users of bzrlib.
def installed():
Returns whether translations are in use or not.
def install(lang=None):
Enables gettext translations in bzr.
def install_translations(lang=None, domain='bzr', locale_base=None):
Create a gettext translation object.
Parameterslanglanguage to install.
domaintranslation domain to install.
locale_baseplugins can specify their own directory.
Returnsa gettext translations object to use
def add_fallback(fallback):
Add a fallback translations object. Typically used by plugins.
Parametersfallbackgettext.GNUTranslations object
def uninstall():
Disables gettext translations.
def _get_locale_dir(base):
Returns directory to find .mo translations file in, either local or system
Parametersbaseplugins can specify their own local directory
def _check_win32_locale():
Undocumented
def _get_current_locale():
Undocumented
def load_plugin_translations(domain):
Load the translations for a specific plugin.
ParametersdomainGettext domain name (usually 'bzr-PLUGINNAME')
API Documentation for Bazaar, generated by pydoctor at 2022-06-16 00:25:16.