mirror of
https://github.com/Mikaela/Limnoria.git
synced 2025-01-11 04:32:36 +01:00
i18n: Initialize translations in __init__.
This commit is contained in:
parent
0607462dd5
commit
97b48abaa2
@ -136,6 +136,7 @@ class _PluginInternationalization:
|
|||||||
"""Internationalization managment for a plugin."""
|
"""Internationalization managment for a plugin."""
|
||||||
def __init__(self, name='supybot'):
|
def __init__(self, name='supybot'):
|
||||||
self.name = name
|
self.name = name
|
||||||
|
self.translations = {}
|
||||||
self.currentLocaleName = None
|
self.currentLocaleName = None
|
||||||
i18nClasses.update({name: self})
|
i18nClasses.update({name: self})
|
||||||
self.loadLocale()
|
self.loadLocale()
|
||||||
@ -157,7 +158,8 @@ class _PluginInternationalization:
|
|||||||
localeName, 'po'), 'r')
|
localeName, 'po'), 'r')
|
||||||
self._parse(translationFile)
|
self._parse(translationFile)
|
||||||
except IOError, PluginNotFound: # The translation is unavailable
|
except IOError, PluginNotFound: # The translation is unavailable
|
||||||
self.translations = {}
|
pass
|
||||||
|
|
||||||
def _parse(self, translationFile):
|
def _parse(self, translationFile):
|
||||||
"""A .po files parser.
|
"""A .po files parser.
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user