/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: 2018-11-16 18:59:44 UTC
  • mfrom: (7143.15.15 more-cleanups)
  • Revision ID: breezy.the.bot@gmail.com-20181116185944-biefv1sub37qfybm
Sprinkle some PEP8iness.

Merged from https://code.launchpad.net/~jelmer/brz/more-cleanups/+merge/358611

Show diffs side-by-side

added added

removed removed

Lines of Context:
33
33
 
34
34
 
35
35
def gettext(message):
36
 
    """Translate message. 
37
 
    
 
36
    """Translate message.
 
37
 
38
38
    :returns: translated message as unicode.
39
39
    """
40
40
    install()
99
99
 
100
100
def install_translations(lang=None, domain='brz', locale_base=None):
101
101
    """Create a gettext translation object.
102
 
    
 
102
 
103
103
    :param lang: language to install.
104
104
    :param domain: translation domain to install.
105
105
    :param locale_base: plugins can specify their own directory.
113
113
    else:
114
114
        languages = None
115
115
    translation = _gettext.translation(
116
 
            domain,
117
 
            localedir=_get_locale_dir(locale_base),
118
 
            languages=languages,
119
 
            fallback=True)
 
116
        domain,
 
117
        localedir=_get_locale_dir(locale_base),
 
118
        languages=languages,
 
119
        fallback=True)
120
120
    return translation
121
121
 
122
122
 
145
145
        decode_path = str
146
146
    else:
147
147
        fs_enc = sys.getfilesystemencoding()
 
148
 
148
149
        def decode_path(path):
149
150
            return path.decode(fs_enc)
150
151
    if getattr(sys, 'frozen', False):
210
211
    """
211
212
    locale_base = os.path.dirname(__file__)
212
213
    translation = install_translations(domain=domain,
213
 
        locale_base=locale_base)
 
214
                                       locale_base=locale_base)
214
215
    add_fallback(translation)
215
216
    return translation