mirror of
https://github.com/Oreolek/sixth_city.git
synced 2024-07-01 05:54:59 +03:00
folder for translations
This commit is contained in:
parent
15f7522271
commit
3238740e7d
|
@ -60,9 +60,7 @@ function load_mo_file(mo_file)
|
||||||
local tl,to=peek_long(T),peek_long(T+4) T=T+8
|
local tl,to=peek_long(T),peek_long(T+4) T=T+8
|
||||||
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 hash
|
||||||
return hash[text]
|
|
||||||
end
|
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
||||||
|
@ -75,7 +73,10 @@ if LANG == translate.source then
|
||||||
return text;
|
return text;
|
||||||
end;
|
end;
|
||||||
else
|
else
|
||||||
translate.strings = load_mo_file(LANG..'.mo');
|
translate.strings = load_mo_file('translations/' .. LANG .. '.mo');
|
||||||
|
if translate.strings == nil then
|
||||||
|
error("translation not found")
|
||||||
|
end
|
||||||
_ = function(text)
|
_ = function(text)
|
||||||
return translate.strings[text];
|
return translate.strings[text];
|
||||||
end
|
end
|
||||||
|
|
Loading…
Reference in a new issue