translate cache

This commit is contained in:
Alexander Yakovlev 2015-08-15 09:55:37 +07:00
parent 5bf19bc054
commit 9a931009e4

View file

@ -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