~zyga/checkbox/investigation

Viewing all changes in revision 3498.

  • Committer: Zygmunt Krynicki
  • Date: 2014-12-09 16:14:23 UTC
  • Revision ID: zygmunt.krynicki@canonical.com-20141209161423-07xxgpdwm7dzm70f
plainbox:i18n: fix non-default domain lookups

This patch changes how plainbox.i18n.{bind,}textdomain() works. In the
past they would just proxy the calls to the original python gettext
module.

This works okay for anything not using our internal i18n APIs. If, however,
someone is using dgettext() with a domain that's not 'plainbox', it would
fail to load the translation catalog from a custom domain *and* a custom
locale directory at the same time.

This patch moves textdomain and bindtextdomain functions to be a method
of the ITranslator API. Inside the GettextTranslator we now use
bindtextdomain as hints and store the locale directory which is finally
used to instantiate the translation catalog. For compatibility, both
methods are still calling their equivalents from thet gettext module.

Signed-off-by: Zygmunt Krynicki <zygmunt.krynicki@canonical.com>

expand all expand all

Show diffs side-by-side

added added

removed removed

Lines of Context: