/brz/remove-bazaar

To get this branch, use:
bzr branch http://gegoxaren.bato24.eu/bzr/brz/remove-bazaar

« back to all changes in this revision

Viewing changes to breezy/i18n.py

  • Committer: Jelmer Vernooij
  • Date: 2020-08-10 15:00:17 UTC
  • mfrom: (7490.40.99 work)
  • mto: This revision was merged to the branch mainline in revision 7521.
  • Revision ID: jelmer@jelmer.uk-20200810150017-vs7xnrd1vat4iktg
Merge lp:brz/3.1.

Show diffs side-by-side

added added

removed removed

Lines of Context:
22
22
 
23
23
"""i18n and l10n support for Bazaar."""
24
24
 
25
 
from __future__ import absolute_import
26
 
 
27
25
import gettext as _gettext
28
26
import os
29
27
import sys
141
139
 
142
140
    :param base: plugins can specify their own local directory
143
141
    """
144
 
    if sys.version_info > (3,):
145
 
        decode_path = str
146
 
    else:
147
 
        fs_enc = sys.getfilesystemencoding()
148
 
 
149
 
        def decode_path(path):
150
 
            return path.decode(fs_enc)
151
142
    if getattr(sys, 'frozen', False):
152
143
        if base is None:
153
 
            base = os.path.dirname(decode_path(sys.executable))
 
144
            base = os.path.dirname(sys.executable)
154
145
        return os.path.join(base, u'locale')
155
146
    else:
156
147
        if base is None:
157
 
            base = os.path.dirname(decode_path(__file__))
 
148
            base = os.path.dirname(__file__)
158
149
        dirpath = os.path.realpath(os.path.join(base, u'locale'))
159
150
        if os.path.exists(dirpath):
160
151
            return dirpath
161
 
    return os.path.join(decode_path(sys.prefix), u"share", u"locale")
 
152
    return os.path.join(sys.prefix, u"share", u"locale")
162
153
 
163
154
 
164
155
def _check_win32_locale():