mirror of
https://github.com/edubart/otclient.git
synced 2025-10-16 04:24:54 +02:00
implement all needed tr() for localization
* implement some pt-BR translations * remove legacy about module
This commit is contained in:
@@ -25,14 +25,14 @@ local function tryLogin(charInfo, tries)
|
||||
|
||||
if tries > 4 then
|
||||
CharacterList.destroyLoadBox()
|
||||
displayErrorBox('Error', 'Could not logout.')
|
||||
displayErrorBox(tr('Error'), tr('Unable to logout.'))
|
||||
return
|
||||
end
|
||||
|
||||
if g_game.isOnline() then
|
||||
g_game.safeLogout()
|
||||
if tries == 1 then
|
||||
loadBox = displayCancelBox('Please wait', 'Loggin out...')
|
||||
loadBox = displayCancelBox(tr('Please wait'), tr('Loggin out...'))
|
||||
end
|
||||
scheduleEvent(function() tryLogin(charInfo, tries+1) end, 250)
|
||||
return
|
||||
@@ -42,7 +42,7 @@ local function tryLogin(charInfo, tries)
|
||||
|
||||
g_game.loginWorld(EnterGame.account, EnterGame.password, charInfo.worldName, charInfo.worldHost, charInfo.worldPort, charInfo.characterName)
|
||||
|
||||
loadBox = displayCancelBox('Please wait', 'Connecting to game server...')
|
||||
loadBox = displayCancelBox(tr('Please wait'), tr('Connecting to game server...'))
|
||||
connect(loadBox, { onCancel = function()
|
||||
loadBox = nil
|
||||
g_game.cancelLogin()
|
||||
@@ -55,7 +55,7 @@ end
|
||||
|
||||
function onGameLoginError(message)
|
||||
CharacterList.destroyLoadBox()
|
||||
errorBox = displayErrorBox("Login Error", "Login error: " .. message)
|
||||
errorBox = displayErrorBox(tr("Login Error"), message)
|
||||
errorBox.onOk = function()
|
||||
errorBox = nil
|
||||
CharacterList.showAgain()
|
||||
@@ -64,7 +64,7 @@ end
|
||||
|
||||
function onGameConnectionError(message)
|
||||
CharacterList.destroyLoadBox()
|
||||
errorBox = displayErrorBox("Login Error", "Connection error: " .. message)
|
||||
errorBox = displayErrorBox(tr("Login Error"), message)
|
||||
errorBox.onOk = function()
|
||||
errorBox = nil
|
||||
CharacterList.showAgain()
|
||||
@@ -128,7 +128,7 @@ function CharacterList.create(characters, premDays)
|
||||
characterList:focusChild(focusLabel, ActiveFocusReason)
|
||||
|
||||
if premDays > 0 then
|
||||
accountStatusLabel:setText("Account Status:\nPremium Account (" .. premDays .. ' days left)')
|
||||
accountStatusLabel:setText(tr("Account Status:\nPremium Account (%s) days left", premDays))
|
||||
end
|
||||
end
|
||||
|
||||
@@ -173,7 +173,7 @@ function CharacterList.doLogin()
|
||||
CharacterList.hide()
|
||||
tryLogin(charInfo)
|
||||
else
|
||||
displayErrorBox('Error', 'You must select a character to login!')
|
||||
displayErrorBox(tr('Error'), tr('You must select a character to login!'))
|
||||
end
|
||||
end
|
||||
|
||||
|
@@ -51,7 +51,7 @@ MainWindow
|
||||
//CheckBox
|
||||
// id: charAutoLoginBox
|
||||
// !text: tr('Auto login')
|
||||
// tooltip: Auto login selected character on next charlist load
|
||||
// !tooltip: tr('Auto login selected character on next charlist load')
|
||||
// anchors.left: parent.left
|
||||
// anchors.right: parent.right
|
||||
// anchors.bottom: next.top
|
||||
|
@@ -24,7 +24,7 @@ local function onError(protocol, message, connectionError)
|
||||
if not connectionError then
|
||||
clearAccountFields()
|
||||
end
|
||||
local errorBox = displayErrorBox('Login Error', message)
|
||||
local errorBox = displayErrorBox(tr('Login Error'), message)
|
||||
connect(errorBox, { onOk = EnterGame.show })
|
||||
end
|
||||
|
||||
@@ -51,7 +51,7 @@ local function onCharacterList(protocol, characters, premDays)
|
||||
local lastMotdNumber = Settings.getNumber("motd")
|
||||
if motdNumber and motdNumber ~= lastMotdNumber then
|
||||
Settings.set("motd", motdNumber)
|
||||
local motdBox = displayInfoBox("Message of the day", motdMessage)
|
||||
local motdBox = displayInfoBox(tr('Message of the day'), motdMessage)
|
||||
connect(motdBox, { onOk = CharacterList.show })
|
||||
CharacterList.hide()
|
||||
end
|
||||
@@ -60,8 +60,8 @@ end
|
||||
-- public functions
|
||||
function EnterGame.init()
|
||||
enterGame = displayUI('entergame.otui')
|
||||
enterGameButton = TopMenu.addLeftButton('enterGameButton', 'Login (Ctrl + G)', 'login.png', EnterGame.openWindow)
|
||||
motdButton = TopMenu.addLeftButton('motdButton', 'Message of the day', 'motd.png', EnterGame.displayMotd)
|
||||
enterGameButton = TopMenu.addLeftButton('enterGameButton', tr('Login') .. ' (Ctrl + G)', 'login.png', EnterGame.openWindow)
|
||||
motdButton = TopMenu.addLeftButton('motdButton', tr('Message of the day'), 'motd.png', EnterGame.displayMotd)
|
||||
motdButton:hide()
|
||||
Keyboard.bindKeyDown('Ctrl+G', EnterGame.openWindow)
|
||||
|
||||
@@ -133,7 +133,7 @@ function EnterGame.doLogin()
|
||||
protocolLogin.onMotd = onMotd
|
||||
protocolLogin.onCharacterList = onCharacterList
|
||||
|
||||
loadBox = displayCancelBox('Please wait', 'Connecting to login server...')
|
||||
loadBox = displayCancelBox(tr('Please wait'), tr('Connecting to login server...'))
|
||||
connect(loadBox, { onCancel = function(msgbox)
|
||||
loadBox = nil
|
||||
protocolLogin:cancelLogin()
|
||||
@@ -144,5 +144,5 @@ function EnterGame.doLogin()
|
||||
end
|
||||
|
||||
function EnterGame.displayMotd()
|
||||
displayInfoBox('Message of the day', motdMessage)
|
||||
displayInfoBox(tr('Message of the day'), motdMessage)
|
||||
end
|
||||
|
Reference in New Issue
Block a user