/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: Breezy landing bot
  • Author(s): Jelmer Vernooij
  • Date: 2020-07-28 02:47:10 UTC
  • mfrom: (7519.1.1 merge-3.1)
  • Revision ID: breezy.the.bot@gmail.com-20200728024710-a2ylds219f1lsl62
Merge lp:brz/3.1.

Merged from https://code.launchpad.net/~jelmer/brz/merge-3.1/+merge/388173

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():