Compare commits
No commits in common. "e56b6ec70229209715489654f211417bf3c5f4b5" and "b39f0e1f32e3f899537dff4851f6814adf63df92" have entirely different histories.
e56b6ec702
...
b39f0e1f32
@ -266,8 +266,6 @@ def background_reco(reco, *args, **kw):
|
|||||||
def initEnv():
|
def initEnv():
|
||||||
g = ServerEnv()
|
g = ServerEnv()
|
||||||
set_builtins()
|
set_builtins()
|
||||||
rf = RegisterFunction()
|
|
||||||
rd.register('i18n', i18n)
|
|
||||||
g.paramify = paramify
|
g.paramify = paramify
|
||||||
g.configValue = configValue
|
g.configValue = configValue
|
||||||
g.visualcoding = visualcoding
|
g.visualcoding = visualcoding
|
||||||
@ -330,17 +328,6 @@ def initEnv():
|
|||||||
g.json_response = json_response
|
g.json_response = json_response
|
||||||
g.Response = Response
|
g.Response = Response
|
||||||
|
|
||||||
def i18n(request, *args, **kw):
|
|
||||||
env = request._rns_ns
|
|
||||||
params_kw = env.params_kw
|
|
||||||
fs = FileStorage()
|
|
||||||
lang = params_kw.lang
|
|
||||||
i18n_path = params_kw.i18n or 'i18n'
|
|
||||||
fp = os.path.join(fs.root , i18n_path, lang, 'i18n.json')
|
|
||||||
with codecs.open(fp, 'r', 'utf-8') as f:
|
|
||||||
return f.read()
|
|
||||||
return ""
|
|
||||||
|
|
||||||
def set_builtins():
|
def set_builtins():
|
||||||
all_builtins = [ i for i in dir(builtins) if not i.startswith('_')]
|
all_builtins = [ i for i in dir(builtins) if not i.startswith('_')]
|
||||||
g = ServerEnv()
|
g = ServerEnv()
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user