This commit is contained in:
lifestorm
2024-08-05 18:40:29 +03:00
parent c4d91bf369
commit 324f19217d
8040 changed files with 1853423 additions and 21 deletions

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,51 @@
--[[
| This file was obtained through the combined efforts
| of Madbluntz & Plymouth Antiquarian Society.
|
| Credits: lifestorm, Gregory Wayne Rossel JR.,
| Maloy, DrPepper10 @ RIP, Atle!
|
| Visit for more: https://plymouth.thetwilightzone.ru/
--]]
---- Test/gimmick lang
-- Not an example of how you should translate something. See english.lua for that.
local L = LANG.CreateLanguage("Swedish chef")
local gsub = string.gsub
local function Borkify(word)
local b = string.byte(word:sub(1, 1))
if b > 64 and b < 91 then
return "Bork"
end
return "bork"
end
local realised = false
-- Upon selection, borkify every english string.
-- Even with all the string manipulation this only takes a few ms.
local function LanguageChanged(old, new)
if realised or new != "swedish chef" then return end
local eng = LANG.GetUnsafeNamed("english")
for k, v in pairs(eng) do
L[k] = gsub(v, "[{}%w]+", Borkify)
end
realised = true
end
hook.Add("TTTLanguageChanged", "ActivateChef", LanguageChanged)
-- As fallback, non-existent indices translated on the fly.
local GetFrom = LANG.GetTranslationFromLanguage
setmetatable(L,
{
__index = function(t, k)
local w = GetFrom(k, "english") or "bork"
return gsub(w, "[{}%w]+", "BORK")
end
})

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff