Skip to content

Commit

Permalink
Add DarkRP.getPhraseLocalized
Browse files Browse the repository at this point in the history
  • Loading branch information
Argus-cpp authored and FPtje committed Oct 28, 2023
1 parent 12ac63e commit 7b5fac6
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions gamemode/modules/language/sh_language.lua
Original file line number Diff line number Diff line change
Expand Up @@ -28,8 +28,8 @@ function DarkRP.getPhrase(name, ...)
return (langTable[name] or rp_languages.en[name]) and string.format(langTable[name] or rp_languages.en[name], ...) or nil
end

function DarkRP.getPhraseLocalized(name, ply, ...)
local lang = ply and ply:IsValid() and ply:GetInfo("gmod_language") or selectedLanguage
function DarkRP.getPhraseLocalized(ply, name, ...)
local lang = IsValid(ply) and ply:GetInfo("gmod_language") or selectedLanguage
local langTable = rp_languages[lang] or rp_languages.en

return (langTable[name] or rp_languages.en[name]) and string.format(langTable[name] or rp_languages.en[name], ...) or nil
Expand Down

0 comments on commit 7b5fac6

Please sign in to comment.