Package dogtail :: Module i18n
[hide private]
[frames] | no frames]

Module i18n

source code

Internationalization facilities

Authors: David Malcolm <dmalcolm@redhat.com>


Author: David Malcolm <dmalcolm@redhat.com>, Zack Cerza <zcerza@redhat.com>

Classes [hide private]
  TranslationDb
Abstract base class representing a database of translations
  GettextTranslationDb
Implementation of TranslationDb which leverages gettext, using a single translation mo-file.
  TranslatableString
Class representing a string that we want to match strings against, handling translation for us, by looking it up once at construction time.
Functions [hide private]
 
safeDecode(string) source code
 
safeEncode(string) source code
 
translate(srcString)
Look up srcString in the various translation databases (if any), returning a list of all matches found (potentially the empty list)
source code
 
isMoFile(filename, language='')
Does the given filename look like a gettext mo file?
source code
 
loadAllTranslationsForLanguage(language) source code
 
getMoFilesForPackage(packageName, language='', getDependencies=True)
Look up the named package and find all gettext mo files within it and its dependencies.
source code
 
loadTranslationsFromPackageMoFiles(packageName, getDependencies=True)
Helper function which appends all of the gettext translation mo-files used by the package (and its dependencies) to the translation database list.
source code
Variables [hide private]
  translationDbs = []
  __package__ = 'dogtail'
Function Details [hide private]

isMoFile(filename, language='')

source code 

Does the given filename look like a gettext mo file?

Optionally: Does the file also contain translations for a certain language, for example 'ja'?

getMoFilesForPackage(packageName, language='', getDependencies=True)

source code 

Look up the named package and find all gettext mo files within it and its dependencies. It is possible to restrict the results to those of a certain language, for example 'ja'.