Fix compatibility with Windows ('u' flag not supported by open())

This commit is contained in:
Valentin Lorentz 2011-05-07 09:12:03 +02:00
parent ce29bf8b5c
commit 8979475e13

View File

@ -146,9 +146,12 @@ class _PluginInternationalization:
self._loadL10nCode() self._loadL10nCode()
try: try:
translationFile = open(getLocalePath(self.name, localeName, 'po'), try:
'ru') # ru is the mode, not the beginning translationFile = open(getLocalePath(self.name,
# of 'russian' ;) localeName, 'po'), 'ru')
except ValueError: # We are using Windows
translationFile = open(getLocalePath(self.name,
localeName, 'po'), 'r')
self._parse(translationFile) self._parse(translationFile)
except IOError: # The translation is unavailable except IOError: # The translation is unavailable
self.translations = {} self.translations = {}