mirror of
https://github.com/Mikaela/Limnoria.git
synced 2024-12-24 19:52:54 +01:00
Fix compatibility with Windows ('u' flag not supported by open())
This commit is contained in:
parent
ce29bf8b5c
commit
8979475e13
@ -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 = {}
|
||||||
|
Loading…
Reference in New Issue
Block a user