translate cache
This commit is contained in:
parent
5bf19bc054
commit
9a931009e4
|
@ -61,7 +61,7 @@ function load_mo_file(mo_file)
|
|||
hash[sub(mo_data,oo+1,oo+ol)]=sub(mo_data,to+1,to+tl)
|
||||
end
|
||||
return function(text)
|
||||
return hash[text] or text
|
||||
return hash[text]
|
||||
end
|
||||
end
|
||||
|
||||
|
@ -75,5 +75,8 @@ if LANG == translate.source then
|
|||
return text;
|
||||
end;
|
||||
else
|
||||
__ = load_mo_file(LANG..'.mo');
|
||||
translate.strings = load_mo_file(LANG..'.mo');
|
||||
__ = function(text)
|
||||
return translate.strings[text];
|
||||
end
|
||||
end
|
||||
|
|
Loading…
Reference in a new issue