Skip to content

Commit 8512018

Browse files
committed
More Localization
1 parent c99730e commit 8512018

File tree

49 files changed

+381
-386
lines changed

Some content is hidden

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

49 files changed

+381
-386
lines changed

gamemode/core/derma/panels/itempanel.lua

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -114,7 +114,7 @@ function PANEL:openInspect()
114114
end
115115
end
116116

117-
if LocalPlayer():isStaffOnDuty() or LocalPlayer():hasPrivilege("Can Access Item Informations") then
117+
if LocalPlayer():isStaffOnDuty() or LocalPlayer():hasPrivilege(L("canAccessItemInformations")) then
118118
local cr = self.ent:GetCreator()
119119
if IsValid(cr) then drawLine(scroll, L("spawner"), cr:Name() .. " - " .. cr:SteamID()) end
120120
end

gamemode/core/derma/panels/panels.lua

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -316,7 +316,7 @@ function QuickPanel:populateOptions()
316316
local cats = {}
317317
for k, v in pairs(lia.option.stored) do
318318
if v and (v.isQuick or v.data and v.data.isQuick) then
319-
local cat = v.data and v.data.category or "General"
319+
local cat = v.data and v.data.category or L("categoryGeneral")
320320
cats[cat] = cats[cat] or {}
321321
cats[cat][#cats[cat] + 1] = {
322322
key = k,
@@ -336,8 +336,8 @@ function QuickPanel:populateOptions()
336336
end
337337

338338
table.sort(names, function(a, b)
339-
if a == "General" and b ~= "General" then return true end
340-
if b == "General" and a ~= "General" then return false end
339+
if a == L("categoryGeneral") and b ~= L("categoryGeneral") then return true end
340+
if b == L("categoryGeneral") and a ~= L("categoryGeneral") then return false end
341341
return a < b
342342
end)
343343

gamemode/core/derma/panels/voice.lua

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ function PANEL:Setup(client)
3030
end
3131

3232
function PANEL:UpdateIcon()
33-
local vt = self.client:getNetVar("VoiceType", "Talking")
33+
local vt = self.client:getNetVar("VoiceType", L("talking"))
3434
local img = ICON_MAP[vt] or "normaltalk.png"
3535
self.Icon:SetImage(img)
3636
end
@@ -79,7 +79,7 @@ local function CreateVoicePanelList()
7979
function g_VoicePanelList:Paint(w, h)
8080
local pnl = VoicePanels[LocalPlayer()]
8181
if not IsValid(pnl) then return end
82-
local vt = LocalPlayer():getNetVar("VoiceType", "Talking")
82+
local vt = LocalPlayer():getNetVar("VoiceType", L("talking"))
8383
draw.SimpleText(L("voiceModeStatus", L(vt:lower())), "liaMediumFont", w / 2, h, color_white, TEXT_ALIGN_CENTER, TEXT_ALIGN_BOTTOM)
8484
end
8585
end

gamemode/core/hooks/client.lua

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -172,7 +172,7 @@ function GM:PostDrawOpaqueRenderables()
172172
if not lia.option.get("voiceRange", false) then return end
173173
local client = LocalPlayer()
174174
if not (IsValid(client) and client:IsSpeaking() and client:getChar()) then return end
175-
local vt = client:getNetVar("VoiceType", "Talking")
175+
local vt = client:getNetVar("VoiceType", L("talking"))
176176
local radius = VoiceRanges[vt] or VoiceRanges.Talking
177177
local segments = 36
178178
local pos = client:GetPos() + Vector(0, 0, 2)
@@ -469,7 +469,7 @@ end
469469

470470
function GM:SpawnMenuOpen()
471471
local client = LocalPlayer()
472-
if lia.config.get("SpawnMenuLimit", false) and not (client:hasFlags("pet") or client:isStaffOnDuty() or client:hasPrivilege("Can Spawn Props")) then return end
472+
if lia.config.get("SpawnMenuLimit", false) and not (client:hasFlags("pet") or client:isStaffOnDuty() or client:hasPrivilege(L("canSpawnProps"))) then return end
473473
return true
474474
end
475475

gamemode/core/hooks/server.lua

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -344,7 +344,7 @@ function GM:PostPlayerLoadout(client)
344344
end
345345

346346
client:SetSkin(character:getSkin())
347-
client:setNetVar("VoiceType", "Talking")
347+
client:setNetVar("VoiceType", L("talking"))
348348
end
349349

350350
function GM:ShouldSpawnClientRagdoll(client)
@@ -941,9 +941,9 @@ function ClientAddText(client, ...)
941941
end
942942

943943
local TalkRanges = {
944-
["Whispering"] = 120,
945-
["Talking"] = 300,
946-
["Yelling"] = 600,
944+
[L("whispering")] = 120,
945+
[L("talking")] = 300,
946+
[L("yelling")] = 600,
947947
}
948948

949949
local function IsLineOfSightClear(listener, speaker)
@@ -969,7 +969,7 @@ function GM:PlayerCanHearPlayersVoice(listener, speaker)
969969
if speaker:getNetVar("liaGagged", false) then return false, false end
970970
if not speaker:getChar() or speaker:getLiliaData("VoiceBan", false) then return false, false end
971971
if not lia.config.get("IsVoiceEnabled", true) then return false, false end
972-
local voiceType = speaker:getNetVar("VoiceType", "Talking")
972+
local voiceType = speaker:getNetVar("VoiceType", L("talking"))
973973
local baseRange = TalkRanges[voiceType] or TalkRanges.Talking
974974
local clearLOS = IsLineOfSightClear(listener, speaker)
975975
local effectiveRange = clearLOS and baseRange or baseRange * 0.16

gamemode/core/libraries/admin.lua

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -97,12 +97,12 @@ local function camiBootstrapFromExisting()
9797
local m = tostring(pr.MinAccess or "user"):lower()
9898
if lia.administrator.privileges[n] == nil then
9999
lia.administrator.privileges[n] = m
100-
lia.administrator.privMeta[n] = tostring(pr.Category or "Unassigned")
100+
lia.administrator.privMeta[n] = tostring(pr.Category or L("unassigned"))
101101
for g in pairs(lia.administrator.groups or {}) do
102102
if shouldGrant(g, m) then lia.administrator.groups[g][n] = true end
103103
end
104104
else
105-
lia.administrator.privMeta[n] = lia.administrator.privMeta[n] or tostring(pr.Category or "Unassigned")
105+
lia.administrator.privMeta[n] = lia.administrator.privMeta[n] or tostring(pr.Category or L("unassigned"))
106106
end
107107
end
108108

@@ -135,7 +135,7 @@ function lia.administrator.registerPrivilege(priv)
135135
if lia.administrator.privileges[name] ~= nil then return end
136136
local min = tostring(priv.MinAccess or "user"):lower()
137137
lia.administrator.privileges[name] = min
138-
lia.administrator.privMeta[name] = tostring(priv.Category or "Unassigned")
138+
lia.administrator.privMeta[name] = tostring(priv.Category or L("unassigned"))
139139
for groupName, perms in pairs(lia.administrator.groups) do
140140
perms = perms or {}
141141
lia.administrator.groups[groupName] = perms
@@ -553,7 +553,7 @@ if SERVER then
553553

554554
ensureStructures()
555555
net.Receive("liaGroupsRequest", function(_, p)
556-
if not IsValid(p) or not p:hasPrivilege("Manage Usergroups") then return end
556+
if not IsValid(p) or not p:hasPrivilege(L("manageUsergroups")) then return end
557557
lia.net.ready = lia.net.ready or setmetatable({}, {
558558
__mode = "k"
559559
})
@@ -563,7 +563,7 @@ if SERVER then
563563
end)
564564

565565
net.Receive("liaGroupsAdd", function(_, p)
566-
if not p:hasPrivilege("Manage Usergroups") then return end
566+
if not p:hasPrivilege(L("manageUsergroups")) then return end
567567
local data = net.ReadTable()
568568
local n = string.Trim(tostring(data.name or ""))
569569
if n == "" then return end
@@ -583,7 +583,7 @@ if SERVER then
583583
end)
584584

585585
net.Receive("liaGroupsRemove", function(_, p)
586-
if not p:hasPrivilege("Manage Usergroups") then return end
586+
if not p:hasPrivilege(L("manageUsergroups")) then return end
587587
local n = net.ReadString()
588588
if n == "" or lia.administrator.DefaultGroups and lia.administrator.DefaultGroups[n] then return end
589589
lia.administrator.removeGroup(n)
@@ -594,7 +594,7 @@ if SERVER then
594594
end)
595595

596596
net.Receive("liaGroupsRename", function(_, p)
597-
if not p:hasPrivilege("Manage Usergroups") then return end
597+
if not p:hasPrivilege(L("manageUsergroups")) then return end
598598
local old = string.Trim(net.ReadString() or "")
599599
local new = string.Trim(net.ReadString() or "")
600600
if old == "" or new == "" then return end
@@ -608,7 +608,7 @@ if SERVER then
608608
end)
609609

610610
net.Receive("liaGroupsSetPerm", function(_, p)
611-
if not p:hasPrivilege("Manage Usergroups") then return end
611+
if not p:hasPrivilege(L("manageUsergroups")) then return end
612612
local group = net.ReadString()
613613
local privilege = net.ReadString()
614614
local value = net.ReadBool()
@@ -635,7 +635,7 @@ else
635635
local function computeCategoryMap(groups)
636636
local cats, labels, seen = {}, {}, {}
637637
for name in pairs(lia.administrator.privileges or {}) do
638-
local c = tostring(lia.administrator.privMeta and lia.administrator.privMeta[name] or "Unassigned")
638+
local c = tostring(lia.administrator.privMeta and lia.administrator.privMeta[name] or L("unassigned"))
639639
local key = c:lower()
640640
labels[key] = labels[key] or c
641641
cats[key] = cats[key] or {}
@@ -645,7 +645,7 @@ else
645645
for _, data in pairs(groups or {}) do
646646
for name in pairs(data or {}) do
647647
if name ~= "_info" and not seen[name] then
648-
local c = tostring(lia.administrator.privMeta and lia.administrator.privMeta[name] or "Unassigned")
648+
local c = tostring(lia.administrator.privMeta and lia.administrator.privMeta[name] or L("unassigned"))
649649
local key = c:lower()
650650
labels[key] = labels[key] or c
651651
cats[key] = cats[key] or {}
@@ -1003,7 +1003,7 @@ else
10031003
end)
10041004

10051005
hook.Add("PopulateAdminTabs", "liaAdmin", function(pages)
1006-
if not IsValid(LocalPlayer()) or not LocalPlayer():hasPrivilege("Manage Usergroups") then return end
1006+
if not IsValid(LocalPlayer()) or not LocalPlayer():hasPrivilege(L("manageUsergroups")) then return end
10071007
pages[#pages + 1] = {
10081008
name = L("userGroups"),
10091009
drawFunc = function(parent)

gamemode/core/libraries/character.lua

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -716,7 +716,7 @@ if SERVER then
716716
end
717717

718718
function lia.char.delete(id, client)
719-
assert(isnumber(id), "id must be a number")
719+
assert(isnumber(id), L("idMustBeNumber"))
720720
if IsValid(client) then
721721
removePlayer(client)
722722
else

gamemode/core/libraries/compatibility/cami.lua

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,7 @@ hook.Add("CAMI.OnPrivilegeRegistered", "liaAdminPrivAdded", function(priv)
6666
if lia.administrator.privileges[name] ~= nil then return end
6767
local min = tostring(priv.MinAccess or "user"):lower()
6868
lia.administrator.privileges[name] = min
69-
lia.administrator.privMeta[name] = tostring(priv.Category or "Unassigned")
69+
lia.administrator.privMeta[name] = tostring(priv.Category or L("unassigned"))
7070
for groupName in pairs(lia.administrator.groups or {}) do
7171
if shouldGrant(groupName, min) then lia.administrator.groups[groupName][name] = true end
7272
end

gamemode/core/libraries/compatibility/sam.lua

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,7 @@ hook.Add("SAM.CanRunCommand", "liaSAM", function(client, _, _, cmd)
7979
return false
8080
end
8181

82-
if client:hasPrivilege(client, "Can Bypass Staff Faction SAM Command whitelist", nil) or client:isStaffOnDuty() then
82+
if client:hasPrivilege(client, L("canBypassSAMFactionWhitelist"), nil) or client:isStaffOnDuty() then
8383
return true
8484
else
8585
client:notifyLocalized("staffRestrictedCommand")
@@ -177,24 +177,24 @@ lia.command.add("cleardecals", {
177177
lia.administrator.registerPrivilege({
178178
Name = L("canSeeSAMNotificationsOutsideStaff"),
179179
MinAccess = "superadmin",
180-
Category = L("categorySAM")
180+
Category = "SAM | Admin Mod"
181181
})
182182

183183
lia.administrator.registerPrivilege({
184184
Name = L("canBypassSAMFactionWhitelist"),
185185
MinAccess = "superadmin",
186-
Category = L("categorySAM")
186+
Category = "SAM | Admin Mod"
187187
})
188188

189189
lia.config.add("AdminOnlyNotification", "Admin Only Notifications", true, nil, {
190190
desc = "Restricts certain notifications to admins with specific permissions or those on duty.",
191-
category = L("categorySAM"),
191+
category = "SAM | Admin Mod",
192192
type = "Boolean"
193193
})
194194

195195
lia.config.add("SAMEnforceStaff", "Enforce Staff Rank To SAM", true, nil, {
196196
desc = "Determines whether staff enforcement for SAM commands is enabled",
197-
category = L("categorySAM"),
197+
category = "SAM | Admin Mod",
198198
type = "Boolean"
199199
})
200200

gamemode/core/libraries/compatibility/serverguard.lua

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ function serverguard.permission:Add(identifier, priv)
3232
lia.administrator.registerPrivilege({
3333
Name = identifier,
3434
MinAccess = "admin",
35-
Category = L("categoryServerGuard")
35+
Category = "ServerGuard"
3636
})
3737
end
3838
end

0 commit comments

Comments
 (0)