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
and added buttons to .otui
thank you in advance