Skip to content

Commit d5ed679

Browse files
committed
Localizations
1 parent 4b273c7 commit d5ed679

File tree

90 files changed

+1441
-882
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

90 files changed

+1441
-882
lines changed

gamemode/core/derma/f1menu/cl_classes.lua

Lines changed: 16 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -21,13 +21,13 @@ function PANEL:loadClasses()
2121
if cl.faction == client:Team() then list[#list + 1] = cl end
2222
end
2323

24-
table.sort(list, function(a, b) return a.name < b.name end)
24+
table.sort(list, function(a, b) return L(a.name or "") < L(b.name or "") end)
2525
self.sidebar:Clear()
2626
self.tabList = {}
2727
for _, cl in ipairs(list) do
2828
local canBe = lia.class.canBe(LocalPlayer(), cl.index)
2929
local btn = self.sidebar:Add("liaMediumButton")
30-
btn:SetText(cl.name or L("unnamed"))
30+
btn:SetText(cl.name and L(cl.name) or L("unnamed"))
3131
btn:SetTall(50)
3232
btn:Dock(TOP)
3333
btn:DockMargin(0, 0, 10, 20)
@@ -126,9 +126,10 @@ function PANEL:addClassDetails(parent, cl)
126126
lbl:DockMargin(10, 5, 10, 0)
127127
end
128128

129-
add(L("name") .. ": " .. (cl.name or L("unnamed")))
130-
add(L("description") .. ": " .. (cl.desc or L("noDesc")))
131-
add(L("faction") .. ": " .. (team.GetName(cl.faction) or L("none")))
129+
add(L("name") .. ": " .. (cl.name and L(cl.name) or L("unnamed")))
130+
add(L("description") .. ": " .. (cl.desc and L(cl.desc) or L("noDesc")))
131+
local facName = team.GetName(cl.faction)
132+
add(L("faction") .. ": " .. (facName and L(facName) or L("none")))
132133
add(L("isDefault") .. ": " .. (cl.isDefault and L("yes") or L("no")))
133134
add(L("baseHealth") .. ": " .. tostring(cl.health or maxH))
134135
add(L("baseArmor") .. ": " .. tostring(cl.armor or maxA))
@@ -154,7 +155,16 @@ function PANEL:addClassDetails(parent, cl)
154155

155156
add(L("bloodColor") .. ": " .. (bloodMap[cl.bloodcolor] or L("bloodRed")))
156157
if cl.requirements then
157-
local req = istable(cl.requirements) and table.concat(cl.requirements, ", ") or tostring(cl.requirements)
158+
local req
159+
if istable(cl.requirements) then
160+
local reqs = {}
161+
for _, v in ipairs(cl.requirements) do
162+
reqs[#reqs + 1] = L(v)
163+
end
164+
req = table.concat(reqs, ", ")
165+
else
166+
req = L(tostring(cl.requirements))
167+
end
158168
add(L("requirements") .. ": " .. req)
159169
end
160170
end

gamemode/core/derma/f1menu/cl_information.lua

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -82,7 +82,7 @@ function PANEL:CreateFillableBarWithBackgroundAndLabel(parent, name, labelText,
8282
local val = isfunction(valueFunc) and valueFunc() or tonumber(valueFunc) or 0
8383
local frac = mx > mn and math.Clamp((val - mn) / (mx - mn), 0, 1) or 0
8484
bar:SetFraction(frac)
85-
bar:SetText(string.format("%d / %d", math.Round(val), math.Round(mx)))
85+
bar:SetText(L("barProgress", math.Round(val), math.Round(mx)))
8686
end
8787

8888
function bar:Think()
@@ -116,9 +116,9 @@ function PANEL:GenerateSections()
116116
local fields = isfunction(sec.data.fields) and sec.data.fields() or sec.data.fields
117117
for _, f in ipairs(fields) do
118118
if f.type == "text" then
119-
self:CreateTextEntryWithBackgroundAndLabel(container, f.name, f.label, 5, f.value)
119+
self:CreateTextEntryWithBackgroundAndLabel(container, f.name, L(f.label or ""), 5, f.value)
120120
elseif f.type == "bar" then
121-
self:CreateFillableBarWithBackgroundAndLabel(container, f.name, f.label, f.min, f.max, 5, f.value)
121+
self:CreateFillableBarWithBackgroundAndLabel(container, f.name, L(f.label or ""), f.min, f.max, 5, f.value)
122122
end
123123

124124
self:AddSpacer(container, 5)
@@ -136,7 +136,7 @@ function PANEL:CreateSection(parent, title)
136136
cat.Paint = function() end
137137
cat.Header.Paint = function(p, w, h)
138138
derma.SkinHook("Paint", "Panel", p, w, h)
139-
draw.SimpleText(title, "liaSmallFont", w / 2, h / 2, color_white, TEXT_ALIGN_CENTER, TEXT_ALIGN_CENTER)
139+
draw.SimpleText(L(title), "liaSmallFont", w / 2, h / 2, color_white, TEXT_ALIGN_CENTER, TEXT_ALIGN_CENTER)
140140
end
141141

142142
local contents = vgui.Create("DPanel", cat)

gamemode/core/derma/f1menu/cl_menu.lua

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ function PANEL:Init()
3333
surface.DrawTexturedRect(30, (h - iconSize) * 0.5, iconSize, iconSize)
3434
surface.SetFont("liaMediumFont")
3535
surface.SetTextColor(255, 255, 255)
36-
local txt = schemaName
36+
local txt = L(schemaName)
3737
local _, th = surface.GetTextSize(txt)
3838
surface.SetTextPos(30 + iconSize + 10, (h - th) * 0.5)
3939
surface.DrawText(txt)

gamemode/core/derma/panels/attributes.lua

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
local PANEL = {}
1+
local PANEL = {}
22
function PANEL:Init()
33
self:SetTall(20)
44
self.add = self:Add("DImageButton")
@@ -206,7 +206,7 @@ function PANEL:setAttribute(k, v)
206206
self.key = k
207207
local nm = hook.Run("GetAttributeStartingMax", LocalPlayer(), k)
208208
self.name:SetText(L(v.name))
209-
self:SetTooltip(L(v.desc or "noDesc") .. (nm and " Max: " .. nm or ""))
209+
self:SetTooltip(L(v.desc or "noDesc") .. (nm and " " .. L("max", nm) or ""))
210210
end
211211

212212
function PANEL:delta(d)
@@ -252,4 +252,4 @@ function PANEL:Paint(w, h)
252252
surface.DrawRect(0, 0, w, h)
253253
end
254254

255-
vgui.Register("liaCharacterAttribsRow", PANEL, "DPanel")
255+
vgui.Register("liaCharacterAttribsRow", PANEL, "DPanel")

gamemode/core/derma/panels/chatbox.lua

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -112,7 +112,7 @@ function PANEL:setActive(state)
112112
for cmdName, cmdInfo in SortedPairs(self.commands) do
113113
if not tobool(string.find(cmdName, input:sub(2), 1, true)) then continue end
114114
local btn = self.commandList:Add("DButton")
115-
btn:SetText("/" .. cmdName .. " - " .. (cmdInfo.desc or L("noDesc")))
115+
btn:SetText("/" .. cmdName .. " - " .. (cmdInfo.desc ~= "" and L(cmdInfo.desc) or L("noDesc")))
116116
btn:Dock(TOP)
117117
btn:DockMargin(0, 0, 0, 2)
118118
btn:SetTall(20)

gamemode/core/derma/panels/extended_spawnmenu.lua

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,7 @@ registerContentType("sound", function(icon) icon:SetMaterial("icon16/sound.png")
7474
action = function(p) SetClipboardText(p) end
7575
},
7676
{
77-
text = "Stop all sounds",
77+
text = L("stopAllSounds"),
7878
icon = "icon16/sound_mute.png",
7979
action = function() RunConsoleCommand("stopsound") end
8080
},
@@ -109,7 +109,9 @@ end, {
109109
action = function(p) SetClipboardText(p) end
110110
},
111111
{
112-
text = function(p) return isMaterialUsable(p) and "Use with Material Tool" or "Try with Material Tool (may not work)" end,
112+
text = function(p)
113+
return isMaterialUsable(p) and L("useWithMaterialTool") or L("tryWithMaterialTool")
114+
end,
113115
icon = "icon16/pencil.png",
114116
action = function(p)
115117
RunConsoleCommand("material_override", p)
@@ -239,7 +241,7 @@ hook.Add("PopulateContent", "liaExtendedSpawnMenuPopulateContent", function(pnlC
239241
node.DoClick = function() pnlContent:SwitchPanel(node.PropPanel) end
240242
local categorized = {}
241243
for _, ent in pairs(list.Get("SpawnableEntities") or {}) do
242-
local cat = ent.Category or "Other"
244+
local cat = ent.Category or L("other")
243245
categorized[cat] = categorized[cat] or {}
244246
table.insert(categorized[cat], ent)
245247
end
@@ -274,7 +276,7 @@ hook.Add("PopulateContent", "liaExtendedSpawnMenuPopulateContent", function(pnlC
274276
node.DoClick = function() pnlContent:SwitchPanel(node.PropPanel) end
275277
local categorized = {}
276278
for name, pp in pairs(list.Get("PostProcess") or {}) do
277-
pp.category = pp.category or "Other"
279+
pp.category = pp.category or L("other")
278280
pp.name = name
279281
categorized[pp.category] = categorized[pp.category] or {}
280282
table.insert(categorized[pp.category], pp)
@@ -313,7 +315,7 @@ hook.Add("PopulateContent", "liaExtendedSpawnMenuPopulateContent", function(pnlC
313315
node.DoClick = function() pnlContent:SwitchPanel(node.PropPanel) end
314316
local cats = {}
315317
for className, ent in pairs(list.Get("NPC") or {}) do
316-
local cat = ent.Category or "Other"
318+
local cat = ent.Category or L("other")
317319
cats[cat] = cats[cat] or {}
318320
cats[cat][className] = ent
319321
end
@@ -349,7 +351,7 @@ hook.Add("PopulateContent", "liaExtendedSpawnMenuPopulateContent", function(pnlC
349351
node.DoClick = function() pnlContent:SwitchPanel(node.PropPanel) end
350352
local cats = {}
351353
for className, v in pairs(list.Get("Vehicles") or {}) do
352-
v.Category = v.Category or "Other"
354+
v.Category = v.Category or L("other")
353355
v.ClassName, v.PrintName, v.ScriptedEntityType = className, v.Name, "vehicle"
354356
cats[v.Category] = cats[v.Category] or {}
355357
table.insert(cats[v.Category], v)
@@ -386,7 +388,7 @@ hook.Add("PopulateContent", "liaExtendedSpawnMenuPopulateContent", function(pnlC
386388
local cats = {}
387389
for _, w in pairs(list.Get("Weapon") or {}) do
388390
if w.Spawnable or w.AdminSpawnable then
389-
local cat = w.Category or "Other"
391+
local cat = w.Category or L("other")
390392
cats[cat] = cats[cat] or {}
391393
table.insert(cats[cat], w)
392394
end

gamemode/core/derma/panels/panels.lua

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -126,7 +126,7 @@ local QuickPanel = {}
126126
function QuickPanel:Init()
127127
if IsValid(lia.gui.quick) then lia.gui.quick:Remove() end
128128
lia.gui.quick = self
129-
self:SetSkin(lia.config.get("DermaSkin", "Lilia Skin"))
129+
self:SetSkin(lia.config.get("DermaSkin", L("liliaSkin")))
130130
self:SetSize(400, 36)
131131
self:SetPos(ScrW() - 36, -36)
132132
self:MakePopup()

gamemode/core/derma/panels/voice.lua

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
VoicePanels = {}
22
local ICON_MAP = {
3-
Whispering = "whispertalk.png",
4-
Yelling = "yelltalk.png",
5-
Talking = "normaltalk.png"
3+
[L("whispering")] = "whispertalk.png",
4+
[L("yelling")] = "yelltalk.png",
5+
[L("talking")] = "normaltalk.png"
66
}
77

88
local PANEL = {}
@@ -80,7 +80,7 @@ local function CreateVoicePanelList()
8080
local pnl = VoicePanels[LocalPlayer()]
8181
if not IsValid(pnl) then return end
8282
local vt = LocalPlayer():getNetVar("VoiceType", L("talking"))
83-
draw.SimpleText(L("voiceModeStatus", L(vt:lower())), "liaMediumFont", w / 2, h, color_white, TEXT_ALIGN_CENTER, TEXT_ALIGN_BOTTOM)
83+
draw.SimpleText(L("voiceModeStatus", vt), "liaMediumFont", w / 2, h, color_white, TEXT_ALIGN_CENTER, TEXT_ALIGN_BOTTOM)
8484
end
8585
end
8686

gamemode/core/derma/panels/weaponselector.lua

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -90,7 +90,19 @@ local function onIndexChanged()
9090
local textParts = {}
9191
local activeColor = lia.config.get("Color")
9292
for _, key in ipairs({"Author", "Contact", "Purpose", "Instructions"}) do
93-
if weapon[key] and weapon[key]:find("%S") then table.insert(textParts, string.format("<font=liaItemBoldFont><color=%d,%d,%d>%s</font></color>\n%s\n", activeColor.r, activeColor.g, activeColor.b, L(key), weapon[key])) end
93+
if weapon[key] and weapon[key]:find("%S") then
94+
table.insert(
95+
textParts,
96+
string.format(
97+
"<font=liaItemBoldFont><color=%d,%d,%d>%s</font></color>\n%s\n",
98+
activeColor.r,
99+
activeColor.g,
100+
activeColor.b,
101+
L(key:lower()),
102+
weapon[key]
103+
)
104+
)
105+
end
94106
end
95107

96108
if #textParts > 0 then

gamemode/core/hooks/client.lua

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -27,9 +27,9 @@ local hidden = {
2727
}
2828

2929
local VoiceRanges = {
30-
Whispering = 120,
31-
Talking = 300,
32-
Yelling = 600,
30+
[L("whispering")] = 120,
31+
[L("talking")] = 300,
32+
[L("yelling")] = 600,
3333
}
3434

3535
local lastEntity
@@ -173,7 +173,7 @@ function GM:PostDrawOpaqueRenderables()
173173
local client = LocalPlayer()
174174
if not (IsValid(client) and client:IsSpeaking() and client:getChar()) then return end
175175
local vt = client:getNetVar("VoiceType", L("talking"))
176-
local radius = VoiceRanges[vt] or VoiceRanges.Talking
176+
local radius = VoiceRanges[vt] or VoiceRanges[L("talking")]
177177
local segments = 36
178178
local pos = client:GetPos() + Vector(0, 0, 2)
179179
local color = Color(0, 150, 255)
@@ -409,7 +409,7 @@ function GM:CharListLoaded()
409409
end
410410

411411
function GM:ForceDermaSkin()
412-
return lia.config.get("DermaSkin", "Lilia Skin")
412+
return lia.config.get("DermaSkin", L("liliaSkin"))
413413
end
414414

415415
function GM:DermaSkinChanged()

0 commit comments

Comments
 (0)