share/hedgewars/Data/Scripts/Locale.lua
author belphegorr <szabibibi@gmail.com>
Sun, 08 Jul 2012 19:15:38 +0300
changeset 7245 53f73f4ae203
parent 5616 a96231121eac
child 8349 a1dbe148f10f
permissions -rw-r--r--
Modified frontend so that updating campaogn progress no longer changes current index of the mission combo box Updated Animate.lua (forgot to copy it last time) Mission 1: Fixed a bug where events would cause animations to stutter Moved a crate Made the princess and the elder pay attention to Leaks A Lot Changed the name of the chief to Righteous Beard Mission 2: - Mission 3: Removed leftover debug lines Solved a bug where Dense Cloud could not select weapons during final scene Made the hogs fave each other during the final animation Mission 4: Solved a bug where Dense Cloud would appear even if he's dead
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
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
5616
a96231121eac Fix localisation of scripts
nemo
parents: 4854
diff changeset
     3
local lang = loadfile(GetUserDataPath() .. "Locale/" .. tostring(L) .. ".lua")
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
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
     5
if lang ~= nil then
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
     6
    lang()
5616
a96231121eac Fix localisation of scripts
nemo
parents: 4854
diff changeset
     7
else
a96231121eac Fix localisation of scripts
nemo
parents: 4854
diff changeset
     8
    lang = loadfile(GetDataPath() .. "Locale/" .. tostring(L) .. ".lua")
a96231121eac Fix localisation of scripts
nemo
parents: 4854
diff changeset
     9
    if lang ~= nil then
a96231121eac Fix localisation of scripts
nemo
parents: 4854
diff changeset
    10
        lang()
a96231121eac Fix localisation of scripts
nemo
parents: 4854
diff changeset
    11
    end
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
    12
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
    13
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
    14
function loc(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
    15
    if lang ~= nil and locale ~= nil and locale[text] ~= nil then return locale[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
    16
    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
    17
    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
    18
end