~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/i18n.py

(jelmer) Add load_plugin_translations() function. (Jelmer Vernooij)

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