Fixes in i18n
This commit is contained in:
parent
b80b78f66e
commit
2abf62a107
3 changed files with 10 additions and 5 deletions
|
|
@ -7,7 +7,7 @@ pattern=re.compile('^\w+\.py$')
|
||||||
|
|
||||||
ignored=re.compile('^[__|\.].*$')
|
ignored=re.compile('^[__|\.].*$')
|
||||||
|
|
||||||
lang_p=re.compile()
|
lang_p=re.compile("I18n.lang\('(.*)',\s+'(.*)',\s+'(.*)'\)")
|
||||||
|
|
||||||
def start():
|
def start():
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -6,21 +6,25 @@ def load_lang(*args):
|
||||||
|
|
||||||
for module in args:
|
for module in args:
|
||||||
|
|
||||||
lang_path=module+'.i18n'
|
lang_path=module+'.i18n.'+I18n.default_lang+'.'+module.split('.')[-1]
|
||||||
|
|
||||||
try:
|
try:
|
||||||
i18n_module=import_module(module)
|
i18n_module=import_module(module)
|
||||||
|
|
||||||
return True
|
pass
|
||||||
|
|
||||||
except:
|
except:
|
||||||
return False
|
pass
|
||||||
|
|
||||||
# here load the language
|
# here load the language
|
||||||
|
|
||||||
|
|
||||||
class I18n:
|
class I18n:
|
||||||
|
|
||||||
|
default_lang='en-US'
|
||||||
|
|
||||||
|
dict_i18n=['en-US', 'es-ES']
|
||||||
|
|
||||||
l={}
|
l={}
|
||||||
|
|
||||||
@staticmethod
|
@staticmethod
|
||||||
|
|
|
||||||
|
|
@ -22,7 +22,8 @@ from collections import OrderedDict
|
||||||
|
|
||||||
t=ptemplate('admin')
|
t=ptemplate('admin')
|
||||||
|
|
||||||
load_lang('admin', 'common')
|
load_lang('paramecio.admin', 'paramecio.common')
|
||||||
|
|
||||||
@get('/'+config.admin_folder)
|
@get('/'+config.admin_folder)
|
||||||
@get('/'+config.admin_folder+'/<module>')
|
@get('/'+config.admin_folder+'/<module>')
|
||||||
@post('/'+config.admin_folder+'/<module>')
|
@post('/'+config.admin_folder+'/<module>')
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue