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)
|
hash[sub(mo_data,oo+1,oo+ol)]=sub(mo_data,to+1,to+tl)
|
||||||
end
|
end
|
||||||
return function(text)
|
return function(text)
|
||||||
return hash[text] or text
|
return hash[text]
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
@ -75,5 +75,8 @@ if LANG == translate.source then
|
||||||
return text;
|
return text;
|
||||||
end;
|
end;
|
||||||
else
|
else
|
||||||
__ = load_mo_file(LANG..'.mo');
|
translate.strings = load_mo_file(LANG..'.mo');
|
||||||
|
__ = function(text)
|
||||||
|
return translate.strings[text];
|
||||||
|
end
|
||||||
end
|
end
|
||||||
|
|
Loading…
Reference in a new issue