mirror of
https://github.com/edubart/otclient.git
synced 2025-10-19 14:03:26 +02:00
Refactoring and flexibility changes
* Split game module into game and game_interface * Move core_lib to corelib * Move miniwindow to corelib * Introduce init.lua script for initializing the client, giving much more flexibility * OTClient is no longer Application derived and is much simpler
This commit is contained in:
@@ -47,9 +47,9 @@ function Locales.init()
|
||||
|
||||
local userLocaleName = Settings.get('locale')
|
||||
if userLocaleName and Locales.setLocale(userLocaleName) then
|
||||
--info('Using configured locale: ' .. userLocaleName)
|
||||
pdebug('Using configured locale: ' .. userLocaleName)
|
||||
else
|
||||
--info('Using default locale: ' .. defaultLocaleName)
|
||||
pdebug('Using default locale: ' .. defaultLocaleName)
|
||||
Locales.setLocale(defaultLocaleName)
|
||||
Settings.set('locale', defaultLocaleName)
|
||||
end
|
||||
@@ -100,7 +100,7 @@ end
|
||||
function Locales.setLocale(name)
|
||||
local locale = installedLocales[name]
|
||||
if not locale then
|
||||
warning("Locale " .. name .. ' does not exist.')
|
||||
pwarning("Locale " .. name .. ' does not exist.')
|
||||
return false
|
||||
end
|
||||
currentLocale = locale
|
||||
@@ -125,7 +125,7 @@ function tr(text, ...)
|
||||
local translation = currentLocale.translation[text]
|
||||
if not translation then
|
||||
if currentLocale.name ~= defaultLocaleName then
|
||||
warning('Unable to translate: \"' .. text .. '\"')
|
||||
pwarning('Unable to translate: \"' .. text .. '\"')
|
||||
end
|
||||
translation = text
|
||||
end
|
||||
|
Reference in New Issue
Block a user