~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/i18n.py

  • Committer: Jelmer Vernooij
  • Date: 2011-10-04 22:20:49 UTC
  • mto: This revision was merged to the branch mainline in revision 6190.
  • Revision ID: jelmer@samba.org-20111004222049-d9glniyleu0pppzd
Add a load_plugin_translations method.

Show diffs side-by-side

added added

removed removed

Lines of Context:
190
190
        if lang:
191
191
            return lang
192
192
    return None
 
193
 
 
194
 
 
195
def load_plugin_translations(domain):
 
196
    """Load the translations for a specific plugin.
 
197
 
 
198
    :param domain: Gettext domain name (usually 'bzr-PLUGINNAME')
 
199
    """
 
200
    locale_base = os.path.dirname(
 
201
        unicode(__file__, sys.getfilesystemencoding()))
 
202
    translation = install_translations(domain=domain,
 
203
        locale_base=locale_base)
 
204
    add_fallback(translation)
 
205
    return translation