• There is NO official Otland's Discord server and NO official Otland's server list. The Otland's Staff does not manage any Discord server or server list. Moderators or administrator of any Discord server or server lists have NO connection to the Otland's Staff. Do not get scammed!

Add some more languages

Gubailovo

Well-Known Member
Joined
Dec 19, 2013
Messages
409
Solutions
2
Reaction score
66
LUA:
function setLanguage(str)
    if str == 'pt' then
      dofile('configs_pt.lua')
      tutorialsIndex = tutorialsIndex_pt
      tutorialsInfo  = tutorialsInfo_pt
    else
      dofile('configs_en.lua')
      tutorialsIndex = tutorialsIndex_en
      tutorialsInfo  = tutorialsInfo_en
    end
    
    maxCategories  = #tutorialsIndex
        
    -- Limpar as limpas existentes     
    for index, widget in pairs(form.lines) do
      widget:destroy()
    end   
    form.lines = {}
        
    -- Recriar linhas
    for sectionIndex, section in pairs(tutorialsIndex) do
        local label = g_ui.createWidget('TutorialLabel', form.indexList)
        label:setId("index" .. sectionIndex)
        label.index = sectionIndex
        label:setText(section)
        label:setColor(config.categoriesColor)
        table.insert(form.lines, label)

        for index, currentTutorial in pairs(tutorialsInfo[sectionIndex]) do
            local labelTree = g_ui.createWidget('TutorialLabel', form.indexList)
            labelTree.img   = currentTutorial.img
            labelTree:setId("index" .. sectionIndex .. "labelTree" .. index)
            labelTree.description = currentTutorial.text
            labelTree:setText("    " .. currentTutorial.name)
            labelTree:setVisible(false)
            labelTree.index      = sectionIndex
            labelTree.label      = index
            labelTree.isTutorial = true
            table.insert(form.lines, labelTree)
        end
    end
 
end

i want to add these two languages
Code:
     dofile('configs_rus.lua')
      tutorialsIndex = tutorialsIndex_rus
      tutorialsInfo  = tutorialsInfo_rus
      
      
           dofile('configs_pl.lua')
      tutorialsIndex = tutorialsIndex_pl
      tutorialsInfo  = tutorialsInfo_pl
I have already created the lua files
and added buttons to .otui
thank you in advance
 
PHP:
if str == 'pt' then
      dofile('configs_pt.lua')
      tutorialsIndex = tutorialsIndex_pt
      tutorialsInfo  = tutorialsInfo_pt
elseif str == 'en' then
      dofile('configs_en.lua')
      tutorialsIndex = tutorialsIndex_en
      tutorialsInfo  = tutorialsInfo_en
elseif str == 'rus' then
      dofile('configs_rus.lua')
      tutorialsIndex = tutorialsIndex_rus
      tutorialsInfo  = tutorialsInfo_rus
 else 
       dofile('configs_pl.lua')
      tutorialsIndex = tutorialsIndex_pl
      tutorialsInfo  = tutorialsInfo_pl
 end
 
Back
Top