~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/i18n.py

  • Committer: Patch Queue Manager
  • Date: 2011-09-12 14:54:21 UTC
  • mfrom: (6092.2.15 i18n-nulltranslations)
  • Revision ID: pqm@pqm.ubuntu.com-20110912145421-rnusbtz5vwjdpgg6
(jr) Use gettext.NullTranslations in i18n to allow use of i18n even when
 translations are not turned on. (Jonathan Riddell)

Show diffs side-by-side

added added

removed removed

Lines of Context:
26
26
import os
27
27
import sys
28
28
 
29
 
_translations = None
 
29
_translations = _gettext.NullTranslations()
30
30
 
31
31
 
32
32
def gettext(message):
67
67
 
68
68
 
69
69
def installed():
70
 
    return _translations is not None
 
70
    return not isinstance(_translations, _gettext.NullTranslations)
71
71
 
72
72
 
73
73
def install(lang=None):
89
89
 
90
90
def uninstall():
91
91
    global _translations
92
 
    _translations = None
 
92
    _translations = _gettext.NullTranslations()
93
93
 
94
94
 
95
95
def _get_locale_dir():