author | sheepluva |
Sat, 12 Sep 2015 20:01:26 +0200 | |
branch | gettext |
changeset 11168 | e104e060911b |
parent 8824 | fe9eacd390f2 |
permissions | -rw-r--r-- |
4854
881c8232b66a
adding my new Tracker library so mikade can use it with you guys on dev, still might change a bit though
Henek
parents:
4502
diff
changeset
|
1 |
-- Library for localizing strings in lua scripts |
881c8232b66a
adding my new Tracker library so mikade can use it with you guys on dev, still might change a bit though
Henek
parents:
4502
diff
changeset
|
2 |
|
11168 | 3 |
local lang = nil |
4854
881c8232b66a
adding my new Tracker library so mikade can use it with you guys on dev, still might change a bit though
Henek
parents:
4502
diff
changeset
|
4 |
|
11168 | 5 |
function lua_loc(text) |
8824
fe9eacd390f2
Unbreak lua localisation, fix untranslated login prompt, update translations.
nemo
parents:
8349
diff
changeset
|
6 |
if locale ~= nil and locale[text] ~= nil then return locale[text] |
4502
759c1a3bb156
lua access to data dir by GetDataPath and made a new scripting translation system with Locale.lua as library and .lua files under Locale. Updated maps Basketball and Knockball to this new system.
Henek
parents:
diff
changeset
|
7 |
else return text |
759c1a3bb156
lua access to data dir by GetDataPath and made a new scripting translation system with Locale.lua as library and .lua files under Locale. Updated maps Basketball and Knockball to this new system.
Henek
parents:
diff
changeset
|
8 |
end |
759c1a3bb156
lua access to data dir by GetDataPath and made a new scripting translation system with Locale.lua as library and .lua files under Locale. Updated maps Basketball and Knockball to this new system.
Henek
parents:
diff
changeset
|
9 |
end |
11168 | 10 |
|
11 |
if loc == nil then |
|
12 |
lang = HedgewarsScriptLoad("Locale/" .. tostring(L) .. ".lua") |
|
13 |
loc = lua_loc |
|
14 |
end |
|
15 |