Jump to content
  • 0

How to use getLocale


Mytz_321

Question

3 answers to this question

Recommended Posts

3 hours ago, Mytz_321 said:

function awal()
    local t = {
        ['en_US'] = 'en','Welcome',
        ['in'] = 'id','Selamat datang'
    }
    local z = gg.getLocale()
    local zz = t[z]
    gg.alert(zz[2])

 

help me pls

You can add another words if you want

local currentLang = gg.getLocale()
local eng = {"Welcome!", "Another words"}
local ind = {"Selamat Datang!", "Kata-kata lain"}
if currentLang == "en_US" then
lang = eng
elseif currentLang == "in" then
lang = ind
end
gg.alert(lang[1])
print(lang[2])

Btw, you can set default lang if user use another lang with adding "else" like this

if currentLang == "en_US" then
lang = eng
elseif currentLang == "in" then
lang = ind
else
lang = eng
end

Sorry for my bad English

Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.