mirror of https://github.com/Mikaela/Limnoria.git
Fix locales path resolution with Python 3.
This commit is contained in:
parent
0ff58db4f0
commit
c1f19b3353
|
@ -33,6 +33,7 @@ Supybot internationalisation and localisation managment.
|
||||||
|
|
||||||
__all__ = ['PluginInternationalization', 'internationalizeDocstring']
|
__all__ = ['PluginInternationalization', 'internationalizeDocstring']
|
||||||
|
|
||||||
|
import os
|
||||||
import re
|
import re
|
||||||
import sys
|
import sys
|
||||||
import time
|
import time
|
||||||
|
@ -98,10 +99,11 @@ def getLocalePath(name, localeName, extension):
|
||||||
"""Gets the path of the locale file of the given plugin ('supybot' stands
|
"""Gets the path of the locale file of the given plugin ('supybot' stands
|
||||||
for the core)."""
|
for the core)."""
|
||||||
if name != 'supybot':
|
if name != 'supybot':
|
||||||
directory = getPluginDir(name) + 'locales'
|
base = getPluginDir(name)
|
||||||
else:
|
else:
|
||||||
import ansi # Any Supybot plugin could fit
|
from . import ansi # Any Supybot plugin could fit
|
||||||
directory = ansi.__file__[0:-len('ansi.pyc')] + 'locales'
|
base = ansi.__file__[0:-len('ansi.pyc')]
|
||||||
|
directory = os.path.join(base, 'locales')
|
||||||
return '%s/%s.%s' % (directory, localeName, extension)
|
return '%s/%s.%s' % (directory, localeName, extension)
|
||||||
|
|
||||||
i18nClasses = {}
|
i18nClasses = {}
|
||||||
|
|
Loading…
Reference in New Issue