~ubuntu-branches/debian/sid/calibre/sid

« back to all changes in this revision

Viewing changes to src/calibre/utils/localization.py

  • Committer: Package Import Robot
  • Author(s): Martin Pitt
  • Date: 2014-02-27 07:48:06 UTC
  • mto: This revision was merged to the branch mainline in revision 74.
  • Revision ID: package-import@ubuntu.com-20140227074806-64wdebb3ptosxhhx
Tags: upstream-1.25.0+dfsg
ImportĀ upstreamĀ versionĀ 1.25.0+dfsg

Show diffs side-by-side

added added

removed removed

Lines of Context:
91
91
 
92
92
_lang_trans = None
93
93
 
 
94
def get_all_translators():
 
95
    from zipfile import ZipFile
 
96
    with ZipFile(P('localization/locales.zip', allow_user_override=False), 'r') as zf:
 
97
        for lang in available_translations():
 
98
            mpath = get_lc_messages_path(lang)
 
99
            if mpath is not None:
 
100
                buf = cStringIO.StringIO(zf.read(mpath + '/messages.mo'))
 
101
                yield lang, GNUTranslations(buf)
 
102
 
94
103
def set_translators():
95
104
    global _lang_trans
96
105
    # To test different translations invoke as