~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/i18n.py

  • Committer: Jonathan Riddell
  • Date: 2011-09-14 16:31:57 UTC
  • mto: This revision was merged to the branch mainline in revision 6139.
  • Revision ID: jriddell@canonical.com-20110914163157-ee87lu1pqmq5b4r3
default _translations back to None so we can tell if it gets installed

Show diffs side-by-side

added added

removed removed

Lines of Context:
26
26
import os
27
27
import sys
28
28
 
29
 
_translations = _gettext.NullTranslations()
 
29
_translations = None
30
30
 
31
31
 
32
32
def gettext(message):
73
73
    of bzrlib."""
74
74
    global installed
75
75
    installed = lambda: True
76
 
 
 
76
    _translations = _gettext.NullTranslations()
77
77
 
78
78
def installed():
79
 
    return not isinstance(_translations, _gettext.NullTranslations)
 
79
    """Returns whether translations are in use or not."""
 
80
    return _translations is not None
80
81
 
81
82
 
82
83
def install(lang=None):
 
84
    """Enables gettext translations."""
83
85
    global _translations
84
86
    if installed():
85
87
        return
97
99
 
98
100
 
99
101
def uninstall():
 
102
    """Disables gettext translations."""
100
103
    global _translations
101
 
    _translations = _gettext.NullTranslations()
 
104
    _translations = None
102
105
 
103
106
 
104
107
def _get_locale_dir():