Hello everyone,
I’ve six files
-
main.lua
-
english.lua
-
russian.lua
-
welcome.lua
-
ice.lua //DATABASE FILE
-
options.lua
main.lua
local myGroup = display.newGroup() _G.language = “english” function whatLanguage() local settingData = IceBox:new( “settings” ) settingData:load() _G.language = settingData:retrieve(“language”) or “english” require (_G.language) end function mymain() director:changeScene(“welcome”, “none”); return myGroup end mymain()
english.lua
function welcomeUser() return “Welcome Guest” end
russian.lua
function welcomeUser() return “Добро пожаловать, Гость” end
welcome.lua
module(…, package.seeall) function greetUser() whatLanguage() --Function Defined In main.lua welcomeUser() --Function Defined In english.lua and russian.lua end
It works fine when I start the game but when I change language from english to russian in options.lua file and call welcome.lua file, It still shows me text in english language.
What I want is to remove english.lua and include russian.lua.
I cannot merge my files as there is hell lot of data.
Is it possible to switch the files?
Any help would be highly appreciated…
Thanks,