mercurial/i18n.py
changeset 13849 9f97de157aad
parent 11403 f7d7de6eccc8
child 14975 b64538363dbe
equal deleted inserted replaced
13848:b2798c1defff 13849:9f97de157aad
    49         return u.encode(encoding.encoding, "replace")
    49         return u.encode(encoding.encoding, "replace")
    50     except LookupError:
    50     except LookupError:
    51         # An unknown encoding results in a LookupError.
    51         # An unknown encoding results in a LookupError.
    52         return message
    52         return message
    53 
    53 
    54 if 'HGPLAIN' in os.environ:
    54 def _plain():
       
    55     if 'HGPLAIN' not in os.environ and 'HGPLAINEXCEPT' not in os.environ:
       
    56         return False
       
    57     exceptions = os.environ.get('HGPLAINEXCEPT', '').strip().split(',')
       
    58     return 'i18n' not in exceptions
       
    59 
       
    60 if _plain():
    55     _ = lambda message: message
    61     _ = lambda message: message
    56 else:
    62 else:
    57     _ = gettext
    63     _ = gettext
    58 
    64