From 566aba65b188ba5560677133dcda092bbacc72fa Mon Sep 17 00:00:00 2001 From: Zbizu Date: Sun, 26 Jan 2025 00:13:15 +0100 Subject: [PATCH 1/8] locale metatable, bot translations (english) --- data/locales/de.lua | 2 +- data/locales/en.lua | 199 +++++++++++++++++- data/styles/30-minimap.otui | 12 +- mods/client_textedit/textedit.otui | 6 +- mods/game_bot/bot.lua | 18 +- mods/game_bot/bot.otui | 6 +- .../cavebot_1.3/cavebot/config.lua | 17 +- .../targetbot/creature_editor.otui | 10 +- .../cavebot_1.3/targetbot/looting.otui | 4 +- .../vBot_4.8/cavebot/config.lua | 2 +- .../vBot_4.8/cavebot/minimap.lua | 4 +- .../vBot_4.8/targetbot/creature_editor.otui | 10 +- .../vBot_4.8/targetbot/looting.otui | 2 +- .../vBot_4.8/vBot/AttackBot.otui | 6 +- .../vBot_4.8/vBot/BotServer.lua | 2 +- .../vBot_4.8/vBot/BotServer.otui | 6 +- .../vBot_4.8/vBot/Conditions.lua | 2 +- .../vBot_4.8/vBot/Conditions.otui | 4 +- .../vBot_4.8/vBot/Containers.lua | 18 +- .../default_configs/vBot_4.8/vBot/Dropper.lua | 2 +- .../vBot_4.8/vBot/Equipper.lua | 2 +- .../default_configs/vBot_4.8/vBot/HealBot.lua | 2 +- .../vBot_4.8/vBot/HealBot.otui | 12 +- .../default_configs/vBot_4.8/vBot/Sio.lua | 2 +- .../default_configs/vBot_4.8/vBot/alarms.lua | 2 +- .../default_configs/vBot_4.8/vBot/alarms.otui | 4 +- .../vBot_4.8/vBot/analyzer.otui | 4 +- .../default_configs/vBot_4.8/vBot/combo.lua | 2 +- .../default_configs/vBot_4.8/vBot/combo.otui | 6 +- .../vBot_4.8/vBot/depositer_config.otui | 4 +- .../vBot_4.8/vBot/equipper.otui | 8 +- .../default_configs/vBot_4.8/vBot/extras.otui | 4 +- .../vBot_4.8/vBot/new_healer.lua | 2 +- .../vBot_4.8/vBot/new_healer.otui | 4 +- .../vBot_4.8/vBot/playerlist.otui | 6 +- .../default_configs/vBot_4.8/vBot/pushmax.lua | 2 +- .../vBot_4.8/vBot/pushmax.otui | 4 +- .../vBot_4.8/vBot/siolist.otui | 4 +- .../vBot_4.8/vBot/supplies.otui | 6 +- mods/game_bot/edit.otui | 38 ++-- mods/game_bot/functions/ui_windows.lua | 4 +- mods/game_bot/panels/attacking.lua | 14 +- mods/game_bot/panels/looting.lua | 18 +- mods/game_bot/panels/waypoints.lua | 32 +-- mods/game_buttons/buttons.otui | 2 +- mods/game_itemselector/itemselector.otui | 12 +- modules/client_locales/locale.lua | 115 ++++++++++ modules/client_locales/locales.lua | 24 ++- 48 files changed, 505 insertions(+), 166 deletions(-) create mode 100644 modules/client_locales/locale.lua diff --git a/data/locales/de.lua b/data/locales/de.lua index d6b2dd446a..2e30dfc084 100644 --- a/data/locales/de.lua +++ b/data/locales/de.lua @@ -1,4 +1,4 @@ - +-- Author: Samuel locale = { name = "de", charset = "cp1252", diff --git a/data/locales/en.lua b/data/locales/en.lua index 550811092d..fabf80d8ab 100644 --- a/data/locales/en.lua +++ b/data/locales/en.lua @@ -7,8 +7,203 @@ locale = { decimalSeperator = '.', thousandsSeperator = ',', - -- translations are not needed because everything is already in english translation = {} } - modules.client_locales.installLocale(locale) + +-- locale definitions +local locale = Locale("English", "en") +locale:authors("OTClient contributors") +locale:charset("cp1252") +locale:formatNumbers(true) +locale:decimalSeperator('.') +locale:thousandsSeperator(',') + +---- translations ---- + +-- case convention: PascalCase +-- recommended naming order: +-- Module -> Element -> Child -> Action + +-- example: +-- module: ItemSelector +-- element: Title +-- child: - +-- action: RemoveConfig +-- full string: ItemSelectorTitleRemoveConfig + +-- example2: +-- module: Minimap +-- element: Window +-- child: Title +-- action: SetMark +-- full string: MinimapWindowTitleSetMark + +-- UI: common buttons +locale:translate("UIButtonOk", "OK") +locale:translate("UIButtonCancel", "Cancel") +locale:translate("UIButtonYes", "Yes") +locale:translate("UIButtonNo", "No") +locale:translate("UIButtonOn", "ON") +locale:translate("UIButtonOff", "OFF") +locale:translate("UIButtonClose", "Close") +locale:translate("UIButtonHelp", "Help") +locale:translate("UIButtonSettings", "Settings") +locale:translate("UIButtonEdit", "Edit") +locale:translate("UIButtonRemove", "Remove") +locale:translate("UIButtonClear", "Clear") + +-- UI: common form fields +locale:translate("FormFieldDescription", "Description") +locale:translate("FormFieldPosition", "Position") + +-- UI: window titles misc +locale:translate("WindowTitleTextEdit", "Edit text") + +-- UI: possibly unused +locale:translate("ButtonsWindowTitle", "Buttons") + +-- item selector +locale:translate("ItemSelectorCountSubtype", "Count / SubType") +locale:translate("ItemSelectorItemID", "Item ID") +locale:translate("ItemSelectorWindowTitle", "Select Item") + +-- minimap +locale:translate("MinimapWindowTitleSetMark", "Create Map Mark") +locale:translate("MinimapButtonCenter", "Center") + +-- bot: main window +locale:translate("BotMainWindowTitle", "Config editor & manager") +locale:translate( + "BotMainWindowText", + "Config Manager\nYou can use config manager to share configs between different machines, especially smartphones. After you configure your config, you can upload it, then you'll get unique hash code which you can use on diffent machinge (for eg. mobile phone) to download it." +) +locale:translate("BotMainWindowConfigUploadLabel", "Upload config") +locale:translate("BotMainWindowConfigUploadButton", "Upload config") +locale:translate("BotMainWindowConfigUploadSelector", "Select config to upload") +locale:translate("BotMainWindowConfigDownloadLabel", "Download config") +locale:translate("BotMainWindowConfigDownloadButton", "Download config") +locale:translate("BotMainWindowConfigDownloadHashField", "Enter config hash code") +locale:translate("BotMainWindowInfoConfig", "Bot configs are stored in") +locale:translate("BotMainWindowOpenBotFolder", "Click here to open bot directory") +locale:translate( + "BotMainWindowInfoDirectory", + "Every directory in bot directory is treated as different config.\nTo create new config just create new directory." +) +locale:translate( + "BotMainWindowInfoLoadingOrder", + "Inside config directory put .lua and .otui files.\nEvery file will be loaded and executed in alphabetical order, .otui first and then .lua." +) +locale:translate( + "BotMainWindowInfoReload", + "To reload configs just press On and Off in bot window.\nTo learn more about bot click Tutorials button." +) +locale:translate("BotMainWindowDocumentation", "Documentation") +locale:translate("BotMainWindowTutorials", "Tutorials") +locale:translate("BotMainWindowScripts", "Scripts") +locale:translate("BotMainWindowForum", "Forum") +locale:translate("BotMainWindowDiscord", "Discord") + +-- bot: config +locale:translate("BotConfigUploadPendingTitle", "Uploading config") +locale:translate("BotConfigUploadPendingText", "Uploading config %1. Please wait.") +locale:translate("BotConfigUploadFailTitle", "Config upload failed") +locale:translate("BotConfigUploadFailText", "Error while upload config %1:\n%2") +locale:translate("BotConfigUploadFailSize", "Config %1 is too big, maximum size is 1024KB. Now it has %2 KB.") +locale:translate("BotConfigUploadFailCompression", "Config %1 is invalid (can't be compressed)") +locale:translate("BotConfigUploadSuccessTitle", "Succesful config upload") +locale:translate("BotConfigUploadSuccessText", "Config %1 has been uploaded.\n%2") + + +locale:translate("BotConfigDownloadTitle", "Download Config") +locale:translate("BotConfigDownloadText", "Downloading config with hash %1. Please wait.") +locale:translate("BotConfigDownloadErrorTitle", "Config download error") +locale:translate("BotConfigDownloadErrorHash", "Enter correct config hash") +locale:translate("BotConfigDownloadErrorFailed", "Config with hash %1 cannot be downloaded") + +-- bot: common strings +locale:translate("BotUnnamedConfig", "Unnamed Config") +locale:translate("BotRemoveConfig", "Remove Config") + +-- bot: waypoints editor +locale:translate("WaypointsEditorTitle", "Waypoints editor") +locale:translate( + "WaypointsEditorMessageRemoveConfig", + "Do you want to remove current waypoints config?" +) +locale:translate("WaypointsEditorTitleAddFunction", "Add function") +locale:translate("WaypointsEditorErrorInvalidGoto", "Waypoints: invalid use of goto function") +locale:translate("WaypointsEditorErrorInvalidUse", "Waypoints: invalid use of use function") +locale:translate("WaypointsEditorErrorInvalidUseWith", "Waypoints: invalid use of usewith function") +locale:translate("WaypointsEditorErrorExecution", "Waypoints function execution error") + +-- bot: looting +locale:translate("BotLootingBlacklist", "Loot every item, except these") +locale:translate("BotLootingAddItem", "Drag item or click on any of empty slot") +locale:translate("BotLootingConfigLootAll", "Loot every item") +locale:translate("BotLootingEditorTitle", "Looting editor") +locale:translate( + "BotLootingEditorMessageRemoveConfig", + "Do you want to remove current looting config?" +) + +-- bot: attacking +locale:translate("BotAttackingButton", "AttackBot") +locale:translate("BotAttackingTitleEditMonster", "Edit monster") +locale:translate( + "BotAttackingMessageRemoveConfig", + "Do you want to remove current attacking config?" +) + +-- bot: equipper +locale:translate("BotEquipperBossList", "Boss list") +locale:translate("BotEquipperMethodOrder", "More important methods come first.") +locale:translate("BotEquipperEQManager", "EQ Manager") + +-- bot: botserver +locale:translate("BotServerWindowTitle", "BotServer") +locale:translate("BotServerWindowLabelData", "BotServer Data") +locale:translate("BotServerButton", "BotServer") + +-- bot: cavebot +locale:translate("BotCavePing", "Server ping") +locale:translate("BotCaveWalkDelay", "Walk delay") +locale:translate("BotCaveMapClick", "Use map click") +locale:translate("BotCaveMapClickDelay", "Map click delay") +locale:translate("BotCaveIgnoreFields", "Ignore fields") +locale:translate("BotCaveSkipBlocked", "Skip blocked path") +locale:translate("BotCaveUseDelay", "Delay after use") + +-- bot: other +locale:translate("BotSupplies", "Supplies") +locale:translate("BotHealerOptions", "Healer Options") +locale:translate("BotTitleHealBot", "HealBot") +locale:translate("BotFriendHealer", "Friend Healer") +locale:translate("BotSelfHealer", "Self Healer") +locale:translate("BotPushMaxSettings", "Pushmax Settings") +locale:translate("BotPushMaxButton", "PUSHMAX") +locale:translate("BotPlayerList", "Player List") +locale:translate("BotInfoMethodOrder", "More important methods come first (Example: Exura gran above Exura)") +locale:translate("BotButtonMinimiseAll", "Minimise All") +locale:translate("BotButtonReopenAll", "Reopen All") +locale:translate("BotButtonOpenMinimised", "Open Minimised") +locale:translate("BotButtonConditions", "Conditions") +locale:translate("BotButtonComboBot", "ComboBot") +locale:translate("BotWindowTitleExtras", "Extras") +locale:translate("BotWindowTitleDropper", "Dropper") +locale:translate("BotWindowTitleDepositer", "Depositer Panel") +locale:translate("BotWindowTitleContainerNames", "Container Names") +locale:translate("BotWindowTitleConditionManager", "Condition Manager") +locale:translate("BotWindowTitleComboOptions", "Combo Options") +locale:translate("BotAlarms", "Alarms") +locale:translate("BotHelpTutorials", "Help & Tutorials") +locale:translate("BotCreatureEditorHint_1", "You can use * (any characters) and ? (any character) in target name") +locale:translate("BotCreatureEditorHint_2", "You can also enter multiple targets, separate them by ,") +locale:translate("BotMinimapOptionCreateMark", "Create mark") +locale:translate("BotMinimapOptionAddGoTo", "Add CaveBot GoTo") +locale:translate("BotStatusWaiting", "Status: waiting") +locale:translate("BotMiniWindowTitle", "Bot") +locale:translate("BotMainPanelToggleButton", "Bot") + +-- register +locale:register() diff --git a/data/styles/30-minimap.otui b/data/styles/30-minimap.otui index b7466c2e9e..5ef78cd01f 100644 --- a/data/styles/30-minimap.otui +++ b/data/styles/30-minimap.otui @@ -55,7 +55,7 @@ MinimapZoomOutButton < Button //icon-source: /images/game/minimap/zoom_out MinimapResetButton < Button - !text: tr('Center') + !text: localize('MinimapButtonCenter') size: 44 20 anchors.left: parent.left anchors.top: parent.top @@ -112,11 +112,11 @@ MinimapFlagCheckBox < CheckBox image-clip: 52 0 26 26 MinimapFlagWindow < MainWindow - !text: tr('Create Map Mark') + !text: localize('MinimapWindowTitleSetMark') size: 196 185 Label - !text: tr('Position') .. ':' + !text: localize('FormFieldPosition') .. ':' text-auto-resize: true anchors.top: parent.top anchors.left: parent.left @@ -130,7 +130,7 @@ MinimapFlagWindow < MainWindow margin-top: 2 Label - !text: tr('Description') .. ':' + !text: localize('FormFieldDescription') .. ':' anchors.left: parent.left anchors.top: prev.bottom margin-top: 7 @@ -232,7 +232,7 @@ MinimapFlagWindow < MainWindow Button id: okButton - !text: tr('Ok') + !text: localize('UIButtonOk') width: 64 anchors.right: next.left anchors.bottom: parent.bottom @@ -240,7 +240,7 @@ MinimapFlagWindow < MainWindow Button id: cancelButton - !text: tr('Cancel') + !text: localize('UIButtonCancel') width: 64 anchors.right: parent.right anchors.bottom: parent.bottom diff --git a/mods/client_textedit/textedit.otui b/mods/client_textedit/textedit.otui index 483d5a47ed..5f7aac87ed 100644 --- a/mods/client_textedit/textedit.otui +++ b/mods/client_textedit/textedit.otui @@ -4,7 +4,7 @@ TextEditButtons < Panel Button id: ok - !text: tr('Ok') + !text: localize('UIButtonOk') anchors.bottom: parent.bottom anchors.right: next.left margin-right: 10 @@ -12,14 +12,14 @@ TextEditButtons < Panel Button id: cancel - !text: tr('Cancel') + !text: localize('UIButtonCancel') anchors.bottom: parent.bottom anchors.right: parent.right width: 60 TextEditWindow < MainWindow id: textedit - !text: tr("Edit text") + !text: localize('WindowTitleTextEdit') layout: type: verticalBox fit-children: true diff --git a/mods/game_bot/bot.lua b/mods/game_bot/bot.lua index 76895b424d..3684c8fccb 100644 --- a/mods/game_bot/bot.lua +++ b/mods/game_bot/bot.lua @@ -35,7 +35,7 @@ function init() initCallbacks() - botButton = modules.game_mainpanel.addToggleButton('botButton', tr('Bot'), '/images/options/bot', toggle, false, 99999) + botButton = modules.game_mainpanel.addToggleButton('botButton', localize('BotMainPanelToggleButton'), '/images/options/bot', toggle, false, 99999) botButton:setOn(false) botButton:hide() @@ -336,37 +336,37 @@ function uploadConfig() local config = editWindow.manager.upload.config:getCurrentOption().text local archive = compressConfig(config) if not archive then - return displayErrorBox(tr("Config upload failed"), tr("Config %s is invalid (can't be compressed)", config)) + return displayErrorBox(localize('BotConfigUploadFailTitle'), localize('BotConfigUploadFailCompression', config)) end if archive:len() > 1024 * 1024 then - return displayErrorBox(tr("Config upload failed"), tr("Config %s is too big, maximum size is 1024KB. Now it has %s KB.", config, math.floor(archive:len() / 1024))) + return displayErrorBox(localize('BotConfigUploadFailTitle'), localize('BotConfigUploadFailSize', config, math.floor(archive:len() / 1024))) end - local infoBox = displayInfoBox(tr("Uploading config"), tr("Uploading config %s. Please wait.", config)) + local infoBox = displayInfoBox(localize('BotConfigUploadPendingTitle'), localize('BotConfigUploadPendingText', config)) HTTP.postJSON(configManagerUrl .. "?config=" .. config:gsub("%s+", "_"), archive, function(data, err) if infoBox then infoBox:destroy() end if err or data["error"] then - return displayErrorBox(tr("Config upload failed"), tr("Error while upload config %s:\n%s", config, err or data["error"])) + return displayErrorBox(localize('BotConfigUploadFailTitle'), localize('BotConfigUploadFailText', config, err or data["error"])) end - displayInfoBox(tr("Succesful config upload"), tr("Config %s has been uploaded.\n%s", config, data["message"])) + displayInfoBox(localize('BotConfigUploadSuccessTitle'), localize('BotConfigUploadSuccessText', config, data["message"])) end) end function downloadConfig() local hash = editWindow.manager.download.config:getText() if hash:len() == 0 then - return displayErrorBox(tr("Config download error"), tr("Enter correct config hash")) + return displayErrorBox(localize('BotConfigDownloadErrorTitle'), localize('BotConfigDownloadErrorHash')) end - local infoBox = displayInfoBox(tr("Downloading config"), tr("Downloading config with hash %s. Please wait.", hash)) + local infoBox = displayInfoBox(localize('BotConfigDownloadTitle'), localize('BotConfigDownloadText', hash)) HTTP.download(configManagerUrl .. "?hash=" .. hash, hash .. ".zip", function(path, checksum, err) if infoBox then infoBox:destroy() end if err then - return displayErrorBox(tr("Config download error"), tr("Config with hash %s cannot be downloaded", hash)) + return displayErrorBox(localize('BotConfigDownloadErrorTitle'), localize('BotConfigDownloadErrorFailed', hash)) end modules.client_textedit.show("", { title="Enter name for downloaded config", diff --git a/mods/game_bot/bot.otui b/mods/game_bot/bot.otui index 2096ae4b23..fb41e2550b 100644 --- a/mods/game_bot/bot.otui +++ b/mods/game_bot/bot.otui @@ -22,7 +22,7 @@ BotTabBarButton < TabBarButton MiniWindow id: botWindow - !text: tr('Bot') + !text: localize('BotMiniWindowTitle') height: 600 icon: /images/topbuttons/bot @onClose: modules.game_bot.onMiniWindowClose() @@ -49,7 +49,7 @@ MiniWindow anchors.top: prev.top anchors.left: prev.right anchors.right: parent.right - !text: tr('Edit') + !text: localize('UIButtonEdit') @onClick: modules.game_bot.edit() margin-left: 3 margin-right: 37 @@ -78,7 +78,7 @@ MiniWindow text-wrap: true text-auto-resize: true text-align: center - !text: tr('Status: waiting') + !text: localize('BotStatusWaiting') margin-left: 3 margin-right: 3 diff --git a/mods/game_bot/default_configs/cavebot_1.3/cavebot/config.lua b/mods/game_bot/default_configs/cavebot_1.3/cavebot/config.lua index 78d2c2d39c..d4af090e7c 100644 --- a/mods/game_bot/default_configs/cavebot_1.3/cavebot/config.lua +++ b/mods/game_bot/default_configs/cavebot_1.3/cavebot/config.lua @@ -9,13 +9,14 @@ CaveBot.Config.setup = function() local ui = CaveBot.Config.ui local add = CaveBot.Config.add - add("ping", "Server ping", 100) - add("walkDelay", "Walk delay", 10) - add("mapClick", "Use map click", false) - add("mapClickDelay", "Map click delay", 100) - add("ignoreFields", "Ignore fields", false) - add("skipBlocked", "Skip blocked path", false) - add("useDelay", "Delay after use", 400) + -- panel id, panel title (see locales), default value + add("ping", "BotCavePing", 100) + add("walkDelay", "BotCaveWalkDelay", 10) + add("mapClick", "BotCaveMapClick", false) + add("mapClickDelay", "BotCaveMapClickDelay", 100) + add("ignoreFields", "BotCaveIgnoreFields", false) + add("skipBlocked", "BotCaveSkipBlocked", false) + add("useDelay", "BotCaveUseDelay", 400) end CaveBot.Config.show = function() @@ -79,7 +80,7 @@ CaveBot.Config.add = function(id, title, defaultValue) return error("Invalid default value of config for key " .. id .. ", should be number or boolean") end - panel.title:setText(tr(title) .. ":") + panel.title:setText(localize(title) .. ":") CaveBot.Config.value_setters[id] = setter CaveBot.Config.values[id] = defaultValue diff --git a/mods/game_bot/default_configs/cavebot_1.3/targetbot/creature_editor.otui b/mods/game_bot/default_configs/cavebot_1.3/targetbot/creature_editor.otui index df2f8ca574..d7f28e54ce 100644 --- a/mods/game_bot/default_configs/cavebot_1.3/targetbot/creature_editor.otui +++ b/mods/game_bot/default_configs/cavebot_1.3/targetbot/creature_editor.otui @@ -73,14 +73,14 @@ TargetBotCreatureEditorWindow < MainWindow anchors.right: parent.right anchors.top: parent.top text-align: center - !text: tr('You can use * (any characters) and ? (any character) in target name') + !text: localize('BotCreatureEditorHint_1') Label anchors.left: parent.left anchors.right: parent.right anchors.top: prev.bottom text-align: center - !text: tr('You can also enter multiple targets, separate them by ,') + !text: localize('BotCreatureEditorHint_2') TextEdit id: name @@ -141,7 +141,7 @@ TargetBotCreatureEditorWindow < MainWindow Button id: help - !text: tr('Help & Tutorials') + !text: localize('BotHelpTutorials') anchors.bottom: parent.bottom anchors.left: parent.left width: 150 @@ -149,7 +149,7 @@ TargetBotCreatureEditorWindow < MainWindow Button id: ok - !text: tr('Ok') + !text: localize('UIButtonOk') anchors.bottom: parent.bottom anchors.right: next.left margin-right: 10 @@ -157,7 +157,7 @@ TargetBotCreatureEditorWindow < MainWindow Button id: cancel - !text: tr('Cancel') + !text: localize('UIButtonCancel') anchors.bottom: parent.bottom anchors.right: parent.right width: 60 diff --git a/mods/game_bot/default_configs/cavebot_1.3/targetbot/looting.otui b/mods/game_bot/default_configs/cavebot_1.3/targetbot/looting.otui index dde8b2e252..20c8765a7a 100644 --- a/mods/game_bot/default_configs/cavebot_1.3/targetbot/looting.otui +++ b/mods/game_bot/default_configs/cavebot_1.3/targetbot/looting.otui @@ -17,7 +17,7 @@ TargetBotLootingPanel < Panel BotSwitch id: everyItem - !text: tr("Loot every item") + !text: localize('BotLootingConfigLootAll') margin-top: 2 Label @@ -72,7 +72,7 @@ TargetBotLootingPanel < Panel margin-top: 3 margin-left: 20 margin-right: 20 - !text: tr("Drag item or click on any of empty slot") + !text: localize('BotLootingAddItem') text-align: center text-wrap: true text-auto-resize: true diff --git a/mods/game_bot/default_configs/vBot_4.8/cavebot/config.lua b/mods/game_bot/default_configs/vBot_4.8/cavebot/config.lua index 0cb4f68dde..fe6b8b500f 100644 --- a/mods/game_bot/default_configs/vBot_4.8/cavebot/config.lua +++ b/mods/game_bot/default_configs/vBot_4.8/cavebot/config.lua @@ -81,7 +81,7 @@ CaveBot.Config.add = function(id, title, defaultValue) return warn("Invalid default value of config for key " .. id .. ", should be number or boolean") end - panel.title:setText(tr(title) .. ":") + panel.title:setText(localize(title) .. ":") CaveBot.Config.value_setters[id] = setter CaveBot.Config.values[id] = defaultValue diff --git a/mods/game_bot/default_configs/vBot_4.8/cavebot/minimap.lua b/mods/game_bot/default_configs/vBot_4.8/cavebot/minimap.lua index 604faa9393..e18455b2ee 100644 --- a/mods/game_bot/default_configs/vBot_4.8/cavebot/minimap.lua +++ b/mods/game_bot/default_configs/vBot_4.8/cavebot/minimap.lua @@ -17,8 +17,8 @@ minimap.onMouseRelease = function(widget,pos,button) local menu = g_ui.createWidget('PopupMenu') menu:setId("minimapMenu") menu:setGameMenu(true) - menu:addOption(tr('Create mark'), function() minimap:createFlagWindow(mapPos) end) - menu:addOption(tr('Add CaveBot GoTo'), function() CaveBot.addAction("goto", mapPos.x .. "," .. mapPos.y .. "," .. mapPos.z, true) CaveBot.save() end) + menu:addOption(localize('BotMinimapOptionCreateMark'), function() minimap:createFlagWindow(mapPos) end) + menu:addOption(localize('BotMinimapOptionAddGoTo'), function() CaveBot.addAction("goto", mapPos.x .. "," .. mapPos.y .. "," .. mapPos.z, true) CaveBot.save() end) menu:display(pos) return true end diff --git a/mods/game_bot/default_configs/vBot_4.8/targetbot/creature_editor.otui b/mods/game_bot/default_configs/vBot_4.8/targetbot/creature_editor.otui index 6b63a684b2..342afdd152 100644 --- a/mods/game_bot/default_configs/vBot_4.8/targetbot/creature_editor.otui +++ b/mods/game_bot/default_configs/vBot_4.8/targetbot/creature_editor.otui @@ -74,14 +74,14 @@ TargetBotCreatureEditorWindow < MainWindow anchors.right: parent.right anchors.top: parent.top text-align: center - !text: tr('You can use * (any characters) and ? (any character) in target name') + !text: localize('BotCreatureEditorHint_1') Label anchors.left: parent.left anchors.right: parent.right anchors.top: prev.bottom text-align: center - !text: tr('You can also enter multiple targets, separate them by ,') + !text: localize('BotCreatureEditorHint_2') TextEdit id: name @@ -142,7 +142,7 @@ TargetBotCreatureEditorWindow < MainWindow Button id: help - !text: tr('Help & Tutorials') + !text: localize('BotHelpTutorials') anchors.bottom: parent.bottom anchors.left: parent.left width: 150 @@ -150,7 +150,7 @@ TargetBotCreatureEditorWindow < MainWindow Button id: ok - !text: tr('Ok') + !text: localize('UIButtonOk') anchors.bottom: parent.bottom anchors.right: next.left margin-right: 10 @@ -158,7 +158,7 @@ TargetBotCreatureEditorWindow < MainWindow Button id: cancel - !text: tr('Cancel') + !text: localize('UIButtonCancel') anchors.bottom: parent.bottom anchors.right: parent.right width: 60 diff --git a/mods/game_bot/default_configs/vBot_4.8/targetbot/looting.otui b/mods/game_bot/default_configs/vBot_4.8/targetbot/looting.otui index 9873366ca6..293e47c4a1 100644 --- a/mods/game_bot/default_configs/vBot_4.8/targetbot/looting.otui +++ b/mods/game_bot/default_configs/vBot_4.8/targetbot/looting.otui @@ -18,7 +18,7 @@ TargetBotLootingPanel < Panel BotSwitch id: everyItem - !text: tr("Loot every item, except these") + !text: localize('BotLootingBlacklist') margin-top: 2 font: small-9px diff --git a/mods/game_bot/default_configs/vBot_4.8/vBot/AttackBot.otui b/mods/game_bot/default_configs/vBot_4.8/vBot/AttackBot.otui index fb4ef83b08..b604d45ed0 100644 --- a/mods/game_bot/default_configs/vBot_4.8/vBot/AttackBot.otui +++ b/mods/game_bot/default_configs/vBot_4.8/vBot/AttackBot.otui @@ -36,7 +36,7 @@ AttackEntry < UIWidget Button id: remove - !text: tr('x') + !text: 'x' anchors.right: parent.right margin-right: 15 width: 15 @@ -51,7 +51,7 @@ AttackBotBotPanel < Panel anchors.left: parent.left text-align: center width: 130 - !text: tr('AttackBot') + !text: localize('BotAttackingButton') Button id: settings @@ -562,7 +562,7 @@ AttackBotWindow < MainWindow anchors.top: parent.top margin-top: 10 margin-left: 2 - !text: tr('More important methods come first (Example: Exori gran above Exori)') + !text: localize('BotInfoMethodOrder') text-align: left font: verdana-11px-rounded color: #aeaeae diff --git a/mods/game_bot/default_configs/vBot_4.8/vBot/BotServer.lua b/mods/game_bot/default_configs/vBot_4.8/vBot/BotServer.lua index 506743b169..8c1596fdbe 100644 --- a/mods/game_bot/default_configs/vBot_4.8/vBot/BotServer.lua +++ b/mods/game_bot/default_configs/vBot_4.8/vBot/BotServer.lua @@ -11,7 +11,7 @@ Panel anchors.right: parent.right text-align: center height: 18 - !text: tr('BotServer') + !text: localize('BotServerButton') ]]) ui:setId(panelName) diff --git a/mods/game_bot/default_configs/vBot_4.8/vBot/BotServer.otui b/mods/game_bot/default_configs/vBot_4.8/vBot/BotServer.otui index 887e5e49d9..1da0be6871 100644 --- a/mods/game_bot/default_configs/vBot_4.8/vBot/BotServer.otui +++ b/mods/game_bot/default_configs/vBot_4.8/vBot/BotServer.otui @@ -10,7 +10,7 @@ BotServerData < Panel anchors.left: parent.left anchors.right: parent.right text-align: center - !text: tr("BotServer Data") + !text: localize('BotServerWindowLabelData') Label id: label @@ -155,7 +155,7 @@ FeaturePanel < Panel text: Broadcast BotServerWindow < MainWindow - !text: tr('BotServer') + !text: localize('BotServerWindowTitle') size: 370 310 @onEscape: self:hide() @@ -179,7 +179,7 @@ BotServerWindow < MainWindow Button id: closeButton - !text: tr('Close') + !text: localize('UIButtonClose') font: cipsoftFont anchors.right: parent.right anchors.bottom: parent.bottom diff --git a/mods/game_bot/default_configs/vBot_4.8/vBot/Conditions.lua b/mods/game_bot/default_configs/vBot_4.8/vBot/Conditions.lua index 86d35f002a..48317256ff 100644 --- a/mods/game_bot/default_configs/vBot_4.8/vBot/Conditions.lua +++ b/mods/game_bot/default_configs/vBot_4.8/vBot/Conditions.lua @@ -10,7 +10,7 @@ Panel anchors.left: parent.left text-align: center width: 130 - !text: tr('Conditions') + !text: localize('BotButtonConditions') Button id: conditionList diff --git a/mods/game_bot/default_configs/vBot_4.8/vBot/Conditions.otui b/mods/game_bot/default_configs/vBot_4.8/vBot/Conditions.otui index b76034e9da..199c7b53ed 100644 --- a/mods/game_bot/default_configs/vBot_4.8/vBot/Conditions.otui +++ b/mods/game_bot/default_configs/vBot_4.8/vBot/Conditions.otui @@ -411,7 +411,7 @@ HoldConditions < Panel font: cipsoftFont ConditionsWindow < MainWindow - !text: tr('Condition Manager') + !text: localize('BotWindowTitleConditionManager') size: 445 280 @onEscape: self:hide() @@ -454,7 +454,7 @@ ConditionsWindow < MainWindow Button id: closeButton - !text: tr('Close') + !text: localize('UIButtonClose') font: cipsoftFont anchors.right: parent.right anchors.bottom: parent.bottom diff --git a/mods/game_bot/default_configs/vBot_4.8/vBot/Containers.lua b/mods/game_bot/default_configs/vBot_4.8/vBot/Containers.lua index 8b41010c18..fe92986809 100644 --- a/mods/game_bot/default_configs/vBot_4.8/vBot/Containers.lua +++ b/mods/game_bot/default_configs/vBot_4.8/vBot/Containers.lua @@ -59,7 +59,7 @@ Panel anchors.left: parent.left text-align: center width: 130 - !text: tr('Open Minimised') + !text: localize('BotButtonOpenMinimised') font: verdana-11px-rounded Button @@ -74,7 +74,7 @@ Panel Button id: reopenCont - !text: tr('Reopen All') + !text: localize('BotButtonReopenAll') anchors.left: parent.left anchors.top: prev.bottom anchors.right: parent.horizontalCenter @@ -85,7 +85,7 @@ Panel Button id: minimiseCont - !text: tr('Minimise All') + !text: localize('BotButtonMinimiseAll') anchors.top: prev.top anchors.left: parent.horizontalCenter anchors.right: parent.right @@ -117,7 +117,7 @@ BackpackName < Label Button id: state - !text: tr('M') + !text: 'M' anchors.right: remove.left anchors.verticalCenter: parent.verticalCenter margin-right: 1 @@ -126,8 +126,8 @@ BackpackName < Label Button id: remove - !text: tr('X') - !tooltip: tr('Remove') + !text: 'X' + !tooltip: localize('UIButtonRemove') anchors.right: parent.right anchors.verticalCenter: parent.verticalCenter margin-right: 15 @@ -136,7 +136,7 @@ BackpackName < Label Button id: openNext - !text: tr('N') + !text: 'N' anchors.right: state.left anchors.verticalCenter: parent.verticalCenter margin-right: 1 @@ -145,7 +145,7 @@ BackpackName < Label tooltip: Open container inside with the same ID. ContListsWindow < MainWindow - !text: tr('Container Names') + !text: localize('BotWindowTitleContainerNames') size: 465 170 @onEscape: self:hide() @@ -290,7 +290,7 @@ ContListsWindow < MainWindow Button id: closeButton - !text: tr('Close') + !text: localize('UIButtonClose') font: cipsoftFont anchors.right: parent.right anchors.bottom: parent.bottom diff --git a/mods/game_bot/default_configs/vBot_4.8/vBot/Dropper.lua b/mods/game_bot/default_configs/vBot_4.8/vBot/Dropper.lua index 88955ca977..545f9b4924 100644 --- a/mods/game_bot/default_configs/vBot_4.8/vBot/Dropper.lua +++ b/mods/game_bot/default_configs/vBot_4.8/vBot/Dropper.lua @@ -10,7 +10,7 @@ Panel anchors.left: parent.left text-align: center width: 130 - !text: tr('Dropper') + !text: localize('BotWindowTitleDropper') Button id: edit diff --git a/mods/game_bot/default_configs/vBot_4.8/vBot/Equipper.lua b/mods/game_bot/default_configs/vBot_4.8/vBot/Equipper.lua index 16a872ab42..607c9712a3 100644 --- a/mods/game_bot/default_configs/vBot_4.8/vBot/Equipper.lua +++ b/mods/game_bot/default_configs/vBot_4.8/vBot/Equipper.lua @@ -9,7 +9,7 @@ Panel anchors.left: parent.left text-align: center width: 130 - !text: tr('EQ Manager') + !text: localize('BotEquipperEQManager') Button id: setup diff --git a/mods/game_bot/default_configs/vBot_4.8/vBot/HealBot.lua b/mods/game_bot/default_configs/vBot_4.8/vBot/HealBot.lua index 770a4e72bb..0ca42f85af 100644 --- a/mods/game_bot/default_configs/vBot_4.8/vBot/HealBot.lua +++ b/mods/game_bot/default_configs/vBot_4.8/vBot/HealBot.lua @@ -16,7 +16,7 @@ Panel anchors.left: parent.left text-align: center width: 130 - !text: tr('HealBot') + !text: localize('HealBot') Button id: settings diff --git a/mods/game_bot/default_configs/vBot_4.8/vBot/HealBot.otui b/mods/game_bot/default_configs/vBot_4.8/vBot/HealBot.otui index 17affcc9cd..7cdabd3a93 100644 --- a/mods/game_bot/default_configs/vBot_4.8/vBot/HealBot.otui +++ b/mods/game_bot/default_configs/vBot_4.8/vBot/HealBot.otui @@ -43,7 +43,7 @@ SpellEntry < Label Button id: remove - !text: tr('x') + !text: 'x' anchors.right: parent.right margin-right: 15 text-offset: 1 0 @@ -79,7 +79,7 @@ ItemEntry < Label Button id: remove - !text: tr('x') + !text: 'x' anchors.right: parent.right margin-right: 15 text-offset: 1 0 @@ -442,7 +442,7 @@ HealBotSettingsPanel < Panel color: #ff4513 HealWindow < MainWindow - !text: tr('Self Healer') + !text: localize('BotSelfHealer') size: 520 360 @onEscape: self:hide() @@ -451,7 +451,7 @@ HealWindow < MainWindow anchors.left: parent.left anchors.top: parent.top margin-left: 2 - !text: tr('More important methods come first (Example: Exura gran above Exura)') + !text: localize('BotInfoMethodOrder') text-align: left font: verdana-11px-rounded color: #aeaeae @@ -476,7 +476,7 @@ HealWindow < MainWindow Button id: closeButton - !text: tr('Close') + !text: localize('UIButtonClose') font: cipsoftFont anchors.right: parent.right anchors.bottom: parent.bottom @@ -485,7 +485,7 @@ HealWindow < MainWindow Button id: settingsButton - !text: tr('Settings') + !text: localize('UIButtonSettings') font: cipsoftFont anchors.left: parent.left anchors.bottom: parent.bottom diff --git a/mods/game_bot/default_configs/vBot_4.8/vBot/Sio.lua b/mods/game_bot/default_configs/vBot_4.8/vBot/Sio.lua index 6d68c55ca7..b87588a151 100644 --- a/mods/game_bot/default_configs/vBot_4.8/vBot/Sio.lua +++ b/mods/game_bot/default_configs/vBot_4.8/vBot/Sio.lua @@ -10,7 +10,7 @@ Panel anchors.left: parent.left text-align: center width: 130 - !text: tr('Friend Healer') + !text: localize('BotFriendHealer') Button id: editList diff --git a/mods/game_bot/default_configs/vBot_4.8/vBot/alarms.lua b/mods/game_bot/default_configs/vBot_4.8/vBot/alarms.lua index 80c95409e9..9f16df6a13 100644 --- a/mods/game_bot/default_configs/vBot_4.8/vBot/alarms.lua +++ b/mods/game_bot/default_configs/vBot_4.8/vBot/alarms.lua @@ -9,7 +9,7 @@ Panel anchors.left: parent.left text-align: center width: 130 - !text: tr('Alarms') + !text: localize('BotAlarms') Button id: alerts diff --git a/mods/game_bot/default_configs/vBot_4.8/vBot/alarms.otui b/mods/game_bot/default_configs/vBot_4.8/vBot/alarms.otui index 03b03d19ef..e705d1ffb7 100644 --- a/mods/game_bot/default_configs/vBot_4.8/vBot/alarms.otui +++ b/mods/game_bot/default_configs/vBot_4.8/vBot/alarms.otui @@ -61,7 +61,7 @@ AlarmCheckBoxAndTextEdit < Panel margin-bottom: 1 AlarmsWindow < MainWindow - !text: tr('Alarms') + !text: localize('BotAlarms') size: 330 400 padding: 15 @onEscape: self:hide() @@ -126,7 +126,7 @@ AlarmsWindow < MainWindow Button id: closeButton - !text: tr('Close') + !text: localize('UIButtonClose') font: cipsoftFont anchors.right: parent.right anchors.bottom: parent.bottom diff --git a/mods/game_bot/default_configs/vBot_4.8/vBot/analyzer.otui b/mods/game_bot/default_configs/vBot_4.8/vBot/analyzer.otui index 261a6a7e3e..8bce8c067c 100644 --- a/mods/game_bot/default_configs/vBot_4.8/vBot/analyzer.otui +++ b/mods/game_bot/default_configs/vBot_4.8/vBot/analyzer.otui @@ -176,7 +176,7 @@ AnalyzerPriceLabel < Label Button id: remove - !text: tr('x') + !text: 'x' anchors.right: parent.right margin-right: 15 width: 15 @@ -500,7 +500,7 @@ FeaturesWindow < MainWindow Button id: closeButton - !text: tr('Close') + !text: localize('UIButtonClose') font: cipsoftFont anchors.right: parent.right anchors.bottom: parent.bottom diff --git a/mods/game_bot/default_configs/vBot_4.8/vBot/combo.lua b/mods/game_bot/default_configs/vBot_4.8/vBot/combo.lua index d3fc3d8789..0fb3218ca8 100644 --- a/mods/game_bot/default_configs/vBot_4.8/vBot/combo.lua +++ b/mods/game_bot/default_configs/vBot_4.8/vBot/combo.lua @@ -10,7 +10,7 @@ Panel anchors.left: parent.left text-align: center width: 130 - !text: tr('ComboBot') + !text: localize('BotButtonComboBot') Button id: combos diff --git a/mods/game_bot/default_configs/vBot_4.8/vBot/combo.otui b/mods/game_bot/default_configs/vBot_4.8/vBot/combo.otui index fcf21f38b9..d1b7a649d1 100644 --- a/mods/game_bot/default_configs/vBot_4.8/vBot/combo.otui +++ b/mods/game_bot/default_configs/vBot_4.8/vBot/combo.otui @@ -315,7 +315,7 @@ BotServer < Panel text: Triggers ComboWindow < MainWindow - !text: tr('Combo Options') + !text: localize('BotWindowTitleComboOptions') size: 500 280 @onEscape: self:hide() @@ -372,7 +372,7 @@ ComboWindow < MainWindow Button id: closeButton - !text: tr('Close') + !text: localize('UIButtonClose') font: cipsoftFont anchors.right: parent.right anchors.bottom: parent.bottom @@ -382,7 +382,7 @@ ComboWindow < MainWindow Button id: toolsButton - !text: tr('Help') + !text: localize('UIButtonHelp') font: cipsoftFont anchors.right: closeButton.left anchors.top: closeButton.top diff --git a/mods/game_bot/default_configs/vBot_4.8/vBot/depositer_config.otui b/mods/game_bot/default_configs/vBot_4.8/vBot/depositer_config.otui index 31eaf43205..cba50081b2 100644 --- a/mods/game_bot/default_configs/vBot_4.8/vBot/depositer_config.otui +++ b/mods/game_bot/default_configs/vBot_4.8/vBot/depositer_config.otui @@ -34,7 +34,7 @@ StashItem < Panel DepositerPanel < MainWindow size: 230 380 - !text: tr('Depositer Panel') + !text: localize('BotWindowTitleDepositer') @onEscape: self:hide() UIWidget @@ -90,7 +90,7 @@ DepositerPanel < MainWindow Button id: CloseButton - !text: tr('Close') + !text: localize('UIButtonClose') font: cipsoftFont anchors.right: parent.right anchors.bottom: parent.bottom diff --git a/mods/game_bot/default_configs/vBot_4.8/vBot/equipper.otui b/mods/game_bot/default_configs/vBot_4.8/vBot/equipper.otui index fa031e6ff9..40355d893e 100644 --- a/mods/game_bot/default_configs/vBot_4.8/vBot/equipper.otui +++ b/mods/game_bot/default_configs/vBot_4.8/vBot/equipper.otui @@ -19,7 +19,7 @@ BossLabel < UIWidget Button id: remove - !text: tr('X') + !text: 'X' anchors.right: parent.right anchors.verticalCenter: parent.verticalCenter width: 14 @@ -164,7 +164,7 @@ ListPanel < FlatPanel anchors.top: parent.top margin-top: 10 margin-left: 2 - !text: tr('More important methods come first.') + !text: localize('BotEquipperMethodOrder') text-align: left font: verdana-11px-rounded color: #aeaeae @@ -521,7 +521,7 @@ EquipWindow < MainWindow Button id: closeButton - !text: tr('Close') + !text: localize('UIButtonClose') font: cipsoftFont anchors.right: parent.right anchors.bottom: parent.bottom @@ -529,7 +529,7 @@ EquipWindow < MainWindow Button id: bossList - !text: tr('Boss list') + !text: localize('BotEquipperBossList') font: cipsoftFont anchors.left: parent.left anchors.bottom: parent.bottom diff --git a/mods/game_bot/default_configs/vBot_4.8/vBot/extras.otui b/mods/game_bot/default_configs/vBot_4.8/vBot/extras.otui index d34e9ab546..9ef4507799 100644 --- a/mods/game_bot/default_configs/vBot_4.8/vBot/extras.otui +++ b/mods/game_bot/default_configs/vBot_4.8/vBot/extras.otui @@ -63,7 +63,7 @@ ExtrasCheckBox < BotSwitch margin-top: 7 ExtrasWindow < MainWindow - !text: tr('Extras') + !text: localize('BotWindowTitleExtras') size: 440 360 padding: 25 @@ -150,7 +150,7 @@ ExtrasWindow < MainWindow Button id: closeButton - !text: tr('Close') + !text: localize('UIButtonClose') font: cipsoftFont anchors.right: parent.right anchors.bottom: parent.bottom diff --git a/mods/game_bot/default_configs/vBot_4.8/vBot/new_healer.lua b/mods/game_bot/default_configs/vBot_4.8/vBot/new_healer.lua index ecd225f09b..65fc260802 100644 --- a/mods/game_bot/default_configs/vBot_4.8/vBot/new_healer.lua +++ b/mods/game_bot/default_configs/vBot_4.8/vBot/new_healer.lua @@ -10,7 +10,7 @@ Panel anchors.left: parent.left text-align: center width: 130 - !text: tr('Friend Healer') + !text: localize('BotFriendHealer') Button id: edit diff --git a/mods/game_bot/default_configs/vBot_4.8/vBot/new_healer.otui b/mods/game_bot/default_configs/vBot_4.8/vBot/new_healer.otui index b740d76e09..6204ddba72 100644 --- a/mods/game_bot/default_configs/vBot_4.8/vBot/new_healer.otui +++ b/mods/game_bot/default_configs/vBot_4.8/vBot/new_healer.otui @@ -369,7 +369,7 @@ Conditions < Panel num-columns: 2 FriendHealer < MainWindow - !text: tr('Friend Healer') + !text: localize('BotFriendHealer') size: 512 390 padding-top: 30 @onEscape: self:hide() @@ -405,7 +405,7 @@ FriendHealer < MainWindow Button id: closeButton - !text: tr('Close') + !text: localize('UIButtonClose') font: cipsoftFont anchors.right: parent.right anchors.bottom: parent.bottom diff --git a/mods/game_bot/default_configs/vBot_4.8/vBot/playerlist.otui b/mods/game_bot/default_configs/vBot_4.8/vBot/playerlist.otui index b5fb0b678c..aa05312c02 100644 --- a/mods/game_bot/default_configs/vBot_4.8/vBot/playerlist.otui +++ b/mods/game_bot/default_configs/vBot_4.8/vBot/playerlist.otui @@ -11,7 +11,7 @@ PlayerLabel < UIWidget Button id: remove - !text: tr('X') + !text: 'X' anchors.right: parent.right anchors.verticalCenter: parent.verticalCenter width: 14 @@ -97,7 +97,7 @@ tPanel < Panel font: verdana-11px-rounded PlayerListWindow < MainWindow - !text: tr('Player List') + !text: localize('BotPlayerList') size: 405 356 @onEscape: self:hide() @@ -141,7 +141,7 @@ PlayerListWindow < MainWindow Button id: closeButton - !text: tr('Close') + !text: localize('UIButtonClose') font: cipsoftFont anchors.right: parent.right anchors.bottom: parent.bottom diff --git a/mods/game_bot/default_configs/vBot_4.8/vBot/pushmax.lua b/mods/game_bot/default_configs/vBot_4.8/vBot/pushmax.lua index 2e269fac11..2abf29eeb6 100644 --- a/mods/game_bot/default_configs/vBot_4.8/vBot/pushmax.lua +++ b/mods/game_bot/default_configs/vBot_4.8/vBot/pushmax.lua @@ -12,7 +12,7 @@ Panel anchors.left: parent.left text-align: center width: 130 - !text: tr('PUSHMAX') + !text: localize('BotPushMaxButton') Button id: push diff --git a/mods/game_bot/default_configs/vBot_4.8/vBot/pushmax.otui b/mods/game_bot/default_configs/vBot_4.8/vBot/pushmax.otui index 097d714a68..bca193df3e 100644 --- a/mods/game_bot/default_configs/vBot_4.8/vBot/pushmax.otui +++ b/mods/game_bot/default_configs/vBot_4.8/vBot/pushmax.otui @@ -1,5 +1,5 @@ PushMaxWindow < MainWindow - !text: tr('Pushmax Settings') + !text: localize('BotPushMaxSettings') size: 200 240 @onEscape: self:hide() @@ -76,7 +76,7 @@ PushMaxWindow < MainWindow Button id: closeButton - !text: tr('Close') + !text: localize('UIButtonClose') font: cipsoftFont anchors.right: parent.right anchors.bottom: parent.bottom diff --git a/mods/game_bot/default_configs/vBot_4.8/vBot/siolist.otui b/mods/game_bot/default_configs/vBot_4.8/vBot/siolist.otui index 303eb03752..97f68d31ca 100644 --- a/mods/game_bot/default_configs/vBot_4.8/vBot/siolist.otui +++ b/mods/game_bot/default_configs/vBot_4.8/vBot/siolist.otui @@ -40,7 +40,7 @@ VocationPanel < Panel text: Paladins SioListWindow < MainWindow - !text: tr('Healer Options') + !text: localize('BotHealerOptions') size: 220 360 @onEscape: self:hide() @@ -181,7 +181,7 @@ SioListWindow < MainWindow Button id: closeButton - !text: tr('Close') + !text: localize('UIButtonClose') font: cipsoftFont anchors.right: parent.right anchors.bottom: parent.bottom diff --git a/mods/game_bot/default_configs/vBot_4.8/vBot/supplies.otui b/mods/game_bot/default_configs/vBot_4.8/vBot/supplies.otui index e048956577..024d0b6db9 100644 --- a/mods/game_bot/default_configs/vBot_4.8/vBot/supplies.otui +++ b/mods/game_bot/default_configs/vBot_4.8/vBot/supplies.otui @@ -11,7 +11,7 @@ ProfileLabel < UIWidget Button id: remove - !text: tr('X') + !text: 'X' anchors.right: parent.right anchors.verticalCenter: parent.verticalCenter width: 14 @@ -83,7 +83,7 @@ ItemPanel < Panel !tooltip: ("This is average consumption of supplies by round to help calculate the amount to purchase\n (info provided by CaveBot Stats)") SuppliesWindow < MainWindow - !text: tr('Supplies') + !text: localize('BotSupplies') size: 430 330 @onEscape: self:hide() @@ -217,7 +217,7 @@ SuppliesWindow < MainWindow Button id: closeButton - !text: tr('Close') + !text: localize('UIButtonClose') font: cipsoftFont anchors.right: parent.right anchors.bottom: parent.bottom diff --git a/mods/game_bot/edit.otui b/mods/game_bot/edit.otui index f39ee8cc09..bcd05f9489 100644 --- a/mods/game_bot/edit.otui +++ b/mods/game_bot/edit.otui @@ -1,6 +1,6 @@ MainWindow id: editWindow - !text: tr("Config editor & manager") + !text: localize('BotMainWindowTitle') @onEscape: self:hide() size: 550 570 $mobile: @@ -20,7 +20,7 @@ MainWindow text-auto-resize: true text-align: center text-wrap: true - !text: tr("Config Manager\nYou can use config manager to share configs between different machines, especially smartphones. After you configure your config, you can upload it, then you'll get unique hash code which you can use on diffent machinge (for eg. mobile phone) to download it.") + !text: localize('BotMainWindowText') HorizontalSeparator anchors.top: prev.bottom @@ -44,7 +44,7 @@ MainWindow text-auto-resize: true text-align: center text-wrap: true - !text: tr("Upload config") + !text: localize('BotMainWindowConfigUploadLabel') Label anchors.top: prev.bottom @@ -54,7 +54,7 @@ MainWindow text-auto-resize: true text-align: center text-wrap: true - !text: tr("Select config to upload") + !text: localize('BotMainWindowConfigUploadSelector') ComboBox id: config @@ -71,7 +71,7 @@ MainWindow anchors.top: prev.bottom anchors.left: parent.left anchors.right: parent.right - !text: tr('Upload config') + !text: localize('BotMainWindowConfigUploadButton') margin-top: 4 margin-left: 40 margin-right: 40 @@ -91,7 +91,7 @@ MainWindow text-auto-resize: true text-align: center text-wrap: true - !text: tr("Download config") + !text: localize('BotMainWindowConfigDownloadLabel') Label anchors.top: prev.bottom @@ -101,7 +101,7 @@ MainWindow text-auto-resize: true text-align: center text-wrap: true - !text: tr("Enter config hash code") + !text: localize('BotMainWindowConfigDownloadHashField') TextEdit id: config @@ -117,7 +117,7 @@ MainWindow anchors.top: prev.bottom anchors.left: parent.left anchors.right: parent.right - !text: tr('Download config') + !text: localize('BotMainWindowConfigDownloadButton') margin-top: 4 margin-left: 40 margin-right: 40 @@ -146,7 +146,7 @@ MainWindow text-auto-resize: true text-align: center text-wrap: true - !text: tr("Bot configs are stored in:") + !text: localize('BotMainWindowInfoConfig') .. ":" TextEdit anchors.horizontalCenter: parent.horizontalCenter @@ -160,7 +160,7 @@ MainWindow Button id: documentationButton - !text: tr('Click here to open bot directory') + !text: localize('BotMainWindowOpenBotFolder') anchors.horizontalCenter: parent.horizontalCenter anchors.top: prev.bottom margin-top: 5 @@ -175,7 +175,7 @@ MainWindow text-auto-resize: true text-align: center text-wrap: true - !text: tr("Every directory in bot directory is treated as different config.\nTo create new config just create new directory.") + !text: localize('BotMainWindowInfoDirectory') Label margin-top: 5 @@ -194,7 +194,7 @@ MainWindow text-auto-resize: true text-align: center text-wrap: true - !text: tr("Inside config directory put .lua and .otui files.\nEvery file will be loaded and executed in alphabetical order, .otui first and then .lua.") + !text: localize('BotMainWindowInfoLoadingOrder') Label margin-top: 3 @@ -204,17 +204,17 @@ MainWindow text-auto-resize: true text-align: center text-wrap: true - !text: tr("To reload configs just press On and Off in bot window.\nTo learn more about bot click Tutorials button.") + !text: localize('BotMainWindowInfoReload') Button - !text: tr('Documentation') + !text: localize('BotMainWindowDocumentation') anchors.bottom: parent.bottom anchors.left: parent.left width: 118 @onClick: g_platform.openUrl("http://otclient.ovh/bot.php?documentation") Button - !text: tr('Tutorials') + !text: localize('BotMainWindowTutorials') anchors.bottom: parent.bottom anchors.left: prev.right margin-left: 5 @@ -222,7 +222,7 @@ MainWindow @onClick: g_platform.openUrl("http://otclient.ovh/bot.php?tutorials") Button - !text: tr('Scripts') + !text: localize('BotMainWindowScripts') anchors.bottom: parent.bottom anchors.left: prev.right margin-left: 5 @@ -230,7 +230,7 @@ MainWindow @onClick: g_platform.openUrl("http://otclient.ovh/bot.php?scripts") Button - !text: tr('Forum') + !text: localize('BotMainWindowForum') anchors.bottom: parent.bottom anchors.left: prev.right margin-left: 5 @@ -238,7 +238,7 @@ MainWindow @onClick: g_platform.openUrl("http://otclient.ovh/bot.php?forum") Button - !text: tr('Discord') + !text: localize('BotMainWindowDiscord') anchors.bottom: parent.bottom anchors.left: prev.right margin-left: 5 @@ -247,7 +247,7 @@ MainWindow Button id: cancelButton - !text: tr('Close') + !text: localize('UIButtonClose') anchors.bottom: parent.bottom anchors.right: parent.right width: 60 diff --git a/mods/game_bot/functions/ui_windows.lua b/mods/game_bot/functions/ui_windows.lua index 75c1bf1bf5..c6f0e8ae20 100644 --- a/mods/game_bot/functions/ui_windows.lua +++ b/mods/game_bot/functions/ui_windows.lua @@ -41,8 +41,8 @@ UI.ConfirmationWindow = function(title, question, callback) window:destroy() end window = context.displayGeneralBox(title, question, { - { text=tr('Yes'), callback=onConfirm }, - { text=tr('No'), callback=closeWindow }, + { text=localize('UIButtonYes'), callback=onConfirm }, + { text=localize('UIButtonNo'), callback=closeWindow }, anchor=AnchorHorizontalCenter}, onConfirm, closeWindow) window.botWidget = true return window diff --git a/mods/game_bot/panels/attacking.lua b/mods/game_bot/panels/attacking.lua index 8de2a3a2ef..02681ea6d3 100644 --- a/mods/game_bot/panels/attacking.lua +++ b/mods/game_bot/panels/attacking.lua @@ -11,7 +11,7 @@ Panels.MonsterEditor = function(monster, config, callback, parent) MainWindow id: monsterEditor size: 450 450 - !text: tr("Edit monster") + !text: localize('BotAttackingTitleEditMonster') Label id: info @@ -302,7 +302,7 @@ MainWindow Button id: okButton - !text: tr('Ok') + !text: localize('UIButtonOk') anchors.bottom: parent.bottom anchors.right: next.left margin-right: 10 @@ -310,7 +310,7 @@ MainWindow Button id: cancelButton - !text: tr('Cancel') + !text: localize('UIButtonCancel') anchors.bottom: parent.bottom anchors.right: parent.right width: 60 @@ -712,10 +712,12 @@ Panel context.storage.attacking.activeConfig = 0 refreshConfig() end - questionWindow = context.displayGeneralBox(tr('Remove config'), tr('Do you want to remove current attacking config?'), + questionWindow = context.displayGeneralBox( + localize('BotRemoveConfig'), + localize('BotAttackingMessageRemoveConfig'), { - { text = tr('Yes'), callback = removeConfig }, - { text = tr('No'), callback = closeWindow }, + { text = localize('UIButtonYes'), callback = removeConfig }, + { text = localize('UIButtonNo'), callback = closeWindow }, anchor = AnchorHorizontalCenter }, removeConfig, closeWindow) end diff --git a/mods/game_bot/panels/looting.lua b/mods/game_bot/panels/looting.lua index 036f9955e9..6943e096ff 100644 --- a/mods/game_bot/panels/looting.lua +++ b/mods/game_bot/panels/looting.lua @@ -212,10 +212,10 @@ Panel refreshConfig = function(focusIndex) ignoreOnOptionChange = true if context.storage.looting.enabled then - ui.enableButton:setText("On") + ui.enableButton:setText(localize('UIButtonOn')) ui.enableButton:setColor('#00AA00FF') else - ui.enableButton:setText("Off") + ui.enableButton:setText(localize('UIButtonOff')) ui.enableButton:setColor('#FF0000FF') end @@ -223,7 +223,7 @@ Panel for i, config in ipairs(context.storage.looting.configs) do local name = getConfigName(config) if not name then - name = "Unnamed config" + name = localize('BotUnnamedConfig') end ui.config:addOption(name) end @@ -266,7 +266,7 @@ Panel refreshConfig() end ui.add.onClick = function() - modules.client_textedit.multilineEditor("Looting editor", "name:Config name", function(newText) + modules.client_textedit.multilineEditor(localize('BotLootingEditorTitle'), "name:Config name", function(newText) table.insert(context.storage.looting.configs, newText) context.storage.looting.activeConfig = #context.storage.looting.configs refreshConfig() @@ -276,7 +276,7 @@ Panel if not context.storage.looting.activeConfig or not context.storage.looting.configs[context.storage.looting.activeConfig] then return end - modules.client_textedit.multilineEditor("Looting editor", context.storage.looting.configs[context.storage.looting.activeConfig], function(newText) + modules.client_textedit.multilineEditor(localize('BotLootingEditorTitle'), context.storage.looting.configs[context.storage.looting.activeConfig], function(newText) context.storage.looting.configs[context.storage.looting.activeConfig] = newText refreshConfig() end) @@ -299,9 +299,11 @@ Panel context.storage.looting.activeConfig = 0 refreshConfig() end - questionWindow = context.displayGeneralBox(tr('Remove config'), tr('Do you want to remove current looting config?'), { - { text=tr('Yes'), callback=removeConfig }, - { text=tr('No'), callback=closeWindow }, + questionWindow = context.displayGeneralBox( + localize('BotRemoveConfig'), + localize('BotLootingEditorMessageRemoveConfig'), { + { text=localize('UIButtonYes'), callback=removeConfig }, + { text=localize('UIButtonNo'), callback=closeWindow }, anchor=AnchorHorizontalCenter}, removeConfig, closeWindow) end refreshConfig() diff --git a/mods/game_bot/panels/waypoints.lua b/mods/game_bot/panels/waypoints.lua index 3f9412ffb4..45a43afe58 100644 --- a/mods/game_bot/panels/waypoints.lua +++ b/mods/game_bot/panels/waypoints.lua @@ -252,10 +252,10 @@ Panel if context.storage.cavebot.enabled then autoRecording = false ui.recording:setOn(false) - ui.enableButton:setText("On") + ui.enableButton:setText(localize('UIButtonOn')) ui.enableButton:setColor('#00AA00FF') else - ui.enableButton:setText("Off") + ui.enableButton:setText(localize('UIButtonOff')) ui.enableButton:setColor('#FF0000FF') ui.recording:setOn(autoRecording) end @@ -264,7 +264,7 @@ Panel for i, config in ipairs(context.storage.cavebot.configs) do local name = getConfigName(config) if not name then - name = "Unnamed config" + name = localize('BotUnnamedConfig') end ui.config:addOption(name) end @@ -303,15 +303,15 @@ Panel if autoRecording then refreshConfig() elseif context.storage.cavebot.enabled then - ui.enableButton:setText("On") + ui.enableButton:setText(localize('UIButtonOn')) ui.enableButton:setColor('#00AA00FF') else - ui.enableButton:setText("Off") + ui.enableButton:setText(localize('UIButtonOff')) ui.enableButton:setColor('#FF0000FF') end end ui.add.onClick = function() - modules.client_textedit.multilineEditor("Waypoints editor", "name:Config name\nlabel:start\n", function(newText) + modules.client_textedit.multilineEditor(localize('WaypointsEditorTitle'), "name:Config name\nlabel:start\n", function(newText) table.insert(context.storage.cavebot.configs, newText) context.storage.cavebot.activeConfig = #context.storage.cavebot.configs refreshConfig() @@ -321,7 +321,7 @@ Panel if not context.storage.cavebot.activeConfig or not context.storage.cavebot.configs[context.storage.cavebot.activeConfig] then return end - modules.client_textedit.multilineEditor("Waypoints editor", + modules.client_textedit.multilineEditor(localize('WaypointsEditorTitle'), context.storage.cavebot.configs[context.storage.cavebot.activeConfig], function(newText) context.storage.cavebot.configs[context.storage.cavebot.activeConfig] = newText refreshConfig() @@ -345,10 +345,12 @@ Panel context.storage.cavebot.activeConfig = 0 refreshConfig() end - questionWindow = context.displayGeneralBox(tr('Remove config'), tr('Do you want to remove current waypoints config?'), + questionWindow = context.displayGeneralBox( + localize('BotRemoveConfig'), + localize('WaypointsEditorMessageRemoveConfig'), { - { text = tr('Yes'), callback = removeConfig }, - { text = tr('No'), callback = closeWindow }, + { text = localize('UIButtonYes'), callback = removeConfig }, + { text = localize('UIButtonNo'), callback = closeWindow }, anchor = AnchorHorizontalCenter }, removeConfig, closeWindow) end @@ -528,7 +530,7 @@ Panel if not context.storage.cavebot.activeConfig or not context.storage.cavebot.configs[context.storage.cavebot.activeConfig] then return end - modules.client_textedit.multilineEditor("Add function", + modules.client_textedit.multilineEditor(localize('WaypointsEditorTitleAddFunction'), "function(waypoints)\n -- your lua code, function is executed if previous goto was successful or is just after label\n\n -- must return true to execute next command, otherwise will run in loop till correct return\n return true\nend", function(newText) context.storage.cavebot.configs[context.storage.cavebot.activeConfig] = context.storage.cavebot.configs @@ -694,7 +696,7 @@ Panel executeNextMacroCall = true end else - context.error("Waypoints: invalid use of goto function") + context.error(localize('WaypointsEditorErrorInvalidGoto')) end elseif command.command == "use" then local matches = regexMatch(command.text, [[([0-9]+)[^0-9]+([0-9]+)[^0-9]+([0-9]+)]]) @@ -711,7 +713,7 @@ Panel end end else - context.error("Waypoints: invalid use of use function") + context.error(localize('WaypointsEditorErrorInvalidUse')) end elseif command.command == "usewith" then local matches = regexMatch(command.text, [[([0-9]+)[^0-9]+([0-9]+)[^0-9]+([0-9]+)[^0-9]+([0-9]+)]]) @@ -729,7 +731,7 @@ Panel end end else - context.error("Waypoints: invalid use of usewith function") + context.error(localize('WaypointsEditorErrorInvalidUseWith')) end elseif command.command == "wait" and lastGotoSuccesful then if not waitTo or waitTo == 0 then @@ -755,7 +757,7 @@ Panel end end) if not status then - context.error("Waypoints function execution error:\n" .. result) + context.error(localize('WaypointsEditorErrorExecution') .. ":\n" .. result) context.delay(2500) end if not result or usedGotoLabel then diff --git a/mods/game_buttons/buttons.otui b/mods/game_buttons/buttons.otui index bee29fe4ab..1018f2cf3d 100644 --- a/mods/game_buttons/buttons.otui +++ b/mods/game_buttons/buttons.otui @@ -1,5 +1,5 @@ GameButtonsWindow id: buttons &save: true - !text: tr("Buttons") + !text: localize('ButtonsWindowTitle') icon: /images/topbuttons/buttons diff --git a/mods/game_itemselector/itemselector.otui b/mods/game_itemselector/itemselector.otui index b7c6aec462..5bcc941fb6 100644 --- a/mods/game_itemselector/itemselector.otui +++ b/mods/game_itemselector/itemselector.otui @@ -1,7 +1,7 @@ ItemSelectorWindow < MainWindow id: itemSelector size: 260 120 - !text: tr("Select item") + !text: localize('ItemSelectorWindowTitle') Item id: item @@ -28,7 +28,7 @@ ItemSelectorWindow < MainWindow anchors.left: prev.left anchors.right: prev.right text-align: center - !text: tr("Item ID") + !text: localize('ItemSelectorItemID') SpinBox id: itemCount @@ -47,18 +47,18 @@ ItemSelectorWindow < MainWindow anchors.left: prev.left anchors.right: prev.right text-align: center - !text: tr("Count / SubType") + !text: localize('ItemSelectorCountSubtype') Button id: clearButton - !text: tr('Clear') + !text: localize('UIButtonClear') anchors.bottom: parent.bottom anchors.left: parent.left width: 60 Button id: okButton - !text: tr('Ok') + !text: localize('UIButtonOk') anchors.bottom: parent.bottom anchors.right: next.left margin-right: 10 @@ -66,7 +66,7 @@ ItemSelectorWindow < MainWindow Button id: cancelButton - !text: tr('Cancel') + !text: localize('UIButtonCancel') anchors.bottom: parent.bottom anchors.right: parent.right width: 60 diff --git a/modules/client_locales/locale.lua b/modules/client_locales/locale.lua new file mode 100644 index 0000000000..cbc0ec7a22 --- /dev/null +++ b/modules/client_locales/locale.lua @@ -0,0 +1,115 @@ +-- class Locale +local Locale = setmetatable({ }, { + -- constructor redirection + -- Locale(...) + -- example: Locale("English", "en") + __call = function(locale, ...) + return locale.new(...) + end +}) + +-- allow lookup of static variables +Locale.__index = Locale + +-- constructor +-- Locale.new(languageName, languageCode) +function Locale.new(languageName, languageCode) + -- create the object + local self = setmetatable({}, Locale) + + -- set object properties + self._languageName = languageName + self._languageCode = languageCode + self._translations = {} + + -- push the newly created object + return self +end + +-- class fields +local fields = { + 'languageName', + 'languageCode', + 'charset', + 'formatNumbers', + 'decimalSeperator', + 'thousandsSeperator', + 'translations', + 'authors' +} + +-- create fields +-- get: locale:field() +-- set: locale:field(value) +-- example get: locale:charset() +-- example set: locale:charset("cp1252") +for _, key in ipairs(fields) do + local innerKey = string.format("_%s", key) + Locale[key] = function(self, value) + self[innerKey] = value + end +end + +-- get/set localized string +-- get: locale:translate(key) +-- set: locale:translate(key, value) +-- example get: locale:translate("UIButtonOk") +-- example set: locale:translate("UIButtonOk", "OK") +function Locale:translate(key, value) + -- get + if not value then + -- translation was found -> return translation + -- translation was not found -> return key + return self._translations[key] or key + end + + -- set + self._translations[key] = value +end + +-- remove localized string +-- locale:removeTranslation(key) +-- example: locale:removeTranslation("UIButtonOk") +function Locale:removeTranslation(key) + -- remove if key was found + if key then + self._translations[key] = nil + return true + end + + -- key was not found, push false + return false +end + +-- register locale +-- locale:register() +function Locale:register() + -- fetch the language code + local langCode = self:languageCode() + + -- if "allowedLocales" table is defined, + -- the locales that are not present in it won't be created + if _G.allowedLocales and not _G.allowedLocales[langCode] then + return false + end + + -- check if the locale was already installed + local installedLocale = installedLocales[langCode] + + -- first load scenario + if not installedLocale then + installedLocales[locale.name] = locale + return true + end + + -- reload scenario + for word, translation in pairs(locale:translations()) do + installedLocale.translations[word] = translation + end + + -- push the function result + return true +end + +-- push Locale class to the global namespace +_G.Locale = Locale diff --git a/modules/client_locales/locales.lua b/modules/client_locales/locales.lua index 29c2b1ad0d..417a0f2e79 100644 --- a/modules/client_locales/locales.lua +++ b/modules/client_locales/locales.lua @@ -1,5 +1,24 @@ dofile 'neededtranslations' + + + + + + + + + + + + + + + + + + + -- private variables local defaultLocaleName = 'en' local installedLocales @@ -201,7 +220,8 @@ function getCurrentLocale() end -- global function used to translate texts -function _G.tr(text, ...) +-- TO DO: gsub: %1, %2, %3 as arguments +function _G.localize(text, ...) if currentLocale then if tonumber(text) and currentLocale.formatNumbers then local number = tostring(text):split('.') @@ -233,3 +253,5 @@ function _G.tr(text, ...) end return text end + +_G.tr = _G.localize \ No newline at end of file From 977a2f8aee8af06234ba08ed8bbcf368d302b47b Mon Sep 17 00:00:00 2001 From: Zbizu Date: Sun, 26 Jan 2025 18:11:31 +0100 Subject: [PATCH 2/8] more translations --- data/locales/en.lua | 179 +++++++++++++++++- modules/client_bottommenu/bottommenu.lua | 8 +- modules/client_bottommenu/calendar.otui | 2 +- modules/game_textwindow/textwindow.lua | 18 +- modules/game_textwindow/textwindow.otui | 4 +- modules/game_things/things.lua | 14 +- .../unjustifiedpoints.lua | 2 +- .../unjustifiedpoints.otui | 8 +- modules/game_viplist/addgroup.otui | 6 +- modules/game_viplist/addvip.otui | 8 +- modules/game_viplist/editvip.otui | 16 +- modules/game_viplist/viplist.lua | 79 ++++---- modules/game_viplist/viplist.otui | 4 +- modules/modulelib/ext/parse.lua | 4 +- modules/updater/updater.lua | 12 +- modules/updater/updater.otui | 8 +- 16 files changed, 274 insertions(+), 98 deletions(-) diff --git a/data/locales/en.lua b/data/locales/en.lua index fabf80d8ab..fff73a27a3 100644 --- a/data/locales/en.lua +++ b/data/locales/en.lua @@ -39,6 +39,10 @@ locale:thousandsSeperator(',') -- action: SetMark -- full string: MinimapWindowTitleSetMark +-- inserting arguments into translation strings: +-- %0 does not do anything +-- %1-%9 - arguments provided with the localize function + -- UI: common buttons locale:translate("UIButtonOk", "OK") locale:translate("UIButtonCancel", "Cancel") @@ -57,6 +61,109 @@ locale:translate("UIButtonClear", "Clear") locale:translate("FormFieldDescription", "Description") locale:translate("FormFieldPosition", "Position") +-- UI: common dialog options +locale:translate("ContextMenuCopyName", "Copy Name") + +-- UI: system messages +locale:translate("Warning", "Warning") +locale:translate("Error", "Error") + +-- date / time +-- for future +--[[ +locale:translate("ClockAM", "AM") +locale:translate("ClockPM", "PM") +]] + +-- weekday +locale:translate("Sunday", "Sunday") +locale:translate("Monday", "Monday") +locale:translate("Tuesday", "Tuesday") +locale:translate("Wednesday", "Wednesday") +locale:translate("Thursday", "Thursday") +locale:translate("Friday", "Friday") +locale:translate("Saturday", "Saturday") + +-- month +locale:translate("January", "January") +locale:translate("February", "February") +locale:translate("March", "March") +locale:translate("April", "April") +locale:translate("May", "May") +locale:translate("June", "June") +locale:translate("July", "July") +locale:translate("August", "August") +locale:translate("September", "September") +locale:translate("October", "October") +locale:translate("November", "November") +locale:translate("December", "December") + +--[[ +-- for future +-- month alternative +-- (this is for grammatical purposes in other languages) +locale:translate("AltJanuary", "of January") +locale:translate("AltFebruary", "of February") +locale:translate("AltMarch", "of March") +locale:translate("AltApril", "of April") +locale:translate("AltMay", "of May") +locale:translate("AltJune", "of June") +locale:translate("AltJuly", "of July") +locale:translate("AltAugust", "of August") +locale:translate("AltSeptember", "of September") +locale:translate("AltOctober", "of October") +locale:translate("AltNovember", "of November") +locale:translate("AltDecember", "of December") + +-- month name short +locale:translate("ShortJanuary", "Jan") +locale:translate("ShortFebruary", "Feb") +locale:translate("ShortMarch", "Mar") +locale:translate("ShortApril", "Apr") +locale:translate("ShortMay", "May") +locale:translate("ShortJune", "Jun") +locale:translate("ShortJuly", "Jul") +locale:translate("ShortAugust", "Aug") +locale:translate("ShortSeptember", "Sep") +locale:translate("ShortOctober", "Oct") +locale:translate("ShortNovember", "Nov") +locale:translate("ShortDecember", "Dec") + +-- place suffixes (1st, 2nd, ..., nth) +-- (this is for grammatical purposes in other languages) +locale:translate("suffix_0", "th") +locale:translate("suffix_1", "st") +locale:translate("suffix_2", "nd") +locale:translate("suffix_3", "rd") +locale:translate("suffix_4", "th") +locale:translate("suffix_5", "th") +locale:translate("suffix_6", "th") +locale:translate("suffix_7", "th") +locale:translate("suffix_8", "th") +locale:translate("suffix_9", "th") +locale:translate("suffix_10", "th") +locale:translate("suffix_11", "th") +locale:translate("suffix_12", "th") +locale:translate("suffix_13", "th") +locale:translate("suffix_14", "th") +locale:translate("suffix_15", "th") +locale:translate("suffix_16", "th") +locale:translate("suffix_17", "th") +locale:translate("suffix_18", "th") +locale:translate("suffix_19", "th") +locale:translate("suffix_20", "th") +locale:translate("suffix_n1", "st") +locale:translate("suffix_n2", "nd") +locale:translate("suffix_n3", "rd") +locale:translate("suffix_n4", "th") +locale:translate("suffix_n5", "th") +locale:translate("suffix_n6", "th") +locale:translate("suffix_n7", "th") +locale:translate("suffix_n8", "th") +locale:translate("suffix_n9", "th") +locale:translate("suffix_n0", "th") +]] + -- UI: window titles misc locale:translate("WindowTitleTextEdit", "Edit text") @@ -72,6 +179,76 @@ locale:translate("ItemSelectorWindowTitle", "Select Item") locale:translate("MinimapWindowTitleSetMark", "Create Map Mark") locale:translate("MinimapButtonCenter", "Center") +-- text window (books and house list) +locale:translate("TextWindowDescriptionWriter", "You read the following, written by \n%1\n") +locale:translate("TextWindowDescriptionTime", "You read the following, written on \n%1.\n") +locale:transalte("TextWindowWrittenAt", "on %1.\n") +locale:translate("TextWindowEmpty", "It is empty.") +locale:translate("TextWindowWriteable", "You can enter new text.") +locale:translate("TextWindowShowText", "Show Text") +locale:translate("TextWindowEditText", "Edit Text") +locale:translate("TextWindowOneNamePerLine", "Enter one name per line.") +locale:translate("TextWindowDescriptionHouseList", "Edit List") + +-- things +locale:translate("ThingsAssetLoadingFailed", "Couldn't load assets") +locale:translate("ThingsStaticDataLoadingFailed", "Couldn't load staticdata") +locale:translate("ThingsProtocolSpritesWarning", "Loading sprites instead of protobuf is unstable, use it at your own risk!") +locale:translate("ThingsDatLoadingFailed", "Unable to load dat file, please place a valid dat in '%1.dat'") +locale:translate("ThingsSprLoadingFailed", "Unable to load spr file, please place a valid spr in '%1.spr'") + +-- unjustified kills panel +locale:translate("UnjustifiedPanelTitle", "Unjustified Points") +locale:translate("UnjustifiedPanelOpenPvP", "Open PvP") +locale:translate("UnjustifiedPanelOpenPvPSituations", "Open PvP Situations") +locale:translate("UnjustifiedPanelSkullTime", "Skull Time") + +-- updater +locale:translate("UpdaterTitle", "Updater") +locale:translate("UpdaterChangeURL", "Change updater URL") +locale:translate("UpdaterCheckInProgress", "Checking for updates") +locale:translate("UpdaterMessageFileDownload", "Downloading:\n%1") +locale:translate("UpdaterMessageFileDownloadRetry", "Downloading (%1 retry):\n%2") +locale:translate("UpdaterError", "Updater Error") +locale:translate("UpdaterTimeout", "Timeout") +locale:translate("UpdaterMessagePending", "Updating client (may take few seconds)") +locale:translate("UpdaterMessageUpdatingFiles", "Updating %1 files") + +-- viplist +locale:translate("VipListNoGroup", "No Group") +locale:translate("VipListPanelTitle", "VIP List") +locale:translate("VipListDialogVipAdd", "Add new VIP") +locale:translate("VipListDialogVipEdit", "Edit VIP") +locale:translate("VipListDialogVipEditDescription", "Description") +locale:translate("VipListDialogShowOffline", "Show Offline") +locale:translate("VipListDialogHideOffline", "Hide Offline") +locale:translate("VipListDialogShowGroups", "Show Groups") +locale:translate("VipListDialogHideGroups", "Hide Groups") +locale:translate("VipListDialogPlayerEdit", "Edit %1") +locale:translate("VipListDialogPlayerRemove", "Remove %1") +locale:translate("VipListDialogPlayerOpenChat", "Message to %1") +locale:translate("VipListDialogGroupAdd", "Add new group") +locale:translate("VipListDialogGroupEdit", "Edit group %1") +locale:translate("VipListDialogGroupRemove", "Remove group %1") +locale:translate("VipListPrivateChatInvite", "Invite to private chat") +locale:translate("VipListPrivateChatExclude", "Exclude from private chat") +locale:translate("VipListMessagePlayerLoggedIn", "%1 has logged in.") +locale:translate("VipListMessagePlayerLoggedOut", "%1 has logged out.") +locale:translate("VipListSortName", "Sort by name") +locale:translate("VipListSortType", "Sort by type") +locale:translate("VipListSortStatus", "Sort by status") +locale:translate("VipListGroupLimitTitle", "Maximum of User-Created Groups Reached") +locale:translate("VipListGroupLimitMessage", "You have already reached the maximum of groups you can create yourself.") +locale:translate("VipListWindowTitleGroupEdit", "Edit VIP group") +locale:translate("VipListWindowFormGroupName", "Please enter a group name") +locale:translate("VipListWindowTitleVipAdd", "Add to VIP list") +locale:translate("VipListLabelMemberOfGroups", "Member of the following groups") +locale:translate("VipListLabelNotifyOnLogin", "Notify-Login") +locale:translate("VipListCheckboxNotifyOnLogin", "Notify on login") +locale:translate("VipListCheckboxEmpty", "Empty") +locale:translate("VipListLabelCharacterName", "Please enter a character name") +locale:translate("VipListLabelGroupName", "Please enter a group name") + -- bot: main window locale:translate("BotMainWindowTitle", "Config editor & manager") locale:translate( @@ -113,8 +290,6 @@ locale:translate("BotConfigUploadFailSize", "Config %1 is too big, maximum size locale:translate("BotConfigUploadFailCompression", "Config %1 is invalid (can't be compressed)") locale:translate("BotConfigUploadSuccessTitle", "Succesful config upload") locale:translate("BotConfigUploadSuccessText", "Config %1 has been uploaded.\n%2") - - locale:translate("BotConfigDownloadTitle", "Download Config") locale:translate("BotConfigDownloadText", "Downloading config with hash %1. Please wait.") locale:translate("BotConfigDownloadErrorTitle", "Config download error") diff --git a/modules/client_bottommenu/bottommenu.lua b/modules/client_bottommenu/bottommenu.lua index a44f710f77..1a74d5eec9 100644 --- a/modules/client_bottommenu/bottommenu.lua +++ b/modules/client_bottommenu/bottommenu.lua @@ -65,9 +65,9 @@ function init() math.randomseed(os.time()) local randomIndex = math.random(1, #default_info) local randomItem = default_info[randomIndex] - showOffWindow.title:setText(tr(randomItem.Title)) + showOffWindow.title:setText(randomItem.Title) image:setImageSource(randomItem.image) - description:setText(tr(randomItem.description)) + description:setText(randomItem.description) monsterOutfit:setVisible(false) bossOutfit:setVisible(false) widget:resize(widget:getWidth(), description:getHeight()) @@ -124,8 +124,8 @@ function setShowOffData(data) local description = widget:recursiveGetChildById('description') - showOffWindow.title:setText(tr(data.title)) - description:setText(tr(data.description)) + showOffWindow.title:setText(data.title) + description:setText(data.description) end -- @ Calendar/Events scheduler diff --git a/modules/client_bottommenu/calendar.otui b/modules/client_bottommenu/calendar.otui index ffc7b13687..af2d412fc8 100644 --- a/modules/client_bottommenu/calendar.otui +++ b/modules/client_bottommenu/calendar.otui @@ -81,7 +81,7 @@ CalendarGrid < MiniQtWindow id: calendarCurrentMonth anchors.horizontalCenter: parent.horizontalCenter anchors.top: parent.top - !text: tr('September 2023') + !text: 'September 2023' margin-top: 28 height: 16 text-align: center diff --git a/modules/game_textwindow/textwindow.lua b/modules/game_textwindow/textwindow.lua index 3bc41ca946..2598d3b804 100644 --- a/modules/game_textwindow/textwindow.lua +++ b/modules/game_textwindow/textwindow.lua @@ -51,18 +51,18 @@ function onGameEditText(id, itemId, maxLength, text, writer, time) local desc = '' if #writer > 0 then - desc = tr('You read the following, written by \n%s\n', writer) + desc = localize('TextWindowDescriptionWriter', writer) if #time > 0 then - desc = desc .. tr('on %s.\n', time) + desc = desc .. localize('TextWindowWrittenAt', time) end elseif #time > 0 then - desc = tr('You read the following, written on \n%s.\n', time) + desc = localize('TextWindowDescriptionTime', time) end if #text == 0 and not writeable then - desc = tr('It is empty.') + desc = localize('TextWindowEmpty') elseif writeable then - desc = desc .. tr('You can enter new text.') + desc = desc .. localize('TextWindowWriteable') end local lines = #{string.find(desc, '\n')} @@ -73,12 +73,12 @@ function onGameEditText(id, itemId, maxLength, text, writer, time) description:setText(desc) if not writeable then - textWindow:setText(tr('Show Text')) + textWindow:setText(localize('TextWindowShowText')) cancelButton:hide() cancelButton:setWidth(0) okButton:setMarginRight(0) else - textWindow:setText(tr('Edit Text')) + textWindow:setText(localize('TextWindowEditText')) textEdit:focus() textEdit:setCursorPos(#text) end @@ -129,8 +129,8 @@ function onGameEditList(id, doorId, text) textEdit:setEditable(true) textEdit:focus() textEdit:setCursorPos(#text) - description:setText(tr('Enter one name per line.')) - textWindow:setText(tr('Edit List')) + description:setText(localize('TextWindowOneNamePerLine')) + textWindow:setText(localize('TextWindowDescriptionHouseList')) if description:getHeight() < 64 then description:setHeight(64) diff --git a/modules/game_textwindow/textwindow.otui b/modules/game_textwindow/textwindow.otui index d8037372bf..646e3885aa 100644 --- a/modules/game_textwindow/textwindow.otui +++ b/modules/game_textwindow/textwindow.otui @@ -39,7 +39,7 @@ TextWindow < MainWindow Button id: okButton - !text: tr('Ok') + !text: localize('UIButtonOk') anchors.bottom: parent.bottom anchors.right: next.left margin-right: 10 @@ -47,7 +47,7 @@ TextWindow < MainWindow Button id: cancelButton - !text: tr('Cancel') + !text: localize('UIButtonCancel') anchors.bottom: parent.bottom anchors.right: parent.right width: 60 diff --git a/modules/game_things/things.lua b/modules/game_things/things.lua index 35c1bd2973..71afbe2785 100644 --- a/modules/game_things/things.lua +++ b/modules/game_things/things.lua @@ -27,15 +27,15 @@ function load(version) if version >= 1281 and not g_game.getFeature(GameLoadSprInsteadProtobuf) then local filePath = resolvepath(string.format('/things/%d/', version)) if not g_things.loadAppearances(filePath) then - errorList[#errorList + 1] = "Couldn't load assets" + errorList[#errorList + 1] = localize('ThingsAssetLoadingFailed') end if not g_things.loadStaticData(filePath) then - errorList[#errorList + 1] = "Couldn't load staticdata" + errorList[#errorList + 1] = localize('ThingsStaticDataLoadingFailed') end else if g_game.getFeature(GameLoadSprInsteadProtobuf) then - local warningBox = displayErrorBox(tr('Warning'), - 'Load spr instead protobuf it\'s unstable, use by yours risk!') + local warningBox = displayErrorBox(localize('Warning'), + localize('ThingsProtocolSpritesWarning')) addEvent(function() warningBox:raise() warningBox:focus() @@ -51,17 +51,17 @@ function load(version) end if not g_things.loadDat(datPath) then - errorList[#errorList + 1] = tr('Unable to load dat file, please place a valid dat in \'%s.dat\'', datPath) + errorList[#errorList + 1] = localize('ThingsDatLoadingFailed', datPath) end if not g_sprites.loadSpr(sprPath) then - errorList[#errorList + 1] = tr('Unable to load spr file, please place a valid spr in \'%s.spr\'', sprPath) + errorList[#errorList + 1] = localize('ThingsSprLoadingFailed', sprPath) end end loaded = #errorList == 0 if not loaded then - local messageBox = displayErrorBox(tr('Error'), table.concat(errorList, "\n")) + local messageBox = displayErrorBox(localize('Error'), table.concat(errorList, "\n")) addEvent(function() messageBox:raise() messageBox:focus() diff --git a/modules/game_unjustifiedpoints/unjustifiedpoints.lua b/modules/game_unjustifiedpoints/unjustifiedpoints.lua index b0db503e35..446d121b2b 100644 --- a/modules/game_unjustifiedpoints/unjustifiedpoints.lua +++ b/modules/game_unjustifiedpoints/unjustifiedpoints.lua @@ -26,7 +26,7 @@ function init() }) unjustifiedPointsButton = modules.game_mainpanel.addToggleButton('unjustifiedPointsButton', - tr('Unjustified Points'), + localize('UnjustifiedPanelTitle'), '/images/options/button_frags', toggle) unjustifiedPointsButton:setOn(true) diff --git a/modules/game_unjustifiedpoints/unjustifiedpoints.otui b/modules/game_unjustifiedpoints/unjustifiedpoints.otui index 46f688eb04..288e9eff10 100644 --- a/modules/game_unjustifiedpoints/unjustifiedpoints.otui +++ b/modules/game_unjustifiedpoints/unjustifiedpoints.otui @@ -13,7 +13,7 @@ SkullWidget < UIWidget MiniWindow id: unjustifiedPointsWindow - !text: tr('Unjustified Points') + !text: localize('UnjustifiedPanelTitle') height: 114 icon: /images/topbuttons/unjustifiedpoints @onOpen: modules.game_unjustifiedpoints.onMiniWindowOpen() @@ -24,8 +24,8 @@ MiniWindow Label anchors.top: parent.top anchors.left: parent.left - !text: tr('Open PvP') - !tooltip: tr('Open PvP Situations') + !text: localize('UnjustifiedPanelOpenPvP') + !tooltip: localize('UnjustifiedPanelOpenPvPSituations') phantom: false margin-top: 2 margin-left: 10 @@ -41,7 +41,7 @@ MiniWindow Label anchors.top: parent.top anchors.right: parent.right - !text: tr('Skull Time') + !text: localize('UnjustifiedPanelSkullTime') margin-top: 2 margin-right: 10 diff --git a/modules/game_viplist/addgroup.otui b/modules/game_viplist/addgroup.otui index eeeb159771..a23b897f9a 100644 --- a/modules/game_viplist/addgroup.otui +++ b/modules/game_viplist/addgroup.otui @@ -9,7 +9,7 @@ MainWindow Label id: header - !text: tr('Please enter a group name:') + !text: localize('VipListLabelGroupName') .. ":" anchors.top: parent.top anchors.left: parent.left anchors.right: parent.right @@ -35,7 +35,7 @@ MainWindow Button id: okButton - !text: tr('Ok') + !text: localize('UIButtonOk') anchors.right: next.left anchors.bottom: parent.bottom margin-right: 11 @@ -43,7 +43,7 @@ MainWindow @onClick: modules.game_viplist.addGroup() Button - !text: tr('Cancel') + !text: localize('UIButtonCancel') anchors.right: parent.right anchors.bottom: parent.bottom margin-bottom: 6 diff --git a/modules/game_viplist/addvip.otui b/modules/game_viplist/addvip.otui index db1272f08b..a4c57adb72 100644 --- a/modules/game_viplist/addvip.otui +++ b/modules/game_viplist/addvip.otui @@ -1,11 +1,11 @@ MainWindow size: 256 128 - !text: tr('Add to VIP list') + !text: localize('VipListWindowTitleVipAdd') @onEnter: modules.game_viplist.addVip() @onEscape: modules.game_viplist.destroyAddWindow() Label - !text: tr('Please enter a character name') .. ':' + !text: localize('VipListLabelCharacterName') .. ':' anchors.top: parent.top anchors.left: parent.left anchors.right: parent.right @@ -24,7 +24,7 @@ MainWindow margin-bottom: 10 Button - !text: tr('Ok') + !text: localize('UIButtonOk') width: 64 anchors.right: next.left anchors.bottom: parent.bottom @@ -32,7 +32,7 @@ MainWindow @onClick: modules.game_viplist.addVip() Button - !text: tr('Cancel') + !text: localize('UIButtonCancel') width: 64 anchors.right: parent.right anchors.bottom: parent.bottom diff --git a/modules/game_viplist/editvip.otui b/modules/game_viplist/editvip.otui index e626b7d19a..3acda63bec 100644 --- a/modules/game_viplist/editvip.otui +++ b/modules/game_viplist/editvip.otui @@ -1,5 +1,5 @@ VipGroupBox < CheckBox - !text: tr('Empty') + !text: localize('VipListCheckboxEmpty') color: #f4ecec text-offset: 15 -1 $hover !disabled: @@ -34,7 +34,7 @@ IconButton < CheckBox MainWindow size: 272 170 - !text: tr('Edit VIP') + !text: localize('VipListDialogVipEdit') Label id: nameLabel @@ -49,7 +49,7 @@ MainWindow anchors.bottom: prev.bottom margin-bottom: -5 Label - !text: tr('Description') .. ':' + !text: localize('VipListDialogVipEditDescription') .. ':' anchors.top: prev.bottom anchors.left: parent.left text-offset: 0 3 @@ -72,7 +72,7 @@ MainWindow self:setHeight(0) end Label - !text: tr('Notify-Login') .. ':' + !text: localize('VipListLabelNotifyOnLogin') .. ':' anchors.top: prev.bottom anchors.left: parent.left text-offset: 0 3 @@ -182,7 +182,7 @@ MainWindow end OptionCheckBox id: checkBoxNotify - !text: tr('Notify on login') + !text: localize('VipListCheckboxNotifyOnLogin') anchors.left: parent.left anchors.right: parent.right anchors.verticalCenter: parent.verticalCenter @@ -199,7 +199,7 @@ MainWindow self:hide() end Label - !text: tr('Member of the following groups:') + !text: localize('VipListLabelMemberOfGroups') .. ":" anchors.left: parent.left anchors.right: parent.right anchors.top: prev.bottom @@ -238,7 +238,7 @@ MainWindow Button id: buttonOK - !text: tr('Ok') + !text: localize('UIButtonOk') width: 64 anchors.right: next.left anchors.bottom: parent.bottom @@ -246,7 +246,7 @@ MainWindow Button id: buttonCancel - !text: tr('Cancel') + !text: localize('UIButtonCancel') width: 64 anchors.right: parent.right anchors.bottom: parent.bottom diff --git a/modules/game_viplist/viplist.lua b/modules/game_viplist/viplist.lua index 381ebe8b46..c0336e87cf 100644 --- a/modules/game_viplist/viplist.lua +++ b/modules/game_viplist/viplist.lua @@ -27,7 +27,7 @@ function controllerVip:onInit() callback = toggle, } }) - vipButton = modules.game_mainpanel.addToggleButton('vipListButton', tr('VIP List') .. ' (Ctrl+P)', + vipButton = modules.game_mainpanel.addToggleButton('vipListButton', localize('VipListPanelTitle') .. ' (Ctrl+P)', '/images/options/button_vip', toggle, false, 3) vipWindow = g_ui.loadUI('viplist') controllerVip:registerEvents(g_game, { @@ -189,7 +189,7 @@ function createEditWindow(widget) local id = widget:getId():sub(4) -- @Groups if not g_game.getFeature(GameVipGroups) then - editVipWindow:setText('Edit VIP') + editVipWindow:setText(localize('VipListDialogVipEdit')) editVipWindow:setSize('272 170') else editVipWindow:setHeight(350 + 2 * (#vipGroups)) @@ -560,8 +560,8 @@ function onVipStateChange(id, state, groupID) end if notify and state ~= VipState.Pending then - modules.game_textmessage.displayFailureMessage(state == VipState.Online and tr('%s has logged in.', name) or - tr('%s has logged out.', name)) + modules.game_textmessage.displayFailureMessage(state == VipState.Online and localize('VipListMessagePlayerLoggedIn', name) or + localize('VipListMessagePlayerLoggedOut', name)) end end @@ -574,53 +574,54 @@ function onVipListMousePress(widget, mousePos, mouseButton) local menu = g_ui.createWidget('PopupMenu') menu:setGameMenu(true) - menu:addOption(tr('Add new VIP'), function() + menu:addOption(localize('VipListDialogVipAdd'), function() createAddWindow() end) menu:addSeparator() if not globalSettings.hideOfflineVips then - menu:addOption(tr('Hide Offline'), function() + menu:addOption(localize('VipListDialogHideOffline'), function() hideOffline(true) end) else - menu:addOption(tr('Show Offline'), function() + menu:addOption(localize('VipListDialogShowOffline'), function() hideOffline(false) end) end if g_game.getFeature(GameVipGroups) then - menu:addOption(tr('Add new group'), function() + menu:addOption(localize('VipListDialogGroupAdd'), function() createAddGroupWindow() end) end menu:addSeparator() if not (getSortedBy() == 'name') then - menu:addOption(tr('Sort by name'), function() + menu:addOption(localize('VipListSortName'), function() sortBy('name') end) end - if not (getSortedBy() == 'status') then - menu:addOption(tr('Sort by status'), function() - sortBy('status') + if not (getSortedBy() == 'type') then + menu:addOption(localize('VipListSortType'), function() + sortBy('type') end) end - if not (getSortedBy() == 'type') then - menu:addOption(tr('Sort by type'), function() - sortBy('type') + if not (getSortedBy() == 'status') then + menu:addOption(localize('VipListSortStatus'), function() + sortBy('status') end) end + if g_game.getFeature(GameVipGroups) then if not globalSettings.showGrouped then - menu:addOption(tr('Show groups'), function() + menu:addOption(localize('VipListDialogShowGroups'), function() globalSettings.showGrouped = true showGroups() end) else - menu:addOption(tr('Hide groups'), function() + menu:addOption(localize('VipListDialogHideGroups'), function() globalSettings.showGrouped = false refresh() end) @@ -643,33 +644,33 @@ function onVipListLabelMousePress(widget, mousePos, mouseButton) local menu = g_ui.createWidget('PopupMenu') menu:setGameMenu(true) if not isGroup then - menu:addOption(tr('Edit %s', widget:getText()), function() + menu:addOption(localize('VipListDialogPlayerEdit', widget:getText()), function() if widget then createEditWindow(widget) end end) - menu:addOption(tr('Remove %s', widget:getText()), function() + menu:addOption(localize('VipListDialogPlayerRemove', widget:getText()), function() if widget then removeVip(widget) end end) if isVip and widget.vipState == VipState.Online then - menu:addOption(tr('Message to %s', widget:getText()), function() + menu:addOption(localize('VipListDialogPlayerOpenChat', widget:getText()), function() g_game.openPrivateChannel(widget:getText()) end) end end - menu:addOption(tr('Add new VIP'), function() + menu:addOption(localize('VipListDialogVipAdd'), function() createAddWindow() end) if modules.game_console.getOwnPrivateTab() then menu:addSeparator() - menu:addOption(tr('Invite to private chat'), function() + menu:addOption(localize('VipListPrivateChatInvite'), function() g_game.inviteToOwnChannel(widget:getText()) end) - menu:addOption(tr('Exclude from private chat'), function() + menu:addOption(localize('VipListPrivateChatExclude'), function() g_game.excludeFromOwnChannel(widget:getText()) end) end @@ -678,48 +679,48 @@ function onVipListLabelMousePress(widget, mousePos, mouseButton) if isGroup and widget.editable then local groupName = widget:getTooltip() and widget:getTooltip() or widget.group:getText() - menu:addOption(tr('Edit group %s', groupName), function() + menu:addOption(localize('VipListDialogGroupEdit', groupName), function() createEditGroupWindow(groupName, widget.groupId) end) - menu:addOption(tr('Remove group %s', groupName), function() + menu:addOption(localize('VipListDialogGroupRemove', groupName), function() g_game.editVipGroups(3, widget.groupId, '') end) end - menu:addOption(tr('Add new group'), function() + menu:addOption(localize('VipListDialogGroupAdd'), function() createAddGroupWindow() end) end menu:addSeparator() if not globalSettings.hideOfflineVips then - menu:addOption(tr('Hide Offline'), function() + menu:addOption(localize('VipListDialogHideOffline'), function() hideOffline(true) end) else - menu:addOption(tr('Show Offline'), function() + menu:addOption(localize('VipListDialogShowOffline'), function() hideOffline(false) end) end - menu:addOption(tr('Sort by name'), function() + menu:addOption(localize('VipListSortName'), function() sortBy('byName') end) - menu:addOption(tr('Sort by type'), function() + menu:addOption(localize('VipListSortType'), function() sortBy('byType') end) - menu:addOption(tr('Sort by status'), function() + menu:addOption(localize('VipListSortStatus'), function() sortBy('byState') end) if g_game.getFeature(GameVipGroups) then if not globalSettings.showGrouped then - menu:addOption(tr('Show groups'), function() + menu:addOption(localize('VipListDialogShowGroups'), function() globalSettings.showGrouped = true showGroups() end) else - menu:addOption(tr('Hide groups'), function() + menu:addOption(localize('VipListDialogHideGroups'), function() globalSettings.showGrouped = false refresh() end) @@ -728,7 +729,7 @@ function onVipListLabelMousePress(widget, mousePos, mouseButton) if not isGroup then menu:addSeparator() - menu:addOption(tr('Copy Name'), function() + menu:addOption(localize('ContextMenuCopyName'), function() g_window.setClipboardText(widget:getText()) end) end @@ -748,21 +749,21 @@ end function createAddGroupWindow() if maxVipGroups < 1 then - displayInfoBox(tr('Maximum of User-Created Groups Reached'), - 'You have already reached the maximum of groups you can create yourself.') + displayInfoBox(localize('VipListGroupLimitTitle'), + localize('VipListGroupLimitMessage')) return end if not addGroupWindow then addGroupWindow = g_ui.displayUI('addgroup') - addGroupWindow:setText(tr(addGroupWindow:getText(), maxVipGroups)) + addGroupWindow:setText(localize('VipListDialogGroupAdd')) end end function createEditGroupWindow(groupName, groupId) if not addGroupWindow then addGroupWindow = g_ui.displayUI('addgroup') - addGroupWindow:setText('Edit VIP group') - addGroupWindow.header:setText('Please enter a group name:') + addGroupWindow:setText(localize('VipListWindowTitleGroupEdit')) + addGroupWindow.header:setText(localize('VipListWindowFormGroupName') .. ':') addGroupWindow.name:setText(groupName) function addGroupWindow.onEnter() editGroup(groupId) diff --git a/modules/game_viplist/viplist.otui b/modules/game_viplist/viplist.otui index b7ed40afb3..eee8bfb46a 100644 --- a/modules/game_viplist/viplist.otui +++ b/modules/game_viplist/viplist.otui @@ -20,7 +20,7 @@ VipGroupList < UIWidget anchors.left: parent.left color: #f7f7f7 text-align: topLeft - !text: tr('No Group') + !text: localize('VipListNoGroup') text-auto-resize: true HorizontalSeparator @@ -41,7 +41,7 @@ VipGroupList < UIWidget MiniWindow id: vipWindow - !text: tr('VIP List') + !text: localize('VipListPanelTitle') height: 100 icon: /images/topbuttons/viplist @onOpen: modules.game_viplist.onMiniWindowOpen() diff --git a/modules/modulelib/ext/parse.lua b/modules/modulelib/ext/parse.lua index abd714e59d..afc8e2b08c 100644 --- a/modules/modulelib/ext/parse.lua +++ b/modules/modulelib/ext/parse.lua @@ -41,9 +41,9 @@ local function parseExpression(content, controller) local script = content:sub(pos + 2, lastPos - 1) local res = nil - if content:sub(pos - 2, pos - 1) == 'tr' then + if content:sub(pos - 2, pos - 1) == 'localize' then pos = pos - 2 - res = tr(script) + res = localize(script) else local f = loadstring('return function(self) return ' .. script .. ' end') res = f()(controller) diff --git a/modules/updater/updater.lua b/modules/updater/updater.lua index 6e38645157..eb2abed92f 100644 --- a/modules/updater/updater.lua +++ b/modules/updater/updater.lua @@ -32,9 +32,9 @@ local function downloadFiles(url, files, index, retries, doneCallback) local file_checksum = entry[2] if retries > 0 then - updaterWindow.downloadStatus:setText(tr("Downloading (%i retry):\n%s", retries, file)) + updaterWindow.downloadStatus:setText(localize('UpdaterMessageFileDownloadRetry', retries, file)) else - updaterWindow.downloadStatus:setText(tr("Downloading:\n%s", file)) + updaterWindow.downloadStatus:setText(localize('UpdaterMessageFileDownload', file)) end updaterWindow.downloadProgress:setPercent(0) updaterWindow.mainProgress:setPercent(math.floor(100 * index / #files)) @@ -135,7 +135,7 @@ local function updateFiles(data, keepCurrentFiles) end end - updaterWindow.status:setText(tr("Updating %i files", #toUpdate)) + updaterWindow.status:setText(localize('UpdaterMessageUpdatingFiles', #toUpdate)) updaterWindow.mainProgress:setPercent(0) updaterWindow.downloadProgress:setPercent(0) updaterWindow.downloadProgress:show() @@ -143,7 +143,7 @@ local function updateFiles(data, keepCurrentFiles) updaterWindow.changeUrlButton:hide() downloadFiles(data["url"], toUpdate, 1, 0, function() - updaterWindow.status:setText(tr("Updating client (may take few seconds)")) + updaterWindow.status:setText(localize('UpdaterMessagePending')) updaterWindow.mainProgress:setPercent(100) updaterWindow.downloadProgress:hide() updaterWindow.downloadStatus:hide() @@ -206,7 +206,7 @@ function Updater.check(args) local function progressUpdater(value) removeEvent(scheduledEvent) if value == 100 then - return Updater.error(tr("Timeout")) + return Updater.error(localize('UpdaterTimeout')) end if updateData and (value > 60 or (not g_platform.isMobile() or not ALLOW_CUSTOM_SERVERS or not loadModulesFunc)) then -- gives 3s to set custom updater for mobile version return updateFiles(updateData) @@ -233,7 +233,7 @@ end function Updater.error(message) removeEvent(scheduledEvent) if not updaterWindow then return end - displayErrorBox(tr("Updater Error"), message).onOk = function() + displayErrorBox(localize('UpdaterError'), message).onOk = function() Updater.abort() end end diff --git a/modules/updater/updater.otui b/modules/updater/updater.otui index ddb9f95fdb..dc63fa096e 100644 --- a/modules/updater/updater.otui +++ b/modules/updater/updater.otui @@ -1,6 +1,6 @@ StaticMainWindow id: updaterWindow - !text: tr('Updater') + !text: localize('UpdaterTitle') width: 350 layout: @@ -9,7 +9,7 @@ StaticMainWindow Label id: status - !text: tr('Checking for updates') + !text: localize('UpdaterCheckInProgress') text-align: center ProgressBar @@ -40,7 +40,7 @@ StaticMainWindow margin-right: 50 margin-top: 5 margin-bottom: 10 - !text: tr('Change updater URL') + !text: localize('UpdaterChangeURL') @onClick: Updater.changeUrl() $!mobile: visible: false @@ -48,6 +48,6 @@ StaticMainWindow Button margin-left: 90 margin-right: 90 - !text: tr('Cancel') + !text: localize('UIButtonCancel') @onClick: Updater.abort() From 431679c86e0eb663c0e3d8ea982d78654e51c5d2 Mon Sep 17 00:00:00 2001 From: Zbizu Date: Tue, 28 Jan 2025 12:52:11 +0100 Subject: [PATCH 3/8] more translations --- data/locales/en.lua | 47 ++++++++++++++++++++ modules/game_console/console.lua | 6 +-- modules/game_stash/game_stash.otui | 12 ++--- modules/game_store/game_store.lua | 14 +++--- modules/game_store/game_store.otui | 22 ++++----- modules/game_store/style/changename.otui | 8 ++-- modules/game_store/style/transferpoints.otui | 14 +++--- modules/game_store/style/ui.otui | 4 +- modules/game_tasks/tasks.lua | 8 ++-- modules/game_tasks/tasks.otui | 2 +- modules/game_textmessage/textmessage.lua | 24 +++++----- 11 files changed, 104 insertions(+), 57 deletions(-) diff --git a/data/locales/en.lua b/data/locales/en.lua index fff73a27a3..d407481427 100644 --- a/data/locales/en.lua +++ b/data/locales/en.lua @@ -56,10 +56,14 @@ locale:translate("UIButtonSettings", "Settings") locale:translate("UIButtonEdit", "Edit") locale:translate("UIButtonRemove", "Remove") locale:translate("UIButtonClear", "Clear") +locale:translate("UIButtonPaginationPrev", "Prev Page") +locale:translate("UIButtonPaginationNext", "Next Page") -- UI: common form fields locale:translate("FormFieldDescription", "Description") locale:translate("FormFieldPosition", "Position") +locale:translate("FormFieldCurrentPage", "Page") +locale:translate("FormFieldFind", "Find") -- UI: common dialog options locale:translate("ContextMenuCopyName", "Copy Name") @@ -170,6 +174,14 @@ locale:translate("WindowTitleTextEdit", "Edit text") -- UI: possibly unused locale:translate("ButtonsWindowTitle", "Buttons") +-- misc +locale:translate("ThereIsNoWay", "There is no way.") + +-- chat +locale:translate("ChatChannelNameDefault", "Local Chat") +locale:translate("ChatChannelNameServerLog", "Server Log") +locale:translate("ChatChannelNameLoot", "Loot") + -- item selector locale:translate("ItemSelectorCountSubtype", "Count / SubType") locale:translate("ItemSelectorItemID", "Item ID") @@ -179,6 +191,41 @@ locale:translate("ItemSelectorWindowTitle", "Select Item") locale:translate("MinimapWindowTitleSetMark", "Create Map Mark") locale:translate("MinimapButtonCenter", "Center") +-- stash +locale:translate("StashWindowTitle", "Supply Stash") +locale:translate("StashWindowWithdraw", "Stash Withdraw") + +-- store +locale:translate("StoreButtonBuyItem", "Buy") +locale:translate("StoreButtonGiftTc", "Gift") +locale:translate("StoreButtonGetCoins", "Get") +locale:translate("StoreButtonGetCoinsTooltip", "Get Tibia Coins") +locale:translate("StoreButtonTransactionHistory", "History") +locale:translate("StoreButtonTransferCoins", "Transfer Coins") +locale:translate("StoreButtonSellCharacter", "Setup up an auction to sell you currents characters.") +locale:translate("StoreWindowTitleGiftTc", "Gift Tibia Coins") +locale:translate("StoreItemStats", "General Stats") +locale:translate("StoreTransferableTc", "Transferable Tibia Coins") +locale:translate("StoreTcToTransfer", "Amount to transfer") +locale:translate("StoreTcRecipient", "Recipient") +locale:translate("StoreMessageTcTransfer", "Please select the amount of Tibia\nCoins you like to gift and enter the\nname of the character that should\nreceive the Tibia Coins.") +locale:translate("StoreGiftTcButton", "Please select the amount of Tibia\nCoins you like to gift and enter the\nname of the character that should\nreceive the Tibia Coins.") +locale:translate("StoreWindowTitleRenameChar", "Enter New Character Name") +locale:translate("StoreWindowMessageRenameChar", "Please enter the new name for your character") +locale:translate("StoreWindowTitleMain", "Store") +locale:translate("StoreWindowTitleConfirmBuy", "Confirmation of Purchase") +locale:translate("StoreWindow", "Confirmation of Purchase") +locale:translate("StoreLabelPrice", "Price") +locale:translate("StoreMessageConfirmBuy", "Do you want to buy the product \"%1\" for %2 %3?") +locale:translate("StoreMessageNotEnoughCoins", "You don't have enough coins") +locale:translate("StoreCurrencyTcRegular", "regular coins") +locale:translate("StoreCurrencyTcTransferable", "transferable coins") + +-- tasks +locale:translate("TaskSystemWindowTitle", "Tasks") +locale:translate("TaskSystemAlertTitle", "Tasks") +locale:translate("TaskSystemAbortMessage", "Do you really want to abort this task?") + -- text window (books and house list) locale:translate("TextWindowDescriptionWriter", "You read the following, written by \n%1\n") locale:translate("TextWindowDescriptionTime", "You read the following, written on \n%1.\n") diff --git a/modules/game_console/console.lua b/modules/game_console/console.lua index 5cfc15adb1..8e3a2154be 100644 --- a/modules/game_console/console.lua +++ b/modules/game_console/console.lua @@ -1638,7 +1638,7 @@ function onTalk(name, level, mode, message, channelId, creaturePos) modules.game_textmessage.displayPrivateMessage(name .. ':\n' .. message) end else - local channel = tr('Local Chat') + local channel = localize('ChatChannelNameDefault') if not defaultMessage then channel = channels[channelId] end @@ -2027,8 +2027,8 @@ function onClickIgnoreButton() end function online() - defaultTab = addTab(tr('Local Chat'), true) - serverTab = addTab(tr('Server Log'), false) + defaultTab = addTab(localize('ChatChannelNameDefault'), true) + serverTab = addTab(localize('ChatChannelNameServerLog'), false) if g_game.getClientVersion() >= 820 then local tab = addTab('NPCs', false) diff --git a/modules/game_stash/game_stash.otui b/modules/game_stash/game_stash.otui index 7e1ae0a9a5..4eb3abda47 100644 --- a/modules/game_stash/game_stash.otui +++ b/modules/game_stash/game_stash.otui @@ -1,6 +1,6 @@ StashWindow < MainWindow id: stashWindow - !text: tr('Supply Stash') + !text: localize('StashWindowTitle') size: 700 530 @onEscape: onSupplyStashClose() @@ -53,7 +53,7 @@ StashWindow < MainWindow width: 164 height: 25 Label - !text: tr('Find') .. ':' + !text: localize('FormFieldFind') .. ':' anchors.top: parent.top anchors.left: parent.left width: 30 @@ -70,7 +70,7 @@ StashWindow < MainWindow Button id: closeButton - !text: tr('Close') + !text: localize('UIButtonClose') anchors.top: mainTabContent.bottom anchors.horizontalCenter: mainTabContent.horizontalCenter margin-top: 5 @@ -106,7 +106,7 @@ StashItemBox < UICheckBox StashSelectAmount < MainWindow id: stashSelectAmount - !text: tr('Stash Withdraw') + !text: localize('StashWindowWithdraw') size: 196 90 Item @@ -129,7 +129,7 @@ StashSelectAmount < MainWindow Button id: buttonCancel - !text: tr('Cancel') + !text: localize('UIButtonCancel') height: 20 anchors.left: countScrollBar.horizontalCenter anchors.right: countScrollBar.right @@ -139,7 +139,7 @@ StashSelectAmount < MainWindow Button id: buttonOk - !text: tr('Ok') + !text: localize('UIButtonOk') height: 20 anchors.right: countScrollBar.horizontalCenter anchors.left: countScrollBar.left diff --git a/modules/game_store/game_store.lua b/modules/game_store/game_store.lua index 3f4a8a477f..47881ef25d 100644 --- a/modules/game_store/game_store.lua +++ b/modules/game_store/game_store.lua @@ -931,7 +931,7 @@ function chooseOffert(self, focusedChild) acceptWindow = nil end else - displayErrorBox(controllerShop.ui:getText(), tr("You don't have enough coins")) + displayErrorBox(controllerShop.ui:getText(), localize("StoreMessageNotEnoughCoins")) acceptWindow:destroy() acceptWindow = nil end @@ -940,17 +940,17 @@ function chooseOffert(self, focusedChild) acceptWindow:destroy() acceptWindow = nil end - local coinType = isTransferable and "transferable coins" or "regular coins" - local confirmationMessage = string.format('Do you want to buy the product "%s" for %d %s?', product.name, subOffer.price, coinType) - local detailsMessage = string.format("%dx %s\nPrice: %d %s", subOffer.count, product.name, subOffer.price, coinType) - acceptWindow = displayGeneralSHOPBox(tr('Confirmation of Purchase'), confirmationMessage, detailsMessage, + local coinType = isTransferable and localize('StoreCurrencyTcTransferable') or localize('StoreCurrencyTcRegular') + local confirmationMessage = localize('StoreMessageConfirmBuy', product.name, subOffer.price, coinType) + local detailsMessage = localize("%dx %s\n%s: %d %s", subOffer.count, product.name, localize('StoreLabelPrice'), subOffer.price, coinType) + acceptWindow = displayGeneralSHOPBox(localize('StoreWindowTitleConfirmBuy'), confirmationMessage, detailsMessage, getProductData(product), { { - text = tr('Buy'), + text = localize('StoreButtonBuyItem'), callback = acceptFunc }, { - text = tr('Cancel'), + text = localize('UIButtonCancel'), callback = cancelFunc }, anchor = AnchorHorizontalCenter diff --git a/modules/game_store/game_store.otui b/modules/game_store/game_store.otui index 7dcfb9b046..9c44c5ade0 100644 --- a/modules/game_store/game_store.otui +++ b/modules/game_store/game_store.otui @@ -94,7 +94,7 @@ MenuCategoryStore < UIWidget StoreWindow size: 780 537 - !text: tr('Store') + !text: localize('StoreWindowTitleMain') color: #909090 visible: false @onEscape: modules.game_store.toggle() @@ -104,7 +104,7 @@ StoreWindow size: 45 20 anchors.bottom: parent.bottom anchors.right: parent.right - !text: tr('Close') + !text: localize('UIButtonClose') font: cipsoftFont @onClick: modules.game_store.toggle() @@ -114,7 +114,7 @@ StoreWindow anchors.bottom: parent.bottom anchors.right: btnClose.left margin-right: 5 - !text: tr('History') + !text: localize('StoreButtonTransactionHistory') font: cipsoftFont @onClick: modules.game_store.toggleTransferHistory() @@ -172,7 +172,7 @@ StoreWindow Label anchors.bottom: parent.bottom anchors.left: prev.right - !text: tr(")") + !text: ")" focusable: false phantom: true margin-left:5 @@ -185,13 +185,13 @@ StoreWindow anchors.left: prev.right margin-left: 5 margin-bottom: 2 - !tooltip: tr('get Tibia Coins') + !tooltip: localize('StoreButtonGetCoinsTooltip') image-color: green icon: /images/ui/tibiaCoin icon-align: center icon-offset: 10 -1 text-offset: -18 0 - !text: tr('Get') + !text: localize('StoreButtonGetCoins') font: cipsoftFont @onClick: modules.game_store.getCoinsWebsite() @@ -202,7 +202,7 @@ StoreWindow StoreButton id: transferPoints anchors.top: btnCoins.top - !tooltip: tr('Transfer Coins') + !tooltip: localize('StoreButtonTransferCoins') anchors.left: btnCoins.right margin-left: 5 icon-align: center @@ -212,7 +212,7 @@ StoreWindow StoreButton anchors.top: transferPoints.top - !tooltip: tr('Setup up an auction to sell you currents characters.') + !tooltip: localize('StoreButtonSellCharacter') anchors.left: transferPoints.right margin-left: 5 icon-align: center @@ -360,21 +360,21 @@ StoreWindow anchors.bottom: parent.bottom anchors.right: parent.right margin-bottom:-5 - !text: tr('Next Page') + !text: localize('UIButtonPaginationNext') @onClick: modules.game_store.requestTransactionHistory(self) Label id: lblPage anchors.bottom: parent.bottom anchors.horizontalCenter: parent.horizontalCenter - !text: tr('Page 1 / 4') + !text: localize('FormFieldCurrentPage') .. " 1 / 4" Button id: btnPrevPage anchors.bottom: parent.bottom anchors.left: parent.left margin-bottom:-5 - !text: tr('Prev Page') + !text: localize('UIButtonPaginationPrev') @onClick: modules.game_store.requestTransactionHistory(self) StoreLightFlatPanel diff --git a/modules/game_store/style/changename.otui b/modules/game_store/style/changename.otui index 9736afde20..59ee345864 100644 --- a/modules/game_store/style/changename.otui +++ b/modules/game_store/style/changename.otui @@ -7,7 +7,7 @@ StoreWindow Label id: transferPointsLabel - !text: tr('Enter New Character Name') + !text: localize('StoreWindowTitleRenameChar') text-align: center font: verdana-11px-antialised anchors.top: parent.top @@ -17,7 +17,7 @@ StoreWindow Label id: descriptionText - !text: tr('Please enter the new name for your character:') + !text: localize('StoreWindowMessageRenameChar') .. ":" text-wrap: true text-auto-resize:true anchors.top: transferPointsLabel.bottom @@ -58,7 +58,7 @@ StoreWindow anchors.bottom: parent.bottom margin-right: 12 margin-bottom: 7 - !text: tr('Cancel') + !text: localize('UIButtonCancel') font: cipsoftFont size: 43 20 color: #ffffff @@ -70,7 +70,7 @@ StoreWindow anchors.bottom: parent.bottom margin-right: 10 margin-bottom: 7 - !text: tr('Ok') + !text: localize('UIButtonOk') font: cipsoftFont size: 43 20 color: #ffffff diff --git a/modules/game_store/style/transferpoints.otui b/modules/game_store/style/transferpoints.otui index 398e3c641e..a5bd12dc65 100644 --- a/modules/game_store/style/transferpoints.otui +++ b/modules/game_store/style/transferpoints.otui @@ -7,7 +7,7 @@ StoreWindow Label id: transferPointsLabel - !text: tr('Gift Tibia Coins') + !text: localize('StoreWindowTitleGiftTc') text-align: center font: verdana-11px-antialised anchors.top: parent.top @@ -17,7 +17,7 @@ StoreWindow Label id: descriptionText - !text: tr('Please select the amount of Tibia\nCoins you like to gift and enter the\nname of the character that should\nreceive the Tibia Coins.') + !text: localize('StoreMessageTcTransfer') text-wrap: true text-auto-resize:true anchors.top: transferPointsLabel.bottom @@ -27,7 +27,7 @@ StoreWindow Label id: recipient - !text: tr('Recipient:') + !text: localize('StoreTcRecipient') .. ":" anchors.top: descriptionText.bottom anchors.left: parent.left size: 57 12 @@ -48,7 +48,7 @@ StoreWindow Label id: transferAmount - !text: tr('Amount to transfer:') + !text: localize('StoreTcToTransfer') .. ":" anchors.top: transferableAmount.bottom anchors.left: parent.left size: 180 12 @@ -71,7 +71,7 @@ StoreWindow Label id: transferableAmount - !text: tr('Transferable Tibia Coins:') + !text: localize('StoreTransferableTc') .. ":" anchors.top: recipient.bottom anchors.left: parent.left size: 155 12 @@ -115,7 +115,7 @@ StoreWindow anchors.bottom: parent.bottom margin-right: 12 margin-bottom: 7 - !text: tr('Cancel') + !text: localize('UIButtonCancel') font: cipsoftFont size: 43 20 color: #ffffff @@ -127,7 +127,7 @@ StoreWindow anchors.bottom: parent.bottom margin-right: 10 margin-bottom: 7 - !text: tr('Gift') + !text: localize('StoreButtonGiftTc') font: cipsoftFont size: 43 20 color: #ffffff diff --git a/modules/game_store/style/ui.otui b/modules/game_store/style/ui.otui index d84d40c384..cf4b455c4f 100644 --- a/modules/game_store/style/ui.otui +++ b/modules/game_store/style/ui.otui @@ -49,7 +49,7 @@ OfferPanel2 < Panel anchors.top: parent.top anchors.left: parent.left anchors.right: parent.right - !text: tr('Buy') + !text: localize('StoreButtonBuyItem') font: cipsoftFont image-color: #75bfff @@ -198,7 +198,7 @@ storeCategory < UIWidget margin-left: 10 text-align: center text-auto-resize: true - !text: tr('General Stats') + !text: localize('StoreItemStats') color: #ffffff font: cipsoftFont $checked: diff --git a/modules/game_tasks/tasks.lua b/modules/game_tasks/tasks.lua index bedf3401ab..408f640159 100644 --- a/modules/game_tasks/tasks.lua +++ b/modules/game_tasks/tasks.lua @@ -21,7 +21,7 @@ function init() }) g_keyboard.bindKeyDown('Escape', hideWindowzz) - taskButton = modules.client_topmenu.addLeftGameButton('taskButton', tr('Tasks'), '/modules/game_tasks/images/taskIcon', toggleWindow) + taskButton = modules.client_topmenu.addLeftGameButton('taskButton', localize('TaskSystemWindowTitle'), '/modules/game_tasks/images/taskIcon', toggleWindow) ProtocolGame.registerExtendedJSONOpcode(215, parseOpcode) end @@ -167,13 +167,13 @@ function abort() cancelConfirm = nil end - cancelConfirm = displayGeneralBox(tr('Tasks'), tr("Do you really want to abort this task?"), { + cancelConfirm = displayGeneralBox(localize('TaskSystemAlertTitle'), localize("TaskSystemAbortMessage"), { { - text = tr('Yes'), + text = localize('UIButtonYes'), callback = yesFunc }, { - text = tr('No'), + text = localize('UIButtonNo'), callback = noFunc }, anchor = AnchorHorizontalCenter diff --git a/modules/game_tasks/tasks.otui b/modules/game_tasks/tasks.otui index 1a01c89261..37cf13ab98 100644 --- a/modules/game_tasks/tasks.otui +++ b/modules/game_tasks/tasks.otui @@ -83,7 +83,7 @@ SelectionButton < Panel MainWindow size: 549 509 id: tasksWindow - !text: tr('Tasks') + !text: localize('WindowTitleTaskSystem') @onEnter: modules.game_tasks.toggleWindow() @onEscape: modules.game_tasks.toggleWindow() diff --git a/modules/game_textmessage/textmessage.lua b/modules/game_textmessage/textmessage.lua index 8ef6958677..2ea3b955b5 100644 --- a/modules/game_textmessage/textmessage.lua +++ b/modules/game_textmessage/textmessage.lua @@ -2,48 +2,48 @@ MessageSettings = { none = {}, consoleRed = { color = TextColors.red, - consoleTab = 'Local Chat' + consoleTab = 'ChatChannelNameDefault' }, consoleOrange = { color = TextColors.orange, - consoleTab = 'Local Chat' + consoleTab = 'ChatChannelNameDefault' }, consoleBlue = { color = TextColors.blue, - consoleTab = 'Local Chat' + consoleTab = 'ChatChannelNameDefault' }, centerRed = { color = TextColors.red, - consoleTab = 'Server Log', + consoleTab = 'ChatChannelNameServerLog', screenTarget = 'lowCenterLabel' }, centerGreen = { color = TextColors.green, - consoleTab = 'Server Log', + consoleTab = 'ChatChannelNameServerLog', screenTarget = 'highCenterLabel', consoleOption = 'showInfoMessagesInConsole' }, centerWhite = { color = TextColors.white, - consoleTab = 'Server Log', + consoleTab = 'ChatChannelNameServerLog', screenTarget = 'middleCenterLabel', consoleOption = 'showEventMessagesInConsole' }, bottomWhite = { color = TextColors.white, - consoleTab = 'Server Log', + consoleTab = 'ChatChannelNameServerLog', screenTarget = 'statusLabel', consoleOption = 'showEventMessagesInConsole' }, status = { color = TextColors.white, - consoleTab = 'Server Log', + consoleTab = 'ChatChannelNameServerLog', screenTarget = 'statusLabel', consoleOption = 'showStatusMessagesInConsole' }, othersStatus = { color = TextColors.white, - consoleTab = 'Server Log', + consoleTab = 'ChatChannelNameServerLog', consoleOption = 'showOthersStatusMessagesInConsole' }, statusSmall = { @@ -56,7 +56,7 @@ MessageSettings = { }, loot = { color = TextColors.white, - consoleTab = 'Loot', + consoleTab = 'ChatChannelNameLoot', screenTarget = 'highCenterLabel', consoleOption = 'showInfoMessagesInConsole' } @@ -150,7 +150,7 @@ function displayMessage(mode, text) if msgtype.consoleTab ~= nil and (msgtype.consoleOption == nil or modules.client_options.getOption(msgtype.consoleOption)) then - modules.game_console.addText(text, msgtype, tr(msgtype.consoleTab)) + modules.game_console.addText(text, msgtype, localize(msgtype.consoleTab)) -- TODO move to game_console end @@ -205,5 +205,5 @@ function clearMessages() end function LocalPlayer:onAutoWalkFail(player) - modules.game_textmessage.displayFailureMessage(tr('There is no way.')) + modules.game_textmessage.displayFailureMessage(localize('ThereIsNoWay')) end From f43870c8320141e814b5eed5d6a4ace4c7068d05 Mon Sep 17 00:00:00 2001 From: Zbizu Date: Tue, 28 Jan 2025 15:12:42 +0100 Subject: [PATCH 4/8] entergame translations --- data/locales/en.lua | 74 +++++++++++++++++++++ modules/client/client.lua | 5 +- modules/client_bottommenu/bottommenu.lua | 2 +- modules/client_bottommenu/bottommenu.otui | 14 ++-- modules/client_bottommenu/calendar.otui | 20 +++--- modules/client_debug_info/debug_info.lua | 2 +- modules/client_debug_info/debug_info.otui | 4 +- modules/client_entergame/characterlist.lua | 24 +++---- modules/client_entergame/characterlist.otui | 20 +++--- modules/client_entergame/entergame.lua | 36 +++++----- modules/client_entergame/entergame.otui | 40 +++++------ modules/client_entergame/waitinglist.otui | 4 +- modules/client_locales/locales.otui | 2 +- 13 files changed, 161 insertions(+), 86 deletions(-) diff --git a/data/locales/en.lua b/data/locales/en.lua index d407481427..793326a2bc 100644 --- a/data/locales/en.lua +++ b/data/locales/en.lua @@ -43,6 +43,9 @@ locale:thousandsSeperator(',') -- %0 does not do anything -- %1-%9 - arguments provided with the localize function +-- language selection +locale:translate("LanguagePickerWindowMessage", "Select your language") + -- UI: common buttons locale:translate("UIButtonOk", "OK") locale:translate("UIButtonCancel", "Cancel") @@ -170,18 +173,89 @@ locale:translate("suffix_n0", "th") -- UI: window titles misc locale:translate("WindowTitleTextEdit", "Edit text") +locale:translate("WindowTitleGraphicsError", "Graphics card driver not detected") +locale:translate("WindowMessageGraphicsError", "No graphics card detected, everything will be drawn using the CPU,\nthus the performance will be really bad.\nPlease update your graphics driver to have a better performance.") -- UI: possibly unused locale:translate("ButtonsWindowTitle", "Buttons") +-- bottom panel (login screen) +locale:translate("BottomPanelTitleRandomHint", "Random Hint") +locale:translate("BottomPanelTitleEventSchedule", "Event Schedule") +locale:translate("BottomPanelActiveEvents", "Active") +locale:translate("BottomPanelUpcomingEvents", "Upcoming") +locale:translate("BottomPanelTitleBoosted", "Boosted") +locale:translate("BottomPanelLabelBoostedCreature", "Creature") +locale:translate("BottomPanelLabelBoostedBoss", "Boss") +locale:translate("BottomPanelWindowTitleEventSchedule", "Event Schedule") +locale:translate("BottomPanelWindowHintEventSchedule", "* Event starts/ends at server save of this day.") + -- misc locale:translate("ThereIsNoWay", "There is no way.") +locale:translate("DebugInfoTitle", "Debug Info") +locale:translate("DebugInfoProxies", "Proxies") -- chat locale:translate("ChatChannelNameDefault", "Local Chat") locale:translate("ChatChannelNameServerLog", "Server Log") locale:translate("ChatChannelNameLoot", "Loot") +-- character list + entergame +locale:translate("CharacterListTitleConnecting", "Please wait") +locale:translate("CharacterListMessageConnecting", "Connecting to game server...") +locale:translate("CharacterListMessageReconnect", "Trying to reconnect in %1 seconds.") +locale:translate("CharacterListTitleLoginError", "Login Error") +locale:translate("CharacterListTitleConnectionError", "Connection Error") +locale:translate("CharacterListTitleUpdateRequired", "Update needed") +locale:translate("CharacterListMessageUpdateRequired", "Enter with your account again to update your client.") +locale:translate("CharacterListMessageUpdateNeeded", "Your client needs updating, try redownloading it.") +locale:translate("CharacterListAccountStatus", "Account Status") +locale:translate("CharacterListAccountFrozen", "Frozen") +locale:translate("CharacterListAccountBanned", "Suspended") +locale:translate("CharacterListAccountFree", "Free Account") +locale:translate("CharacterListAccountPremiumGratis", "Gratis Premium Account") +locale:translate("CharacterListAccountPremiumNormal", "Premium Account (%1) days left") +locale:translate("CharacterListMessageNoCharacterSelected", "You must select a character to login!") +locale:translate("CharacterListWindowTitle", "Character List") +locale:translate("CharacterListColumnPlayer", "Character") +locale:translate("CharacterListColumnStatus", "Status") +locale:translate("CharacterListColumnLevel", "Level") +locale:translate("CharacterListColumnVocation", "Vocation") +locale:translate("CharacterListColumnWorld", "World") +locale:translate("CharacterListMotd", "Message of the day") + +-- entergame +locale:translate("EnterGameTitleOld", "Enter Game") +locale:translate("EnterGameTitleNew", "Journey Onwards") +locale:translate("EnterGameEmail", "Email") +locale:translate("EnterGameAccName", "Acc Name") +locale:translate("EnterGamePassword", "Password") +locale:translate("EnterGameClientVersion", "Client Version") +locale:translate("EnterGameClientPort", "Port") +locale:translate("EnterGameRememberEmail", "Remember e-mail") +locale:translate("EnterGameTooltipRememberEmail", "Be aware that your email address will be stored on your configuration file \"config.otml\" if you activate this option.") +locale:translate("EnterGameRememberPassword", "Remember password") +locale:translate("EnterGameTooltipRememberPassword", "Remember account and password when the client starts") +locale:translate("EnterGameButtonAccountLost", "Forgot password and/or email") +locale:translate("EnterGameAuthenticatorToken", "Authenticator Token") +locale:translate("EnterGameCheckboxKeepSession", "Stay logged during session") +locale:translate("EnterGameThingsErrorAssets", "Things are not loaded, please put assets in things/%1/.") +locale:translate("EnterGameThingsErrorSprites", "Things are not loaded, please put spr and dat in things/%1/.") +locale:translate("EnterGameHttpError", "ERROR , try adding \n- ip/login.php \n- Enable HTTP login") +locale:translate("EnterGameMessageConnectingHttp", "Connecting to login server...\nServer: [%1]") +locale:translate("EnterGameMessageConnecting", "Connecting to login server...") +locale:translate("EnterGameMessageAlreadyLogged", "Cannot login while already in game.") +locale:translate("EnterGameTitleWaitList", "Waiting List") +locale:translate("EnterGameTitleServerList", "Server list") +locale:translate("EnterGameLabelServerList", "Make sure that your client uses\nthe correct game client version") +locale:translate("EnterGameCheckboxAutoLogin", "Auto login") +locale:translate("EnterGameTooltipAutoLogin", "Open charlist automatically when starting client") +locale:translate("EnterGameCheckboxHttpLogin", "Enable HTTP login") +locale:translate("EnterGameTooltipHttpLogin", "If login fails using HTTPS (encrypted) try with HTTP (unencrypted)") +locale:translate("EnterGameButtonLogin", "Login") +locale:translate("EnterGameButtonCreateAccount", "Create New Account") +locale:translate("EnterGameLabelServer", "Server") + -- item selector locale:translate("ItemSelectorCountSubtype", "Count / SubType") locale:translate("ItemSelectorItemID", "Item ID") diff --git a/modules/client/client.lua b/modules/client/client.lua index fcdccc3bca..564e253e0f 100644 --- a/modules/client/client.lua +++ b/modules/client/client.lua @@ -35,9 +35,8 @@ function startup() local errmsg = nil if g_graphics.getRenderer():lower():match('gdi generic') then - errtitle = tr('Graphics card driver not detected') - errmsg = tr( - 'No graphics card detected, everything will be drawn using the CPU,\nthus the performance will be really bad.\nPlease update your graphics driver to have a better performance.') + errtitle = localize('WindowTitleGraphicsError') + errmsg = localize('WindowMessageGraphicsError') end -- Show entergame diff --git a/modules/client_bottommenu/bottommenu.lua b/modules/client_bottommenu/bottommenu.lua index 1a74d5eec9..7d9742893a 100644 --- a/modules/client_bottommenu/bottommenu.lua +++ b/modules/client_bottommenu/bottommenu.lua @@ -274,7 +274,7 @@ function reloadEventsSchedulerCurrentPage() widget:clearEvents() widget.dayOfTheWeek = day widget:recursiveGetChildById('dayAndSeason'):setOn(true) - widget:recursiveGetChildById('day'):setText(tr(day)) + widget:recursiveGetChildById('day'):setText(localize(day)) widget:recursiveGetChildById('day'):setWidth(string.len(widget:recursiveGetChildById('day'):getText()) * 10) widget:recursiveGetChildById('fill'):setOn(true) for _, event in ipairs(events) do diff --git a/modules/client_bottommenu/bottommenu.otui b/modules/client_bottommenu/bottommenu.otui index bbd891dc05..b16569d589 100644 --- a/modules/client_bottommenu/bottommenu.otui +++ b/modules/client_bottommenu/bottommenu.otui @@ -54,7 +54,7 @@ Panel Label id: showOffWindowText - !text: tr('Random Hint') + !text: localize('BottomPanelTitleRandomHint') font: verdana-11px-antialised text-offset: 0 2 text-align: top @@ -74,7 +74,7 @@ Panel draggable: false Label - !text: tr('Event Schedule') + !text: localize('BottomPanelTitleEventSchedule') font: verdana-11px-antialised text-offset: 0 2 text-align: top @@ -98,7 +98,7 @@ Panel @onClick: onClickOnCalendar() CalendarTopMark - !text: tr('Active') + !text: localize('BottomPanelActiveEvents') &disableLeftBright: true anchors.top: parent.top anchors.left: parent.left @@ -112,7 +112,7 @@ Panel anchors.bottom: parent.bottom CalendarTopMark - !text: tr('Upcoming') + !text: localize('BottomPanelUpcomingEvents') anchors.top: parent.top anchors.right: parent.right anchors.left: parent.horizontalCenter @@ -136,7 +136,7 @@ Panel draggable: false Label - !text: tr('Boosted') + !text: localize('BottomPanelTitleBoosted') font: verdana-11px-antialised text-offset: 0 2 text-align: top @@ -170,7 +170,7 @@ Panel visible: false Label - !text: tr('Creature') + !text: localize('BottomPanelLabelBoostedCreature') anchors.horizontalCenter: prev.horizontalCenter anchors.top: prev.bottom margin-top: 3 @@ -199,7 +199,7 @@ Panel visible: false Label - !text: tr('Boss') + !text: localize('BottomPanelLabelBoostedBoss') anchors.horizontalCenter: prev.horizontalCenter anchors.top: prev.bottom margin-top: 3 diff --git a/modules/client_bottommenu/calendar.otui b/modules/client_bottommenu/calendar.otui index af2d412fc8..fe6413ecd9 100644 --- a/modules/client_bottommenu/calendar.otui +++ b/modules/client_bottommenu/calendar.otui @@ -2,7 +2,7 @@ CalendarGrid < MiniQtWindow size: 780 575 Label - !text: tr('Event Schedule') + !text: localize('BottomPanelWindowTitleEventSchedule') font: verdana-11px-antialised text-offset: 0 2 text-align: top @@ -21,7 +21,7 @@ CalendarGrid < MiniQtWindow CalendarWeekDays id: row1 - &weekName: tr('Monday') + &weekName: localize('Monday') &disableLeftBright: true anchors.top: parent.top anchors.left: parent.left @@ -31,7 +31,7 @@ CalendarGrid < MiniQtWindow CalendarWeekDays id: row2 - &weekName: tr('Tuesday') + &weekName: localize('Tuesday') anchors.top: prev.top anchors.left: prev.right margin-left: 1 @@ -39,7 +39,7 @@ CalendarGrid < MiniQtWindow CalendarWeekDays id: row3 - &weekName: tr('Wednesday') + &weekName: localize('Wednesday') anchors.top: prev.top anchors.left: prev.right margin-left: 1 @@ -47,7 +47,7 @@ CalendarGrid < MiniQtWindow CalendarWeekDays id: row4 - &weekName: tr('Thursday') + &weekName: localize('Thursday') anchors.top: prev.top anchors.left: prev.right margin-left: 1 @@ -55,7 +55,7 @@ CalendarGrid < MiniQtWindow CalendarWeekDays id: row5 - &weekName: tr('Friday') + &weekName: localize('Friday') anchors.top: prev.top anchors.left: prev.right margin-left: 1 @@ -63,7 +63,7 @@ CalendarGrid < MiniQtWindow CalendarWeekDays id: row6 - &weekName: tr('Saturday') + &weekName: localize('Saturday') anchors.top: prev.top anchors.left: prev.right margin-left: 1 @@ -71,7 +71,7 @@ CalendarGrid < MiniQtWindow CalendarWeekDays id: row0 - &weekName: tr('Sunday') + &weekName: localize('Sunday') anchors.top: prev.top anchors.left: prev.right margin-left: 1 @@ -112,7 +112,7 @@ CalendarGrid < MiniQtWindow Label anchors.left: calendarWidget.left anchors.top: calendarWidget.bottom - !text: tr('* Event starts/ends at server save of this day.') + !text: localize('BottomPanelWindowHintEventSchedule') margin-top: 10 height: 16 text-align: left @@ -127,7 +127,7 @@ CalendarGrid < MiniQtWindow image-source: /images/ui/horizontal_line_bright QtButton - !text: tr('Close') + !text: localize('UIButtonClose') anchors.right: calendarWidget.right anchors.top: prev.bottom margin-top: 10 diff --git a/modules/client_debug_info/debug_info.lua b/modules/client_debug_info/debug_info.lua index 57a90e0c47..4260522278 100644 --- a/modules/client_debug_info/debug_info.lua +++ b/modules/client_debug_info/debug_info.lua @@ -4,7 +4,7 @@ local debugInfoButton = nil local updateEvent = nil function init() - debugInfoButton = modules.client_topmenu.addTopRightToggleButton('debugInfoButton', tr('Debug Info'), + debugInfoButton = modules.client_topmenu.addTopRightToggleButton('debugInfoButton', localize('DebugInfoTitle'), '/images/topbuttons/debug', toggle) debugInfoButton:setOn(false) diff --git a/modules/client_debug_info/debug_info.otui b/modules/client_debug_info/debug_info.otui index 816849bdf9..06d308344a 100644 --- a/modules/client_debug_info/debug_info.otui +++ b/modules/client_debug_info/debug_info.otui @@ -18,7 +18,7 @@ DebugLabel < Label MainWindow id: debugWindow size: 600 150 - !text: tr('Debug Info') + !text: localize('DebugInfoTitle') @onClose: modules.client_debug_info.onMiniWindowClose() &save: false margin: 0 0 0 0 @@ -39,7 +39,7 @@ MainWindow vertical-scrollbar: debugScroll DebugLabel - !text: tr('Proxies') + !text: localize('DebugInfoProxies') anchors.top: parent.top DebugText diff --git a/modules/client_entergame/characterlist.lua b/modules/client_entergame/characterlist.lua index 43c2d9ed54..293a3c01ed 100644 --- a/modules/client_entergame/characterlist.lua +++ b/modules/client_entergame/characterlist.lua @@ -48,7 +48,7 @@ local function tryLogin(charInfo, tries) g_game.loginWorld(G.account, G.password, charInfo.worldName, charInfo.worldHost, charInfo.worldPort, charInfo.characterName, G.authenticatorToken, G.sessionKey) - loadBox = displayCancelBox(tr('Please wait'), tr('Connecting to game server...')) + loadBox = displayCancelBox(localize('CharacterListTitleConnecting'), localize('CharacterListMessageConnecting')) connect(loadBox, { onCancel = function() loadBox = nil @@ -74,7 +74,7 @@ local function updateWait(timeStart, timeEnd) progressBar:setPercent(percent) local label = waitingWindow:getChildById('timeLabel') - label:setText(tr('Trying to reconnect in %s seconds.', timeStr)) + label:setText(localize('CharacterListMessageReconnect', timeStr)) updateWaitEvent = scheduleEvent(function() updateWait(timeStart, timeEnd) @@ -141,7 +141,7 @@ end function onGameLoginError(message) CharacterList.destroyLoadBox() - errorBox = displayErrorBox(tr('Login Error'), message) + errorBox = displayErrorBox(localize('CharacterListTitleLoginError'), message) errorBox.onOk = function() errorBox = nil CharacterList.showAgain() @@ -157,7 +157,7 @@ function onGameConnectionError(message, code) CharacterList.destroyLoadBox() local text = translateNetworkError(code, g_game.getProtocolGame() and g_game.getProtocolGame():isConnecting(), message) - errorBox = displayErrorBox(tr('Connection Error'), text) + errorBox = displayErrorBox(localize('CharacterListTitleConnectionError'), text) errorBox.onOk = function() errorBox = nil CharacterList.showAgain() @@ -166,7 +166,7 @@ end function onGameUpdateNeeded(signature) CharacterList.destroyLoadBox() - errorBox = displayErrorBox(tr('Update needed'), tr('Enter with your account again to update your client.')) + errorBox = displayErrorBox(localize('CharacterListTitleUpdateRequired'), localize('CharacterListMessageUpdateRequired')) errorBox.onOk = function() errorBox = nil CharacterList.showAgain() @@ -303,7 +303,7 @@ function CharacterList.create(characters, account, otui) else local text = value if subWidget.baseText and subWidget.baseTranslate then - text = tr(subWidget.baseText, text) + text = localize(subWidget.baseText, text) elseif subWidget.baseText then text = string.format(subWidget.baseText, text) end @@ -376,21 +376,21 @@ function CharacterList.create(characters, account, otui) -- account local status = '' if account.status == AccountStatus.Frozen then - status = tr(' (Frozen)') + status = string.format(" (%s)", localize('CharacterListAccountFrozen')) elseif account.status == AccountStatus.Suspended then - status = tr(' (Suspended)') + status = string.format(" (%s)", localize('CharacterListAccountBanned')) end if account.subStatus == SubscriptionStatus.Free then - accountStatusLabel:setText(('%s%s'):format(tr('Free Account'), status)) + accountStatusLabel:setText(('%s%s'):format(localize('CharacterListAccountFree'), status)) if accountStatusIcon ~= nil then accountStatusIcon:setImageSource('/images/game/entergame/nopremium') end elseif account.subStatus == SubscriptionStatus.Premium then if account.premDays == 0 or account.premDays == 65535 then - accountStatusLabel:setText(('%s%s'):format(tr('Gratis Premium Account'), status)) + accountStatusLabel:setText(('%s%s'):format(localize('CharacterListAccountPremiumGratis'), status)) else - accountStatusLabel:setText(('%s%s'):format(tr('Premium Account (%s) days left', account.premDays), status)) + accountStatusLabel:setText(('%s%s'):format(localize('CharacterListAccountPremiumNormal', account.premDays), status)) end if accountStatusIcon ~= nil then accountStatusIcon:setImageSource('/images/game/entergame/premium') @@ -485,7 +485,7 @@ function CharacterList.doLogin() end tryLogin(charInfo) else - displayErrorBox(tr('Error'), tr('You must select a character to login!')) + displayErrorBox(localize('Error'), localize('CharacterListMessageNoCharacterSelected')) end end diff --git a/modules/client_entergame/characterlist.otui b/modules/client_entergame/characterlist.otui index 2ad106566d..ae2c777b5d 100644 --- a/modules/client_entergame/characterlist.otui +++ b/modules/client_entergame/characterlist.otui @@ -150,7 +150,7 @@ CharacterWidget < UIWidget MainWindow id: charactersWindow - !text: tr('Character List') + !text: localize('CharacterListWindowTitle') visible: false @onEnter: CharacterList.doLogin() @onEscape: CharacterList.hide(true) @@ -192,7 +192,7 @@ MainWindow width: 250 anchors.left: parent.left anchors.top: characters.top - !text: tr('Character') .. '' + !text: localize('CharacterListColumnPlayer') @onSetup: | if not(g_game.getFeature(GameEnterGameShowAppearance)) then self:hide() @@ -203,7 +203,7 @@ MainWindow anchors.left: parent.left anchors.top: characters.top margin-left: 250 - !text: tr('Status') .. '' + !text: localize('CharacterListColumnStatus') @onSetup: | if not(g_game.getFeature(GameEnterGameShowAppearance)) then self:hide() @@ -214,7 +214,7 @@ MainWindow anchors.left: parent.left anchors.top: characters.top margin-left: 350 - !text: tr('Level') .. '' + !text: localize('CharacterListColumnLevel') @onSetup: | if not(g_game.getFeature(GameEnterGameShowAppearance)) then self:hide() @@ -225,7 +225,7 @@ MainWindow anchors.left: parent.left anchors.top: characters.top margin-left: 410 - !text: tr('Vocation') .. '' + !text: localize('CharacterListColumnVocation') @onSetup: | if not(g_game.getFeature(GameEnterGameShowAppearance)) then self:hide() @@ -236,7 +236,7 @@ MainWindow anchors.right: characters.right anchors.top: characters.top margin-left: 550 - !text: tr('World') .. '' + !text: localize('CharacterListColumnWorld') @onSetup: | if not(g_game.getFeature(GameEnterGameShowAppearance)) then self:hide() @@ -293,7 +293,7 @@ MainWindow Label id: accountStatusCaption - !text: tr('Account Status') .. ':' + !text: localize('CharacterListAccountStatus') .. ':' anchors.left: parent.left anchors.right: parent.right anchors.bottom: next.top @@ -318,7 +318,7 @@ MainWindow Label id: accountStatusLabel - !text: tr('Free Account') + !text: localize('CharacterListAccountFree') anchors.left: parent.left text-auto-resize: true @onSetup: | @@ -361,7 +361,7 @@ MainWindow Button id: buttonOk - !text: tr('Ok') + !text: localize('UIButtonOk') width: 64 anchors.right: next.left anchors.bottom: parent.bottom @@ -370,7 +370,7 @@ MainWindow Button id: buttonCancel - !text: tr('Cancel') + !text: localize('UIButtonCancel') width: 64 anchors.right: parent.right anchors.bottom: parent.bottom diff --git a/modules/client_entergame/entergame.lua b/modules/client_entergame/entergame.lua index 019440830f..210d8154fb 100644 --- a/modules/client_entergame/entergame.lua +++ b/modules/client_entergame/entergame.lua @@ -20,7 +20,7 @@ local function onError(protocol, message, errorCode) EnterGame.clearAccountFields() end - local errorBox = displayErrorBox(tr('Login Error'), message) + local errorBox = displayErrorBox(localize('CharacterListTitleLoginError'), message) connect(errorBox, { onOk = EnterGame.show }) @@ -82,7 +82,7 @@ local function onCharacterList(protocol, characters, account, otui) local lastMotdNumber = g_settings.getNumber('motd') if G.motdNumber and G.motdNumber ~= lastMotdNumber then g_settings.set('motd', G.motdNumber) - motdWindow = displayInfoBox(tr('Message of the day'), G.motdMessage) + motdWindow = displayInfoBox(localize('CharacterListMotd'), G.motdMessage) connect(motdWindow, { onOk = function() CharacterList.show() @@ -105,7 +105,7 @@ local function onUpdateNeeded(protocol, signature) local cancelFunc = EnterGame.show EnterGame.updateFunc(signature, continueFunc, cancelFunc) else - local errorBox = displayErrorBox(tr('Update needed'), tr('Your client needs updating, try redownloading it.')) + local errorBox = displayErrorBox(localize('CharacterListTitleUpdateRequired'), localize('CharacterListMessageUpdateNeeded')) connect(errorBox, { onOk = EnterGame.show }) @@ -114,13 +114,13 @@ end local function updateLabelText() if enterGame:getChildById('clientComboBox') and tonumber(enterGame:getChildById('clientComboBox'):getText()) > 1080 then - enterGame:setText("Journey Onwards") - enterGame:getChildById('emailLabel'):setText("Email:") - enterGame:getChildById('rememberEmailBox'):setText("Remember Email:") + enterGame:setText(localize('EnterGameTitleNew')) + enterGame:getChildById('emailLabel'):setText(localize('EnterGameEmail') .. ":") + enterGame:getChildById('rememberEmailBox'):setText(localize('EnterGameRememberEmail') .. ":") else - enterGame:setText("Enter Game") - enterGame:getChildById('emailLabel'):setText("Acc Name:") - enterGame:getChildById('rememberEmailBox'):setText("Remember password:") + enterGame:setText(localize('EnterGameTitleOld')) + enterGame:getChildById('emailLabel'):setText(localize('EnterGameAccName') .. ":") + enterGame:getChildById('rememberEmailBox'):setText(localize('EnterGameRememberPassword') .. ":") end end @@ -571,7 +571,7 @@ function EnterGame.tryHttpLogin(clientVersion, httpLogin) loadBox = nil end - local errorBox = displayErrorBox(tr("Login Error"), string.format("Things are not loaded, please put assets in things/%d/.", clientVersion)) + local errorBox = displayErrorBox(localize('CharacterListTitleLoginError'), localize('EnterGameThingsErrorAssets', clientVersion)) connect(errorBox, { onOk = EnterGame.show }) @@ -597,10 +597,12 @@ function EnterGame.tryHttpLogin(clientVersion, httpLogin) end if not host then - loadBox = displayCancelBox(tr('Please wait'), tr('ERROR , try adding \n- ip/login.php \n- Enable HTTP login')) + loadBox = displayCancelBox(localize('CharacterListTitleConnectionError'), localize('EnterGameHttpError')) else - loadBox = displayCancelBox(tr('Please wait'), tr('Connecting to login server...\nServer: [%s]', - host .. ":" .. tostring(G.port) .. path)) + loadBox = displayCancelBox( + localize('CharacterListTitleConnecting'), + localize('EnterGameMessageConnectingHttp', host .. ":" .. tostring(G.port) .. path) + ) end connect(loadBox, { @@ -703,7 +705,7 @@ function EnterGame.doLogin() EnterGame.hide() if g_game.isOnline() then - local errorBox = displayErrorBox(tr('Login Error'), tr('Cannot login while already in game.')) + local errorBox = displayErrorBox(localize('CharacterListTitleLoginError'), localize('EnterGameMessageAlreadyLogged')) connect(errorBox, { onOk = EnterGame.show }) @@ -724,7 +726,7 @@ function EnterGame.doLogin() protocolLogin.onCharacterList = onCharacterList protocolLogin.onUpdateNeeded = onUpdateNeeded - loadBox = displayCancelBox(tr('Please wait'), tr('Connecting to login server...')) + loadBox = displayCancelBox(localize('CharacterListTitleConnecting'), localize('EnterGameMessageConnecting')) connect(loadBox, { onCancel = function(msgbox) loadBox = nil @@ -745,7 +747,7 @@ function EnterGame.doLogin() loadBox = nil end - local errorBox = displayErrorBox(tr("Login Error"), string.format("Things are not loaded, please put spr and dat in things/%d/.", clientVersion)) + local errorBox = displayErrorBox(localize('CharacterListTitleLoginError'), localize('EnterGameThingsErrorSprites', clientVersion)) connect(errorBox, { onOk = EnterGame.show }) @@ -756,7 +758,7 @@ end function EnterGame.displayMotd() if not motdWindow then - motdWindow = displayInfoBox(tr('Message of the day'), G.motdMessage) + motdWindow = displayInfoBox(localize('CharacterListMotd'), G.motdMessage) motdWindow.onOk = function() motdWindow = nil end diff --git a/modules/client_entergame/entergame.otui b/modules/client_entergame/entergame.otui index 057f3f724a..b273c29d19 100644 --- a/modules/client_entergame/entergame.otui +++ b/modules/client_entergame/entergame.otui @@ -1,5 +1,5 @@ EnterGameWindow < MainWindow - !text: tr('Enter Game') + !text: localize('EnterGameTitleOld') size: 236 316 @@ -34,7 +34,7 @@ EnterGameWindow Label id: emailLabel - !text: tr('Acc Name:') + !text: localize('EnterGameAccName') .. ":" anchors.left: parent.left anchors.top: parent.top @@ -43,7 +43,7 @@ EnterGameWindow Label id: passwordLabel - !text: tr('Password:') + !text: localize('EnterGamePassword') .. ":" anchors.left: emailLabel.left anchors.top: emailLabel.bottom margin-top: 10 @@ -64,8 +64,8 @@ EnterGameWindow QtCheckBox id: rememberEmailBox - !text: tr('Remember password') - !tooltip: tr('Remember account and password when starts client') + !text: localize('EnterGameRememberPassword') + !tooltip: localize('EnterGameTooltipRememberPassword') anchors.left: passwordLabel.left anchors.right: parent.right anchors.top: accountPasswordTextEdit.bottom @@ -78,7 +78,7 @@ EnterGameWindow UIWidget id: rememberEmailTip image-source: /images/icons/show_gui_help_grey - !specialtooltip: 'Be aware that your email address will be stored on your configuration file "config.otml" if you activate this option.' + !specialtooltip: localize('EnterGameTooltipRememberEmail') anchors.right: accountNameTextEdit.right anchors.verticalCenter: rememberEmailBox.verticalCenter visible: false @@ -90,7 +90,7 @@ EnterGameWindow visible: false UIButton - !text: tr('Forgot password and/or email') + !text: localize('EnterGameButtonAccountLost') id: Forgot_password_email font: verdana-11px-monochrome-underline text-align: left @@ -110,7 +110,7 @@ EnterGameWindow MenuLabel id: authenticatorTokenLabel - !text: tr('Authenticator Token') + !text: localize('EnterGameAuthenticatorToken') anchors.left: prev.left anchors.top: prev.bottom text-auto-resize: true @@ -136,7 +136,7 @@ EnterGameWindow QtCheckBox id: stayLoggedBox - !text: tr('Stay logged during session') + !text: localize('EnterGameCheckboxKeepSession') anchors.left: parent.left anchors.right: parent.right anchors.top: prev.bottom @@ -156,7 +156,7 @@ EnterGameWindow MenuLabel id: serverLabel - !text: tr('Server') + !text: localize('EnterGameLabelServer') anchors.left: prev.left anchors.top: prev.bottom margin-top: 8 @@ -164,7 +164,7 @@ EnterGameWindow ServerListButton id: serverListButton - !tooltip: tr('Server list') + !tooltip: localize('EnterGameTitleServerList') anchors.right: parent.right anchors.top: serverLabel.bottom margin-top: 3 @@ -172,7 +172,7 @@ EnterGameWindow TextEdit id: serverHostTextEdit - !tooltip: tr('Make sure that your client uses\nthe correct game client version') + !tooltip: localize('EnterGameLabelServerList') anchors.left: parent.left anchors.right: serverListButton.left anchors.top: serverLabel.bottom @@ -181,7 +181,7 @@ EnterGameWindow MenuLabel id: clientLabel - !text: tr('Client Version') + !text: localize('EnterGameClientVersion') anchors.left: parent.left anchors.top: serverHostTextEdit.bottom text-auto-resize: true @@ -202,7 +202,7 @@ EnterGameWindow MenuLabel id: portLabel - !text: tr('Port') + !text: localize('EnterGameClientPort') anchors.left: serverPortTextEdit.left anchors.top: serverHostTextEdit.bottom margin-top: 8 @@ -219,8 +219,8 @@ EnterGameWindow QtCheckBox id: autoLoginBox enabled: false - !text: tr('Auto login') - !tooltip: tr('Open charlist automatically when starting client') + !text: localize('EnterGameCheckboxAutoLogin') + !tooltip: localize('EnterGameTooltipAutoLogin') anchors.left: parent.left anchors.right: parent.right anchors.top: prev.bottom @@ -229,8 +229,8 @@ EnterGameWindow QtCheckBox id: httpLoginBox enabled: true - !text: tr('Enable HTTP login') - !tooltip: tr('If login fails using HTTPS (encrypted) try with HTTP (unencrypted)') + !text: localize('EnterGameCheckboxHttpLogin') + !tooltip: localize('EnterGameTooltipHttpLogin') anchors.left: parent.left anchors.right: parent.right anchors.top: prev.bottom @@ -243,7 +243,7 @@ EnterGameWindow margin-top: 6 QtButton - !text: tr('Login') + !text: localize('EnterGameButtonLogin') anchors.right: parent.right anchors.top: prev.bottom margin-top: 9 @@ -251,7 +251,7 @@ EnterGameWindow @onClick: EnterGame.doLogin() QtButton - !text: tr('Create New Account') + !text: localize('EnterGameButtonCreateAccount') anchors.left: parent.left anchors.top: prev.bottom margin-top: -17 diff --git a/modules/client_entergame/waitinglist.otui b/modules/client_entergame/waitinglist.otui index d2cc66d112..897416b1a6 100644 --- a/modules/client_entergame/waitinglist.otui +++ b/modules/client_entergame/waitinglist.otui @@ -1,6 +1,6 @@ MainWindow id: waitingWindow - !text: tr('Waiting List') + !text: localize('EnterGameTitleWaitList') size: 260 180 draggable: false @onEscape: CharacterList.cancelWait() @@ -38,7 +38,7 @@ MainWindow Button id: buttonCancel - !text: tr('Cancel') + !text: localize('UIButtonCancel') width: 64 anchors.right: parent.right anchors.bottom: parent.bottom diff --git a/modules/client_locales/locales.otui b/modules/client_locales/locales.otui index 6b5c33e5f5..47adc07ccd 100644 --- a/modules/client_locales/locales.otui +++ b/modules/client_locales/locales.otui @@ -16,7 +16,7 @@ UIWindow anchors.fill: parent LocalesMainLabel - !text: tr('Select your language') + !text: localize('LanguagePickerWindowMessage') text-auto-resize: true anchors.horizontalCenter: parent.horizontalCenter anchors.verticalCenter: parent.verticalCenter From 9394543433b2a8ffe0e90cb83b78ed5d15a0ed75 Mon Sep 17 00:00:00 2001 From: Zbizu Date: Tue, 28 Jan 2025 18:26:00 +0100 Subject: [PATCH 5/8] more translations --- data/locales/en.lua | 73 +++++++++++++++++++++++++++ modules/game_skills/skills.lua | 37 +++++++------- modules/game_skills/skills.otui | 58 ++++++++++----------- modules/game_spelllist/spelllist.lua | 2 +- modules/game_spelllist/spelllist.otui | 64 +++++++++++------------ 5 files changed, 153 insertions(+), 81 deletions(-) diff --git a/data/locales/en.lua b/data/locales/en.lua index 793326a2bc..271dab138a 100644 --- a/data/locales/en.lua +++ b/data/locales/en.lua @@ -265,6 +265,79 @@ locale:translate("ItemSelectorWindowTitle", "Select Item") locale:translate("MinimapWindowTitleSetMark", "Create Map Mark") locale:translate("MinimapButtonCenter", "Center") +-- skills +locale:translate("SkillsWindowTitle", "Skills") +locale:translate("SkillsWindowTooltipPercentNeeded", "You have %1 percent to go") +locale:translate("SkillsWindowTooltipExperienceNeeded", "%1 of experience left") +locale:translate("SkillsWindowTooltipExperiencePerHour", "%1 of experience per hour") +locale:translate("SkillsWindowTooltipTimeToLevelUp", "Next level in %1 hours and %2 minutes") +locale:translate("SkillsWindowTooltipStaminaTimeLeft", "You have %1 hours and %2 minutes left") +locale:translate("SkillsWindowTooltipXPBoostTimeLeft", "You have %1 hours and %2 minutes left") +locale:translate("SkillsWindowTooltipXPBoostBonus", "Now you will gain 50%% more experience") +locale:translate("SkillsWindowTooltipStaminaPremiumOnly", "You will not gain 50%% more experience because you aren't premium player, now you receive only 1x experience points") +locale:translate("SkillsWindowTooltipStaminaPremiumActive", "If you are premium player, you will gain 50%% more experience") +locale:translate("SkillsWindowTooltipStaminaLow", "You gain only 50%% experience and you don't may gain loot from monsters") +locale:translate("SkillsWindowTooltipStaminaZero", "You don't may receive experience and loot from monsters") +locale:translate("SkillsWindowOfflineTimePercentLeft", "You have %1 percent") + +-- these are translations for general stats that might be reused +locale:translate("StatExperience", "Experience") +locale:translate("StatLevel", "Level") +locale:translate("StatHealth", "Hit Points") +locale:translate("StatMana", "Mana") +locale:translate("StatSoul", "Soul Points") +locale:translate("StatCapacity", "Capacity") +locale:translate("StatSpeed", "Speed") +locale:translate("StatRegeneration", "Regeneration Time") +locale:translate("StatStamina", "Stamina") +locale:translate("StatOfflineTraining", "Offline Training") +locale:translate("StatMitigation", "Mitigation") +locale:translate("SkillMagicLevel", "Magic Level") +locale:translate("SkillFist", "Fist Fighting") +locale:translate("SkillClub", "Club Fighting") +locale:translate("SkillSword", "Sword Fighting") +locale:translate("SkillAxe", "Axe Fighting") +locale:translate("SkillDistance", "Distance Fighting") +locale:translate("SkillShielding", "Shielding") +locale:translate("SkillFishing", "Fishing") +locale:translate("SkillCriticalHitChance", "Critical Hit Chance") +locale:translate("SkillCriticalHitDamage", "Critical Hit Damage") +locale:translate("SkillLifeLeechChance", "Life Leech Chance") +locale:translate("SkillLifeLeechPercent", "Life Leech Amount") +locale:translate("SkillManaLeechChance", "Mana Leech Chance") +locale:translate("SkillManaLeechPercent", "Mana Leech Amount") +locale:translate("SkillOnslaught", "Onslaught") +locale:translate("SkillRuse", "Ruse") +locale:translate("SkillMomentum", "Momentum") +locale:translate("SkillTranscendence", "Transcendence") + +-- spell list +locale:translate("SpellListWindowTitle", "Spell List") +locale:translate("SpellListLabelName", "Name") +locale:translate("SpellListLabelFilters", "Filters") +locale:translate("SpellListLabelLevel", "Level") +locale:translate("SpellListLabelVocation", "Vocation") +locale:translate("SpellListLabelFormula", "Formula") +locale:translate("SpellListLabelGroup", "Group") +locale:translate("SpellListLabelType", "Type") +locale:translate("SpellListLabelCooldown", "Cooldown") +locale:translate("SpellListLabelMana", "Mana") +locale:translate("SpellListLabelSoul", "Soul") +locale:translate("SpellListLabelPremium", "Premium") +locale:translate("SpellListLabelDescription", "Description") +locale:translate("SpellListLabelVocationAny", "Any") +locale:translate("SpellListLabelVocationSorcerer", "Sorcerer") +locale:translate("SpellListLabelVocationDruid", "Druid") +locale:translate("SpellListLabelVocationPaladin", "Paladin") +locale:translate("SpellListLabelVocationKnight", "Knight") +locale:translate("SpellListLabelTypeAny", "Any") +locale:translate("SpellListLabelTypeAttack", "Attack") +locale:translate("SpellListLabelTypeHealing", "Healing") +locale:translate("SpellListLabelTypeSupport", "Support") +locale:translate("SpellListLabelTypeFreeOrPremium", "Any") +locale:translate("SpellListTooltipLevel", "Hide spells for higher exp. levels") +locale:translate("SpellListTooltipVocation", "Hide spells for other vocations") + -- stash locale:translate("StashWindowTitle", "Supply Stash") locale:translate("StashWindowWithdraw", "Stash Withdraw") diff --git a/modules/game_skills/skills.lua b/modules/game_skills/skills.lua index 7c9294b383..9418364ea3 100644 --- a/modules/game_skills/skills.lua +++ b/modules/game_skills/skills.lua @@ -26,7 +26,7 @@ function init() onGameEnd = offline }) - skillsButton = modules.game_mainpanel.addToggleButton('skillsButton', tr('Skills') .. ' (Alt+S)', + skillsButton = modules.game_mainpanel.addToggleButton('skillsButton', localize('SkillsWindowTitle') .. ' (Alt+S)', '/images/options/button_skills', toggle, false, 1) skillsButton:setOn(true) skillsWindow = g_ui.loadUI('skills') @@ -413,8 +413,8 @@ end function onLevelChange(localPlayer, value, percent) setSkillValue('level', comma_value(value)) - local text = tr('You have %s percent to go', 100 - percent) .. '\n' .. - tr('%s of experience left', expToAdvance(localPlayer:getLevel(), localPlayer:getExperience())) + local text = localize('SkillsWindowTooltipPercentNeeded', 100 - percent) .. '\n' .. + localize('SkillsWindowTooltipExperienceNeeded', expToAdvance(localPlayer:getLevel(), localPlayer:getExperience())) if localPlayer.expSpeed ~= nil then local expPerHour = math.floor(localPlayer.expSpeed * 3600) @@ -423,8 +423,8 @@ function onLevelChange(localPlayer, value, percent) local hoursLeft = (nextLevelExp - localPlayer:getExperience()) / expPerHour local minutesLeft = math.floor((hoursLeft - math.floor(hoursLeft)) * 60) hoursLeft = math.floor(hoursLeft) - text = text .. '\n' .. tr('%s of experience per hour', comma_value(expPerHour)) - text = text .. '\n' .. tr('Next level in %d hours and %d minutes', hoursLeft, minutesLeft) + text = text .. '\n' .. localize('SkillsWindowTooltipExperiencePerHour', comma_value(expPerHour)) + text = text .. '\n' .. localize('SkillsWindowTooltipTimeToLevelUp', hoursLeft, minutesLeft) end end @@ -466,26 +466,25 @@ function onStaminaChange(localPlayer, stamina) -- TODO not all client versions have premium time if stamina > 2400 and g_game.getClientVersion() >= 1038 and localPlayer:isPremium() then - local text = tr('You have %s hours and %s minutes left', hours, minutes) .. '\n' .. - tr('Now you will gain 50%% more experience') + local text = localize('SkillsWindowTooltipXPBoostTimeLeft', hours, minutes) .. '\n' .. + localize('SkillsWindowTooltipXPBoostBonus') setSkillPercent('stamina', percent, text, 'green') elseif stamina > 2400 and g_game.getClientVersion() >= 1038 and not localPlayer:isPremium() then - local text = tr('You have %s hours and %s minutes left', hours, minutes) .. '\n' .. tr( - 'You will not gain 50%% more experience because you aren\'t premium player, now you receive only 1x experience points') + local text = localize('SkillsWindowTooltipStaminaTimeLeft', hours, minutes) .. '\n' .. localize('SkillsWindowTooltipStaminaPremiumOnly') setSkillPercent('stamina', percent, text, '#89F013') elseif stamina >= 2400 and g_game.getClientVersion() < 1038 then - local text = tr('You have %s hours and %s minutes left', hours, minutes) .. '\n' .. - tr('If you are premium player, you will gain 50%% more experience') + local text = localize('SkillsWindowTooltipStaminaTimeLeft', hours, minutes) .. '\n' .. + localize('SkillsWindowTooltipStaminaPremiumActive') setSkillPercent('stamina', percent, text, 'green') elseif stamina < 2400 and stamina > 840 then - setSkillPercent('stamina', percent, tr('You have %s hours and %s minutes left', hours, minutes), 'orange') + setSkillPercent('stamina', percent, localize('SkillsWindowTooltipStaminaTimeLeft', hours, minutes), 'orange') elseif stamina <= 840 and stamina > 0 then - local text = tr('You have %s hours and %s minutes left', hours, minutes) .. '\n' .. - tr('You gain only 50%% experience and you don\'t may gain loot from monsters') + local text = localize('SkillsWindowTooltipStaminaTimeLeft', hours, minutes) .. '\n' .. + localize('SkillsWindowTooltipStaminaLow') setSkillPercent('stamina', percent, text, 'red') elseif stamina == 0 then - local text = tr('You have %s hours and %s minutes left', hours, minutes) .. '\n' .. - tr('You don\'t may receive experience and loot from monsters') + local text = localize('SkillsWindowTooltipStaminaTimeLeft', hours, minutes) .. '\n' .. + localize('SkillsWindowTooltipStaminaZero') setSkillPercent('stamina', percent, text, 'black') end end @@ -502,7 +501,7 @@ function onOfflineTrainingChange(localPlayer, offlineTrainingTime) local percent = 100 * offlineTrainingTime / (12 * 60) -- max is 12 hours setSkillValue('offlineTraining', hours .. ':' .. minutes) - setSkillPercent('offlineTraining', percent, tr('You have %s percent', percent)) + setSkillPercent('offlineTraining', percent, localize('SkillsWindowOfflineTimePercentLeft', percent)) end function onRegenerationChange(localPlayer, regenerationTime) @@ -531,7 +530,7 @@ end function onMagicLevelChange(localPlayer, magiclevel, percent) setSkillValue('magiclevel', magiclevel) - setSkillPercent('magiclevel', percent, tr('You have %s percent to go', 100 - percent)) + setSkillPercent('magiclevel', percent, localize('SkillsWindowTooltipPercentNeeded', 100 - percent)) onBaseMagicLevelChange(localPlayer, localPlayer:getBaseMagicLevel()) end @@ -542,7 +541,7 @@ end function onSkillChange(localPlayer, id, level, percent) setSkillValue('skillId' .. id, level) - setSkillPercent('skillId' .. id, percent, tr('You have %s percent to go', 100 - percent)) + setSkillPercent('skillId' .. id, percent, localize('SkillsWindowTooltipPercentNeeded', 100 - percent)) onBaseSkillChange(localPlayer, id, localPlayer:getSkillBaseLevel(id)) diff --git a/modules/game_skills/skills.otui b/modules/game_skills/skills.otui index eb66b77821..5a0d7c2ed0 100644 --- a/modules/game_skills/skills.otui +++ b/modules/game_skills/skills.otui @@ -55,7 +55,7 @@ SkillPercentPanel < ProgressBar MiniWindow id: skillWindow - !text: tr('Skills') + !text: localize('SkillsWindowTitle') height: 150 icon: /images/topbuttons/skills @onOpen: modules.game_skills.onMiniWindowOpen() @@ -72,13 +72,13 @@ MiniWindow id: experience height: 15 SkillNameLabel - !text: tr('Experience') + !text: localize('StatExperience') SkillValueLabel SkillButton id: level SkillNameLabel - !text: tr('Level') + !text: localize('StatLevel') SkillValueLabel RedPercentPanel @@ -86,61 +86,61 @@ MiniWindow id: health height: 15 SkillNameLabel - !text: tr('Hit Points') + !text: localize('StatHealth') SkillValueLabel SkillButton id: mana height: 15 SkillNameLabel - !text: tr('Mana') + !text: localize('StatMana') SkillValueLabel SkillButton id: soul height: 15 SkillNameLabel - !text: tr('Soul Points') + !text: localize('StatSoul') SkillValueLabel SkillButton id: capacity height: 15 SkillNameLabel - !text: tr('Capacity') + !text: localize('StatCapacity') SkillValueLabel SkillButton id: speed height: 15 SkillNameLabel - !text: tr('Speed') + !text: localize('StatSpeed') SkillValueLabel SkillButton id: regenerationTime SkillNameLabel - !text: tr('Regeneration Time') + !text: localize('StatRegeneration') SkillValueLabel SkillButton id: stamina SkillNameLabel - !text: tr('Stamina') + !text: localize('StatStamina') SkillValueLabel RedPercentPanel SkillButton id: offlineTraining SkillNameLabel - !text: tr('Offline Training') + !text: localize('StatOfflineTraining') SkillValueLabel RedPercentPanel SkillButton id: magiclevel SkillNameLabel - !text: tr('Magic Level') + !text: localize('SkillMagicLevel') SkillValueLabel ImageSkill image-source: /images/icons/icon_magic @@ -151,7 +151,7 @@ MiniWindow SkillButton id: skillId0 SkillNameLabel - !text: tr('Fist Fighting') + !text: localize('SkillFist') SkillValueLabel ImageSkill image-source: /images/icons/icon_fist @@ -161,7 +161,7 @@ MiniWindow SkillButton id: skillId1 SkillNameLabel - !text: tr('Club Fighting') + !text: localize('SkillClub') SkillValueLabel ImageSkill image-source: /images/icons/icon_club @@ -171,7 +171,7 @@ MiniWindow SkillButton id: skillId2 SkillNameLabel - !text: tr('Sword Fighting') + !text: localize('SkillSword') SkillValueLabel ImageSkill image-source: /images/icons/icon_sword @@ -181,7 +181,7 @@ MiniWindow SkillButton id: skillId3 SkillNameLabel - !text: tr('Axe Fighting') + !text: localize('SkillAxe') SkillValueLabel ImageSkill image-source: /images/icons/icon_axe @@ -191,7 +191,7 @@ MiniWindow SkillButton id: skillId4 SkillNameLabel - !text: tr('Distance Fighting') + !text: localize('SkillDistance') SkillValueLabel ImageSkill image-source: /images/icons/icon_distance @@ -201,7 +201,7 @@ MiniWindow SkillButton id: skillId5 SkillNameLabel - !text: tr('Shielding') + !text: localize('SkillShielding') SkillValueLabel ImageSkill image-source: /images/icons/icon_shielding @@ -211,7 +211,7 @@ MiniWindow SkillButton id: skillId6 SkillNameLabel - !text: tr('Fishing') + !text: localize('SkillFishing') SkillValueLabel ImageSkill image-source: /images/icons/icon_fishing @@ -225,59 +225,59 @@ MiniWindow SmallSkillButton id: skillId7 SkillNameLabel - !text: tr('Critical Hit Chance') + !text: localize('SkillCriticalHitChance') SkillValueLabel SmallSkillButton id: skillId8 SkillNameLabel - !text: tr('Critical Hit Damage') + !text: localize('SkillCriticalHitDamage') SkillValueLabel SmallSkillButton id: skillId9 SkillNameLabel - !text: tr('Life Leech Chance') + !text: localize('SkillLifeLeechChance') SkillValueLabel SmallSkillButton id: skillId10 SkillNameLabel - !text: tr('Life Leech Amount') + !text: localize('SkillLifeLeechPercent') SkillValueLabel SmallSkillButton id: skillId11 SkillNameLabel - !text: tr('Mana Leech Chance') + !text: localize('SkillManaLeechChance') SkillValueLabel SmallSkillButton id: skillId12 SkillNameLabel - !text: tr('Mana Leech Amount') + !text: localize('SkillManaLeechPercent') SkillValueLabel SmallSkillButton id: skillId13 SkillNameLabel - !text: tr('Fatal') + !text: localize('SkillOnslaught') SkillValueLabel SmallSkillButton id: skillId14 SkillNameLabel - !text: tr('Dodge') + !text: localize('SkillRuse') SkillValueLabel SmallSkillButton id: skillId15 SkillNameLabel - !text: tr('Momentum') + !text: localize('SkillMomentum') SkillValueLabel SmallSkillButton id: skillId16 SkillNameLabel - !text: tr('Transcendence') + !text: localize('SkillTranscendence') SkillValueLabel diff --git a/modules/game_spelllist/spelllist.lua b/modules/game_spelllist/spelllist.lua index 787ed76548..abe363e339 100644 --- a/modules/game_spelllist/spelllist.lua +++ b/modules/game_spelllist/spelllist.lua @@ -105,7 +105,7 @@ function init() spelllistWindow = g_ui.displayUI('spelllist', modules.game_interface.getRightPanel()) spelllistWindow:hide() - spelllistButton = modules.game_mainpanel.addToggleButton('spelllistButton', tr('Spell List'), + spelllistButton = modules.game_mainpanel.addToggleButton('spelllistButton', localize('SpellListWindowTitle'), '/images/options/button_spells', toggle, false, 4) spelllistButton:setOn(false) diff --git a/modules/game_spelllist/spelllist.otui b/modules/game_spelllist/spelllist.otui index 7bbc46b296..68486be02e 100644 --- a/modules/game_spelllist/spelllist.otui +++ b/modules/game_spelllist/spelllist.otui @@ -38,7 +38,7 @@ FilterButton < Button MainWindow id: spelllistWindow - !text: tr('Spell List') + !text: localize('SpellListWindowTitle') size: 550 400 @onEscape: toggle() @@ -55,7 +55,7 @@ MainWindow Button id: buttonCancel - !text: tr('Close') + !text: localize('UIButtonClose') width: 64 anchors.right: parent.right anchors.bottom: parent.bottom @@ -73,78 +73,78 @@ MainWindow id: labelName anchors.left: spellList.right anchors.top: spellList.top - !text: tr('Name') .. ':' + !text: localize('SpellListLabelName') .. ':' Label anchors.left: parent.left anchors.top: spellList.bottom - !text: tr('Filters') .. ':' + !text: localize('SpellListLabelFilters') .. ':' margin-top: 8 FilterButton id: buttonFilterLevel - !text: tr('Level') - !tooltip: tr('Hide spells for higher exp. levels') + !text: localize('SpellListLabelLevel') + !tooltip: localize('SpellListTooltipLevel') FilterButton id: buttonFilterVocation - !text: tr('Vocation') - !tooltip: tr('Hide spells for other vocations') + !text: localize('SpellListLabelVocation') + !tooltip: localize('SpellListTooltipVocation') SpellInfoLabel id: labelFormula anchors.left: spellList.right anchors.top: labelName.bottom - !text: tr('Formula') .. ':' + !text: localize('SpellListLabelFormula') .. ':' SpellInfoLabel id: labelVocation anchors.left: spellList.right anchors.top: labelFormula.bottom - !text: tr('Vocation') .. ':' + !text: localize('SpellListLabelVocation') .. ':' SpellInfoLabel id: labelGroup anchors.left: spellList.right anchors.top: labelVocation.bottom - !text: tr('Group') .. ':' + !text: localize('SpellListLabelGroup') .. ':' SpellInfoLabel id: labelType anchors.left: spellList.right anchors.top: labelGroup.bottom - !text: tr('Type') .. ':' + !text: localize('SpellListLabelType') .. ':' SpellInfoLabel id: labelCooldown anchors.left: spellList.right anchors.top: labelType.bottom - !text: tr('Cooldown') .. ':' + !text: localize('SpellListLabelCooldown') .. ':' SpellInfoLabel id: labelLevel anchors.left: spellList.right anchors.top: labelCooldown.bottom - !text: tr('Level') .. ':' + !text: localize('SpellListLabelLevel') .. ':' SpellInfoLabel id: labelMana anchors.left: spellList.right anchors.top: labelLevel.bottom - !text: tr('Mana') .. ' / ' .. tr('Soul') .. ':' + !text: localize('SpellListLabelMana') .. ' / ' .. localize('SpellListLabelSoul') .. ':' SpellInfoLabel id: labelPremium anchors.left: spellList.right anchors.top: labelMana.bottom - !text: tr('Premium') .. ':' + !text: localize('SpellListLabelPremium') .. ':' SpellInfoLabel id: labelDescription anchors.left: spellList.right anchors.top: labelPremium.bottom - !text: tr('Description') .. ':' + !text: localize('SpellListLabelDescription') .. ':' SpellInfoValueLabel id: labelNameValue @@ -202,7 +202,7 @@ MainWindow anchors.left: spellList.right width: 70 font: verdana-11px-monochrome - !text: tr('Vocation') + !text: localize('SpellListLabelVocation') margin-top: 30 margin-left: 20 @@ -212,7 +212,7 @@ MainWindow anchors.top: prev.bottom margin-top: 3 margin-left: 3 - !text: tr('Any') + !text: localize('SpellListLabelVocationAny') width: 75 CheckBox @@ -220,7 +220,7 @@ MainWindow anchors.left: prev.left anchors.top: prev.bottom margin-top: 3 - !text: tr('Sorcerer') + !text: localize('SpellListLabelVocationSorcerer') width: 75 CheckBox @@ -228,7 +228,7 @@ MainWindow anchors.left: prev.left anchors.top: prev.bottom margin-top: 3 - !text: tr('Druid') + !text: localize('SpellListLabelVocationDruid') width: 75 CheckBox @@ -236,7 +236,7 @@ MainWindow anchors.left: prev.left anchors.top: prev.bottom margin-top: 3 - !text: tr('Paladin') + !text: localize('SpellListLabelVocationPaladin') width: 75 CheckBox @@ -244,7 +244,7 @@ MainWindow anchors.left: prev.left anchors.top: prev.bottom margin-top: 3 - !text: tr('Knight') + !text: localize('SpellListLabelVocationKnight') width: 75 Label @@ -253,7 +253,7 @@ MainWindow anchors.left: labelVocationFilter.right width: 70 font: verdana-11px-monochrome - !text: tr('Group') + !text: localize('SpellListLabelGroup') margin-top: 30 margin-left: 20 @@ -263,7 +263,7 @@ MainWindow anchors.top: prev.bottom margin-top: 3 margin-left: 3 - !text: tr('Any') + !text: localize('SpellListLabelTypeAny') width: 75 CheckBox @@ -271,7 +271,7 @@ MainWindow anchors.left: prev.left anchors.top: prev.bottom margin-top: 3 - !text: tr('Attack') + !text: localize('SpellListLabelTypeAttack') width: 75 CheckBox @@ -279,7 +279,7 @@ MainWindow anchors.left: prev.left anchors.top: prev.bottom margin-top: 3 - !text: tr('Healing') + !text: localize('SpellListLabelTypeHealing') width: 75 CheckBox @@ -287,7 +287,7 @@ MainWindow anchors.left: prev.left anchors.top: prev.bottom margin-top: 3 - !text: tr('Support') + !text: localize('SpellListLabelTypeSupport') width: 75 Label @@ -296,7 +296,7 @@ MainWindow anchors.left: labelGroupFilter.right width: 70 font: verdana-11px-monochrome - !text: tr('Premium') + !text: localize('SpellListLabelPremium') margin-top: 30 margin-left: 20 @@ -306,7 +306,7 @@ MainWindow anchors.top: prev.bottom margin-top: 3 margin-left: 3 - !text: tr('Any') + !text: localize('SpellListLabelTypeFreeOrPremium') width: 75 CheckBox @@ -314,7 +314,7 @@ MainWindow anchors.left: prev.left anchors.top: prev.bottom margin-top: 3 - !text: tr('No') + !text: localize('UIButtonNo') width: 75 CheckBox @@ -322,5 +322,5 @@ MainWindow anchors.left: prev.left anchors.top: prev.bottom margin-top: 3 - !text: tr('Yes') + !text: localize('UIButtonYes') width: 75 From cba91e7b7f0820f7bdb4e7e174acdbf65132f1df Mon Sep 17 00:00:00 2001 From: Zbizu Date: Tue, 28 Jan 2025 18:41:21 +0100 Subject: [PATCH 6/8] translate ok and cancel buttons --- modules/client_options/options.otui | 2 +- modules/client_options/styles/controls/key_edit.otui | 6 +++--- modules/client_options/styles/controls/preset.otui | 2 +- modules/client_serverlist/addserver.otui | 2 +- modules/client_serverlist/serverlist.otui | 2 +- modules/corelib/ui/uiinputbox.lua | 4 ++-- modules/game_actionbar/edit_hotkey.otui | 4 ++-- modules/game_bugreport/bugreport.otui | 2 +- modules/game_console/channelswindow.otui | 2 +- modules/game_console/communicationwindow.otui | 2 +- modules/game_console/console.lua | 2 +- modules/game_console/violationwindow.otui | 4 ++-- modules/game_cyclopedia/game_cyclopedia.otui | 2 +- modules/game_cyclopedia/tab/house/house.otui | 12 ++++++------ modules/game_highscore/game_highscore.otui | 2 +- modules/game_hotkeys/hotkeys_manager.otui | 6 +++--- modules/game_imbuing/imbuing.otui | 2 +- modules/game_interface/gameinterface.lua | 2 +- modules/game_interface/styles/countwindow.otui | 4 ++-- modules/game_market/market.otui | 2 +- modules/game_market/ui/general/amountwindow.otui | 4 ++-- modules/game_market/ui/myoffers/currentoffers.otui | 4 ++-- modules/game_npctrade/npctrade.otui | 2 +- modules/game_playerdeath/deathwindow.otui | 4 ++-- modules/game_questlog/questlinewindow.otui | 2 +- modules/game_questlog/questlogwindow.otui | 2 +- modules/game_quickloot/quickloot.otui | 2 +- modules/game_ruleviolation/ruleviolation.otui | 4 ++-- modules/game_shop/shop.otui | 2 +- modules/game_shop/transfer.otui | 2 +- 30 files changed, 47 insertions(+), 47 deletions(-) diff --git a/modules/client_options/options.otui b/modules/client_options/options.otui index 21a30ec348..63f7f82dec 100644 --- a/modules/client_options/options.otui +++ b/modules/client_options/options.otui @@ -172,7 +172,7 @@ MainWindow margin-top: 15 QtButton - !text: tr('Ok') + !text: localize('UIButtonOk') size: 64 20 anchors.right: parent.right anchors.top: prev.bottom diff --git a/modules/client_options/styles/controls/key_edit.otui b/modules/client_options/styles/controls/key_edit.otui index aeac99932a..e30d4dd71f 100644 --- a/modules/client_options/styles/controls/key_edit.otui +++ b/modules/client_options/styles/controls/key_edit.otui @@ -53,14 +53,14 @@ MainWindow SmallButton id: ok width: 40 - !text: tr("Ok") + !text: localize('UIButtonOk') SmallButton id: clear width: 45 - !text: tr("Clear") + !text: localize('UIButtonClear') SmallButton id: cancel width: 45 - !text: tr("Cancel") + !text: localize('UIButtonCancel') diff --git a/modules/client_options/styles/controls/preset.otui b/modules/client_options/styles/controls/preset.otui index 9b3d4ab223..6473e5a1a6 100644 --- a/modules/client_options/styles/controls/preset.otui +++ b/modules/client_options/styles/controls/preset.otui @@ -39,5 +39,5 @@ MainWindow SmallButton id: cancel width: 45 - !text: tr("Cancel") + !text: localize('UIButtonCancel') diff --git a/modules/client_serverlist/addserver.otui b/modules/client_serverlist/addserver.otui index a11b23a218..93afc487b3 100644 --- a/modules/client_serverlist/addserver.otui +++ b/modules/client_serverlist/addserver.otui @@ -67,7 +67,7 @@ MainWindow Button id: buttonCancel - !text: tr('Cancel') + !text: localize('UIButtonCancel') width: 64 anchors.left: parent.horizontalCenter anchors.bottom: parent.bottom diff --git a/modules/client_serverlist/serverlist.otui b/modules/client_serverlist/serverlist.otui index 3bb3633a30..482e0d642d 100644 --- a/modules/client_serverlist/serverlist.otui +++ b/modules/client_serverlist/serverlist.otui @@ -103,7 +103,7 @@ MainWindow Button id: buttonCancel - !text: tr('Cancel') + !text: localize('UIButtonCancel') width: 64 anchors.right: parent.right anchors.bottom: parent.bottom diff --git a/modules/corelib/ui/uiinputbox.lua b/modules/corelib/ui/uiinputbox.lua index 4495204182..566ec42c9a 100644 --- a/modules/corelib/ui/uiinputbox.lua +++ b/modules/corelib/ui/uiinputbox.lua @@ -111,8 +111,8 @@ function UIInputBox:addSpinBox(labelText, minimum, maximum, value, step) end function UIInputBox:display(okButtonText, cancelButtonText) - okButtonText = okButtonText or tr('Ok') - cancelButtonText = cancelButtonText or tr('Cancel') + okButtonText = okButtonText or localize('UIButtonOk') + cancelButtonText = cancelButtonText or localize('UIButtonCancel') local buttonsWidget = g_ui.createWidget('InputBoxButtonsPanel', self) local okButton = g_ui.createWidget('InputBoxButton', buttonsWidget) diff --git a/modules/game_actionbar/edit_hotkey.otui b/modules/game_actionbar/edit_hotkey.otui index 8ccd59c995..5a85f4f548 100644 --- a/modules/game_actionbar/edit_hotkey.otui +++ b/modules/game_actionbar/edit_hotkey.otui @@ -50,7 +50,7 @@ MainWindow Button id: clearButton - !text: tr('Clear') + !text: localize('UIButtonClear') width: 80 anchors.horizontalCenter: parent.horizontalCenter anchors.bottom: parent.bottom @@ -58,7 +58,7 @@ MainWindow Button id: cancelButton - !text: tr('Cancel') + !text: localize('UIButtonCancel') width: 80 anchors.right: parent.right anchors.bottom: parent.bottom diff --git a/modules/game_bugreport/bugreport.otui b/modules/game_bugreport/bugreport.otui index 8ce215e249..dec0dddac5 100644 --- a/modules/game_bugreport/bugreport.otui +++ b/modules/game_bugreport/bugreport.otui @@ -32,7 +32,7 @@ BugReportWindow < MainWindow Button id: cancelButton - !text: tr('Cancel') + !text: localize('UIButtonCancel') anchors.bottom: parent.bottom anchors.right: parent.right width: 80 diff --git a/modules/game_console/channelswindow.otui b/modules/game_console/channelswindow.otui index 2fda97c484..4d548e87f5 100644 --- a/modules/game_console/channelswindow.otui +++ b/modules/game_console/channelswindow.otui @@ -50,7 +50,7 @@ MainWindow Button id: buttonCancel - !text: tr('Cancel') + !text: localize('UIButtonCancel') width: 64 anchors.right: parent.right anchors.bottom: parent.bottom diff --git a/modules/game_console/communicationwindow.otui b/modules/game_console/communicationwindow.otui index 3a1e92003e..f236d5c9cb 100644 --- a/modules/game_console/communicationwindow.otui +++ b/modules/game_console/communicationwindow.otui @@ -183,7 +183,7 @@ MainWindow Button id: buttonCancel - !text: tr('Cancel') + !text: localize('UIButtonCancel') width: 75 anchors.top: parent.top anchors.left: prev.right diff --git a/modules/game_console/console.lua b/modules/game_console/console.lua index 8e3a2154be..260aebc101 100644 --- a/modules/game_console/console.lua +++ b/modules/game_console/console.lua @@ -1222,7 +1222,7 @@ function processChannelTabMenu(tab, mousePos, mouseButton) local characterName = g_game.getCharacterName() channelName = tab:getText() if tab ~= defaultTab and tab ~= serverTab then - menu:addOption(tr('Close'), function() + menu:addOption(localize('UIButtonClose'), function() removeTab(channelName) end) -- menu:addOption(tr('Show Server Messages'), function() --[[TODO]] end) diff --git a/modules/game_console/violationwindow.otui b/modules/game_console/violationwindow.otui index 19c55ca2c0..c723ed3e6f 100644 --- a/modules/game_console/violationwindow.otui +++ b/modules/game_console/violationwindow.otui @@ -24,7 +24,7 @@ MainWindow Button id: buttonOk - !text: tr('Ok') + !text: localize('UIButtonOk') width: 64 anchors.right: next.left anchors.bottom: parent.bottom @@ -33,7 +33,7 @@ MainWindow Button id: buttonCancel - !text: tr('Cancel') + !text: localize('UIButtonCancel') width: 64 anchors.right: parent.right anchors.bottom: parent.bottom diff --git a/modules/game_cyclopedia/game_cyclopedia.otui b/modules/game_cyclopedia/game_cyclopedia.otui index 0fda1e705f..5b4b8a97fa 100644 --- a/modules/game_cyclopedia/game_cyclopedia.otui +++ b/modules/game_cyclopedia/game_cyclopedia.otui @@ -211,7 +211,7 @@ MainWindow size: 40 20 anchors.bottom: parent.bottom anchors.right: parent.right - !text: tr('Close') + !text: localize('UIButtonClose') //font: verdana-bold-8px-antialiased text-offset: 0 -1 color: #C0C0C0 diff --git a/modules/game_cyclopedia/tab/house/house.otui b/modules/game_cyclopedia/tab/house/house.otui index 15034a48d5..1d827a5205 100644 --- a/modules/game_cyclopedia/tab/house/house.otui +++ b/modules/game_cyclopedia/tab/house/house.otui @@ -299,7 +299,7 @@ UIWidget Button id: cancel size: 43 20 - !text: tr('Cancel') + !text: localize('UIButtonCancel') color: #C0C0C0 anchors.bottom: parent.bottom anchors.right: parent.right @@ -411,7 +411,7 @@ UIWidget Button id: cancel size: 43 20 - !text: tr('Cancel') + !text: localize('UIButtonCancel') color: #C0C0C0 anchors.bottom: parent.bottom anchors.right: parent.right @@ -605,7 +605,7 @@ UIWidget Button id: cancel size: 43 20 - !text: tr('Cancel') + !text: localize('UIButtonCancel') color: #C0C0C0 anchors.bottom: parent.bottom anchors.right: parent.right @@ -851,7 +851,7 @@ UIWidget Button id: cancel size: 43 20 - !text: tr('Cancel') + !text: localize('UIButtonCancel') color: #C0C0C0 anchors.bottom: parent.bottom anchors.right: parent.right @@ -1036,7 +1036,7 @@ UIWidget Button id: cancel size: 43 20 - !text: tr('Cancel') + !text: localize('UIButtonCancel') color: #C0C0C0 anchors.bottom: parent.bottom anchors.right: parent.right @@ -1221,7 +1221,7 @@ UIWidget Button id: cancel size: 43 20 - !text: tr('Cancel') + !text: localize('UIButtonCancel') color: #C0C0C0 anchors.bottom: parent.bottom anchors.right: parent.right diff --git a/modules/game_highscore/game_highscore.otui b/modules/game_highscore/game_highscore.otui index c639fd18f4..1fd2b11b7b 100644 --- a/modules/game_highscore/game_highscore.otui +++ b/modules/game_highscore/game_highscore.otui @@ -393,6 +393,6 @@ MainWindow Button anchors.right: separator.right anchors.top: separator.top - !text: tr('Close') + !text: localize('UIButtonClose') @onClick: modules.game_highscore.hide() margin-top: 10 \ No newline at end of file diff --git a/modules/game_hotkeys/hotkeys_manager.otui b/modules/game_hotkeys/hotkeys_manager.otui index 8d45ba0b7c..234fdf4655 100644 --- a/modules/game_hotkeys/hotkeys_manager.otui +++ b/modules/game_hotkeys/hotkeys_manager.otui @@ -184,7 +184,7 @@ MainWindow Button id: okButton - !text: tr('Ok') + !text: localize('UIButtonOk') width: 64 anchors.right: next.left anchors.bottom: parent.bottom @@ -193,7 +193,7 @@ MainWindow Button id: cancelButton - !text: tr('Cancel') + !text: localize('UIButtonCancel') width: 64 anchors.right: parent.right anchors.bottom: parent.bottom @@ -239,7 +239,7 @@ HotkeyAssignWindow < MainWindow Button id: cancelButton - !text: tr('Cancel') + !text: localize('UIButtonCancel') width: 64 anchors.right: parent.right anchors.bottom: parent.bottom diff --git a/modules/game_imbuing/imbuing.otui b/modules/game_imbuing/imbuing.otui index 424e8d2e35..7e1ab75cd7 100644 --- a/modules/game_imbuing/imbuing.otui +++ b/modules/game_imbuing/imbuing.otui @@ -332,7 +332,7 @@ MainWindow Button id: close - !text: tr('Close') + !text: localize('UIButtonClose') width: 50 anchors.right: parent.right anchors.bottom: parent.bottom diff --git a/modules/game_interface/gameinterface.lua b/modules/game_interface/gameinterface.lua index cf979dcfdc..908c238a56 100644 --- a/modules/game_interface/gameinterface.lua +++ b/modules/game_interface/gameinterface.lua @@ -338,7 +338,7 @@ function tryExit() 'If you shut down the program, your character might stay in the game.\nClick on \'Logout\' to ensure that you character leaves the game properly.\nClick on \'Exit\' if you want to exit the program without logging out your character.'), { { - text = tr('Cancel'), + text = localize('UIButtonCancel'), callback = cancelFunc }, { diff --git a/modules/game_interface/styles/countwindow.otui b/modules/game_interface/styles/countwindow.otui index 6cef13411b..5f4e21e804 100644 --- a/modules/game_interface/styles/countwindow.otui +++ b/modules/game_interface/styles/countwindow.otui @@ -33,7 +33,7 @@ CountWindow < MainWindow Button id: buttonCancel - !text: tr('Cancel') + !text: localize('UIButtonCancel') height: 20 anchors.left: countScrollBar.horizontalCenter anchors.right: countScrollBar.right @@ -43,7 +43,7 @@ CountWindow < MainWindow Button id: buttonOk - !text: tr('Ok') + !text: localize('UIButtonOk') height: 20 anchors.right: countScrollBar.horizontalCenter anchors.left: countScrollBar.left diff --git a/modules/game_market/market.otui b/modules/game_market/market.otui index ae4504416d..b1930dd8de 100644 --- a/modules/game_market/market.otui +++ b/modules/game_market/market.otui @@ -35,7 +35,7 @@ MarketWindow < MainWindow Button id: closeButton - !text: tr('Close') + !text: localize('UIButtonClose') anchors.top: mainTabContent.bottom anchors.horizontalCenter: mainTabContent.horizontalCenter margin-top: 5 diff --git a/modules/game_market/ui/general/amountwindow.otui b/modules/game_market/ui/general/amountwindow.otui index c4a2d2529c..3eb68ff3d1 100644 --- a/modules/game_market/ui/general/amountwindow.otui +++ b/modules/game_market/ui/general/amountwindow.otui @@ -24,7 +24,7 @@ AmountWindow < MainWindow Button id: buttonCancel - !text: tr('Cancel') + !text: localize('UIButtonCancel') height: 20 anchors.left: amountScrollBar.horizontalCenter anchors.right: amountScrollBar.right @@ -34,7 +34,7 @@ AmountWindow < MainWindow Button id: buttonOk - !text: tr('Ok') + !text: localize('UIButtonOk') height: 20 anchors.right: amountScrollBar.horizontalCenter anchors.left: amountScrollBar.left diff --git a/modules/game_market/ui/myoffers/currentoffers.otui b/modules/game_market/ui/myoffers/currentoffers.otui index 420ec4c5ea..2ccf0a1478 100644 --- a/modules/game_market/ui/myoffers/currentoffers.otui +++ b/modules/game_market/ui/myoffers/currentoffers.otui @@ -33,7 +33,7 @@ Panel Button id: sellCancelButton - !text: tr('Cancel') + !text: localize('UIButtonCancel') anchors.right: parent.right anchors.bottom: next.bottom margin-right: 6 @@ -105,7 +105,7 @@ Panel Button id: buyCancelButton - !text: tr('Cancel') + !text: localize('UIButtonCancel') anchors.right: parent.right anchors.top: prev.bottom margin-top: 5 diff --git a/modules/game_npctrade/npctrade.otui b/modules/game_npctrade/npctrade.otui index fd67f064c4..eb12f4abf7 100644 --- a/modules/game_npctrade/npctrade.otui +++ b/modules/game_npctrade/npctrade.otui @@ -263,7 +263,7 @@ MainWindow @onClick: modules.game_npctrade.onTradeClick() Button - !text: tr('Close') + !text: localize('UIButtonClose') width: 64 anchors.right: parent.right anchors.bottom: parent.bottom diff --git a/modules/game_playerdeath/deathwindow.otui b/modules/game_playerdeath/deathwindow.otui index 4f185bf1d2..2992581e5e 100644 --- a/modules/game_playerdeath/deathwindow.otui +++ b/modules/game_playerdeath/deathwindow.otui @@ -15,7 +15,7 @@ DeathWindow < MainWindow Button id: buttonOk - !text: tr('Ok') + !text: localize('UIButtonOk') width: 64 anchors.left: parent.left anchors.bottom: parent.bottom @@ -23,7 +23,7 @@ DeathWindow < MainWindow Button id: buttonCancel - !text: tr('Cancel') + !text: localize('UIButtonCancel') width: 64 anchors.left: prev.right anchors.bottom: parent.bottom diff --git a/modules/game_questlog/questlinewindow.otui b/modules/game_questlog/questlinewindow.otui index 7d6a5cfa88..1bfa31b987 100644 --- a/modules/game_questlog/questlinewindow.otui +++ b/modules/game_questlog/questlinewindow.otui @@ -46,6 +46,6 @@ QuestLineWindow < MainWindow id: closeButton anchors.bottom: parent.bottom anchors.right: parent.right - !text: tr('Close') + !text: localize('UIButtonClose') width: 90 @onClick: self:getParent():destroy() diff --git a/modules/game_questlog/questlogwindow.otui b/modules/game_questlog/questlogwindow.otui index cb5df91b58..83d9c2d34b 100644 --- a/modules/game_questlog/questlogwindow.otui +++ b/modules/game_questlog/questlogwindow.otui @@ -47,6 +47,6 @@ QuestLogWindow < MainWindow id: closeButton anchors.bottom: parent.bottom anchors.right: parent.right - !text: tr('Close') + !text: localize('UIButtonClose') width: 90 @onClick: self:getParent():destroy() diff --git a/modules/game_quickloot/quickloot.otui b/modules/game_quickloot/quickloot.otui index 16980637cc..f4234b34cc 100644 --- a/modules/game_quickloot/quickloot.otui +++ b/modules/game_quickloot/quickloot.otui @@ -331,7 +331,7 @@ Window pixels-scroll: true QtButton size: 43 20 - !text: tr('Close') + !text: localize('UIButtonClose') color: #C0C0C0 anchors.bottom: parent.bottom anchors.right: parent.right diff --git a/modules/game_ruleviolation/ruleviolation.otui b/modules/game_ruleviolation/ruleviolation.otui index 570c11816d..cd27299a18 100644 --- a/modules/game_ruleviolation/ruleviolation.otui +++ b/modules/game_ruleviolation/ruleviolation.otui @@ -105,14 +105,14 @@ MainWindow id: commentText Button - !text: tr('Cancel') + !text: localize('UIButtonCancel') width: 64 anchors.right: parent.right anchors.bottom: parent.bottom @onClick: hide() Button - !text: tr('Ok') + !text: localize('UIButtonOk') width: 64 margin-right: 5 anchors.right: prev.left diff --git a/modules/game_shop/shop.otui b/modules/game_shop/shop.otui index 67a0d1fff9..7adbbb9cb0 100644 --- a/modules/game_shop/shop.otui +++ b/modules/game_shop/shop.otui @@ -239,7 +239,7 @@ MainWindow Button id: buttonCancel - !text: tr('Close') + !text: localize('UIButtonClose') width: 64 anchors.right: parent.right anchors.bottom: parent.bottom diff --git a/modules/game_shop/transfer.otui b/modules/game_shop/transfer.otui index dbfefc499f..79ae83eef4 100644 --- a/modules/game_shop/transfer.otui +++ b/modules/game_shop/transfer.otui @@ -60,7 +60,7 @@ MainWindow Button id: cancelButton - !text: tr('Cancel') + !text: localize('UIButtonCancel') font: cipsoftFont anchors.right: parent.right anchors.bottom: parent.bottom From 0706331226274e65d7904e4e6c73b50837504c1b Mon Sep 17 00:00:00 2001 From: Zbizu Date: Tue, 28 Jan 2025 19:19:38 +0100 Subject: [PATCH 7/8] more translations --- data/locales/en.lua | 8 ++++++++ .../client_options/styles/controls/preset.otui | 2 +- modules/game_blessing/style.otui | 6 +++--- .../game_cyclopedia/tab/bestiary/bestiary.otui | 12 ++++++------ .../tab/bosstiary/bosstiary.otui | 2 +- modules/game_cyclopedia/tab/house/house.lua | 16 ++++++++-------- modules/game_quickloot/quickloot.lua | 4 ++-- modules/game_shop/shop.lua | 18 +++++++++--------- modules/game_shop/shop.otui | 2 +- modules/game_shop/transfer.otui | 12 ++++++------ 10 files changed, 45 insertions(+), 37 deletions(-) diff --git a/data/locales/en.lua b/data/locales/en.lua index 271dab138a..f21f9008ae 100644 --- a/data/locales/en.lua +++ b/data/locales/en.lua @@ -195,6 +195,9 @@ locale:translate("ThereIsNoWay", "There is no way.") locale:translate("DebugInfoTitle", "Debug Info") locale:translate("DebugInfoProxies", "Proxies") +-- blessings +locale:translate("BlessingsLongTextPlaceholder", "This is a placeholder for a very long text.") + -- chat locale:translate("ChatChannelNameDefault", "Local Chat") locale:translate("ChatChannelNameServerLog", "Server Log") @@ -351,6 +354,7 @@ locale:translate("StoreButtonTransactionHistory", "History") locale:translate("StoreButtonTransferCoins", "Transfer Coins") locale:translate("StoreButtonSellCharacter", "Setup up an auction to sell you currents characters.") locale:translate("StoreWindowTitleGiftTc", "Gift Tibia Coins") +locale:translate("StoreWindowLabelGiftAmount", "Amount to gift") locale:translate("StoreItemStats", "General Stats") locale:translate("StoreTransferableTc", "Transferable Tibia Coins") locale:translate("StoreTcToTransfer", "Amount to transfer") @@ -367,6 +371,10 @@ locale:translate("StoreMessageConfirmBuy", "Do you want to buy the product \"%1\ locale:translate("StoreMessageNotEnoughCoins", "You don't have enough coins") locale:translate("StoreCurrencyTcRegular", "regular coins") locale:translate("StoreCurrencyTcTransferable", "transferable coins") +locale:translate("StoreTitleBuyItem", "Buying from shop") +locale:translate("StoreMessageBuyItem", "Do you want to buy %1 for %2 premium points?"") +locale:translate("StoreCoinBalanceLabel", "Points") +locale:translate("StoreButton", "Store") -- tasks locale:translate("TaskSystemWindowTitle", "Tasks") diff --git a/modules/client_options/styles/controls/preset.otui b/modules/client_options/styles/controls/preset.otui index 6473e5a1a6..1accb03b10 100644 --- a/modules/client_options/styles/controls/preset.otui +++ b/modules/client_options/styles/controls/preset.otui @@ -34,7 +34,7 @@ MainWindow SmallButton id: ok width: 40 - !text: tr("Ok") + !text: localize('UIButtonOk') SmallButton id: cancel diff --git a/modules/game_blessing/style.otui b/modules/game_blessing/style.otui index c29d6ba11a..a9b687510c 100644 --- a/modules/game_blessing/style.otui +++ b/modules/game_blessing/style.otui @@ -6,7 +6,7 @@ historyData < UIWidget anchors.bottom : parent.bottom id: rank width: 150 - !text: tr('1') + !text: '1' text-align: center color: #dfdfdfcf phantom: false @@ -27,7 +27,7 @@ historyData < UIWidget anchors.bottom : parent.bottom id: name width: 216 - !text: tr('-') + !text: '-' text-align: left color: #ff0000cf phantom: true @@ -47,7 +47,7 @@ blessingTEST < UIWidget margin-left: 3 Label id: text - !text: tr('loooooong text') + !text: localize('BlessingsLongTextPlaceholder') text-align: center margin-top: 5 width: 65 diff --git a/modules/game_cyclopedia/tab/bestiary/bestiary.otui b/modules/game_cyclopedia/tab/bestiary/bestiary.otui index 7b1345c3e6..cd115f4809 100644 --- a/modules/game_cyclopedia/tab/bestiary/bestiary.otui +++ b/modules/game_cyclopedia/tab/bestiary/bestiary.otui @@ -264,7 +264,7 @@ UIWidget anchors.left: BonusIcon.right margin-left: 5 text-auto-resize: true - !text: tr('?') + !text: '?' color: #C7C7C7 UIWidget id: CharmBase @@ -343,7 +343,7 @@ UIWidget margin-left: 5 margin-bottom: 1 text-auto-resize: true - !text: tr('?') + !text: '?' color: #C7C7C7 UIWidget id: Icon2 @@ -359,7 +359,7 @@ UIWidget margin-left: 5 margin-bottom: 1 text-auto-resize: true - !text: tr('?') + !text: '?' color: #C7C7C7 UIWidget id: Icon3 @@ -375,7 +375,7 @@ UIWidget margin-left: 5 margin-bottom: 1 text-auto-resize: true - !text: tr('?') + !text: '?' color: #C7C7C7 UIWidget id: Icon4 @@ -391,7 +391,7 @@ UIWidget margin-left: 5 margin-bottom: 1 text-auto-resize: true - !text: tr('?') + !text: '?' color: #C7C7C7 UIWidget id: Icon5 @@ -407,7 +407,7 @@ UIWidget margin-left: 5 margin-bottom: 1 text-auto-resize: true - !text: tr('?') + !text: '?' color: #C7C7C7 UIWidget id: LocationField diff --git a/modules/game_cyclopedia/tab/bosstiary/bosstiary.otui b/modules/game_cyclopedia/tab/bosstiary/bosstiary.otui index d71cc4f18e..de6bdd3e8a 100644 --- a/modules/game_cyclopedia/tab/bosstiary/bosstiary.otui +++ b/modules/game_cyclopedia/tab/bosstiary/bosstiary.otui @@ -249,7 +249,7 @@ UIWidget margin-bottom: 5 size: 60 20 text-align: center - !text: tr('1 / 1') + !text: '1 / 1' color: #C2C2C2 Button id: NextPageButton diff --git a/modules/game_cyclopedia/tab/house/house.lua b/modules/game_cyclopedia/tab/house/house.lua index 480e101c2a..6018e53ee6 100644 --- a/modules/game_cyclopedia/tab/house/house.lua +++ b/modules/game_cyclopedia/tab/house/house.lua @@ -173,7 +173,7 @@ function Cyclopedia.houseMessage(houseId, type, message) confirmWindow = displayGeneralBox(tr("Summary"), tr( "Your bid was successfull. You are currently holding the highest bid."), { { - text = tr("Ok"), + text = localize('UIButtonOk'), callback = yesCallback }, anchor = AnchorHorizontalCenter @@ -188,7 +188,7 @@ function Cyclopedia.houseMessage(houseId, type, message) "Bid failed.\nYour character's bank acocunt balance is too low to pay the bid and the rent for the first month."), { { - text = tr("Ok"), + text = localize('UIButtonOk'), callback = yesCallback }, anchor = AnchorHorizontalCenter @@ -202,7 +202,7 @@ function Cyclopedia.houseMessage(houseId, type, message) if message == 0 then confirmWindow = displayGeneralBox(tr("Summary"), tr("You have sucessfully iniated your move out."), { { - text = tr("Ok"), + text = localize('UIButtonOk'), callback = yesCallback }, anchor = AnchorHorizontalCenter @@ -217,7 +217,7 @@ function Cyclopedia.houseMessage(houseId, type, message) confirmWindow = displayGeneralBox(tr("Summary"), tr("You have sucessfully initiated the transfer of your house."), { { - text = tr("Ok"), + text = localize('UIButtonOk'), callback = yesCallback }, anchor = AnchorHorizontalCenter @@ -230,7 +230,7 @@ function Cyclopedia.houseMessage(houseId, type, message) confirmWindow = displayGeneralBox(tr("Summary"), tr( "Setting up a house transfer failed.\nA character with this name does not exist."), { { - text = tr("Ok"), + text = localize('UIButtonOk'), callback = yesCallback }, anchor = AnchorHorizontalCenter @@ -245,7 +245,7 @@ function Cyclopedia.houseMessage(houseId, type, message) confirmWindow = displayGeneralBox(tr("Summary"), tr( "You have sucessfully cancelled the transfer. You will keep the house."), { { - text = tr("Ok"), + text = localize('UIButtonOk'), callback = yesCallback }, anchor = AnchorHorizontalCenter @@ -259,7 +259,7 @@ function Cyclopedia.houseMessage(houseId, type, message) if message == 0 then confirmWindow = displayGeneralBox(tr("Summary"), tr("You have sucessfully accepted the transfer."), { { - text = tr("Ok"), + text = localize('UIButtonOk'), callback = yesCallback }, anchor = AnchorHorizontalCenter @@ -273,7 +273,7 @@ function Cyclopedia.houseMessage(houseId, type, message) confirmWindow = displayGeneralBox(tr("Summary"), tr( "You jected the house transfer sucessfully. The old owner will keep the house."), { { - text = tr("Ok"), + text = localize('UIButtonOk'), callback = yesCallback }, anchor = AnchorHorizontalCenter diff --git a/modules/game_quickloot/quickloot.lua b/modules/game_quickloot/quickloot.lua index 9294eae918..1cb33e4890 100644 --- a/modules/game_quickloot/quickloot.lua +++ b/modules/game_quickloot/quickloot.lua @@ -341,7 +341,7 @@ function QuickLoot.Define() QuickLoot.ErrorWindow = displayGeneralBox(tr("Invalid Loot Container"), tr( "You can only select containers you carry in your inventory."), { { - text = tr("Ok"), + text = localize('UIButtonOk'), callback = QuickLoot.confirmError }, anchor = AnchorHorizontalCenter @@ -357,7 +357,7 @@ function QuickLoot.Define() QuickLoot.ErrorWindow = displayGeneralBox(tr("Invalid Loot Container"), tr( "You can only select containers you carry in your inventory."), { { - text = tr("Ok"), + text = localize('UIButtonOk'), callback = QuickLoot.confirmError }, anchor = AnchorHorizontalCenter diff --git a/modules/game_shop/shop.lua b/modules/game_shop/shop.lua index 8c0e52249d..84b480755d 100644 --- a/modules/game_shop/shop.lua +++ b/modules/game_shop/shop.lua @@ -144,7 +144,7 @@ function createShop() end shop = g_ui.displayUI('shop') shop:hide() - -- shopButton = modules.game_mainpanel.addStoreButton('store', tr('Shop'), '/images/options/store_large', toggle,false, 8) -- \game_mainpanel\mainpanel.lua + -- shopButton = modules.game_mainpanel.addStoreButton('store', localize('StoreButton'), '/images/options/store_large', toggle,false, 8) -- \game_mainpanel\mainpanel.lua shopButton = nil connect(shop.categories, { @@ -311,8 +311,8 @@ function onCoinBalance(coins, transferableCoins) if not shop or otcv8shop then return end - shop.infoPanel.points:setText(tr("Points:") .. " " .. coins) - transferWindow.coinsBalance:setText(tr('Transferable Tibia Coins: ') .. coins) + shop.infoPanel.points:setText(localize('StoreCoinBalanceLabel') .. ": " .. coins) + transferWindow.coinsBalance:setText(localize('StoreTransferableTc') .. ": " .. coins) transferWindow.coinsAmount:setMaximum(coins) shop.infoPanel.buy:hide() shop.infoPanel:setHeight(20) @@ -411,7 +411,7 @@ function processMessage(data) msgWindow:destroy() end - local title = tr(data["title"]) + local title = localize(data["title"]) local msg = data["msg"] msgWindow = displayInfoBox(title, msg) msgWindow.onDestroy = function(widget) @@ -440,7 +440,7 @@ function processStatus(data) processAd(data['ad']) end if data['points'] then - shop.infoPanel.points:setText(tr("Points:") .. " " .. formatNumberWithCommas(data['points'])) + shop.infoPanel.points:setText(localize('StoreCoinBalanceLabel') .. ": " .. formatNumberWithCommas(data['points'])) end if data['buyUrl'] and data['buyUrl']:sub(1, 4):lower() == "http" then shop.infoPanel.buy:show() @@ -642,15 +642,15 @@ function buyOffer(widget) msgWindow:destroy() end - local title = tr("Buying from shop") - local msg = "Do you want to buy " .. item.title .. " for " .. item.cost .. " premium points?" + local title = localize("StoreTitleBuyItem") + local msg = localize('StoreMessageBuyItem', item.title, item.cost) msgWindow = displayGeneralBox(title, msg, { { - text = tr('Yes'), + text = localize('UIButtonYes'), callback = buyConfirmed }, { - text = tr('No'), + text = localize('UIButtonNo'), callback = buyCanceled }, anchor = AnchorHorizontalCenter diff --git a/modules/game_shop/shop.otui b/modules/game_shop/shop.otui index 7adbbb9cb0..89a0fdebbc 100644 --- a/modules/game_shop/shop.otui +++ b/modules/game_shop/shop.otui @@ -230,7 +230,7 @@ MainWindow Label id: transferOpen - !text: tr('by kondra (otclient@otclient.ovh)') + !text: 'by kondra (otclient@otclient.ovh)' width: 450 anchors.left: prev. right margin-left: 45 diff --git a/modules/game_shop/transfer.otui b/modules/game_shop/transfer.otui index 79ae83eef4..ee268705d8 100644 --- a/modules/game_shop/transfer.otui +++ b/modules/game_shop/transfer.otui @@ -1,6 +1,6 @@ MainWindow id: transferWindow - !text: tr('Gift Tibia Coins') + !text: localize('StoreWindowTitleGiftTc') size: 280 240 @onEscape: modules.game_shop.hideTransfer() @@ -10,13 +10,13 @@ MainWindow anchors.right: parent.right text-wrap: true height: 56 - !text: tr('Please select the amount of Tibia Coins you would like to gift and enter the name of the character that should receive the Tibia Coins.') + !text: localize('StoreMessageTcTransfer') Label anchors.top: prev.bottom anchors.left: parent.left margin-top: 20 - !text: tr('Reciepient:') + !text: localize('StoreTcRecipient') .. ":" TextEdit id: recipient @@ -32,14 +32,14 @@ MainWindow anchors.right: parent.right margin-top: 10 text-align: center - !text: tr('Transferable Tibia Coins:') + !text: localize('StoreTransferableTc') .. ":" Label id: coinsAmountLabel anchors.top: prev.bottom anchors.left: parent.left margin-top: 20 - !text: tr('Amount to gift: ') + !text: localize('StoreWindowLabelGiftAmount') .. ": " SpinBox id: coinsAmount @@ -71,7 +71,7 @@ MainWindow Button id: giftButton - !text: tr('Gift') + !text: localize('StoreButtonGiftTc') font: cipsoftFont size: 45 21 anchors.verticalCenter: prev.verticalCenter From aae32fd1a1513f39a016d7168dfbaee521b85acb Mon Sep 17 00:00:00 2001 From: Zbizu Date: Tue, 28 Jan 2025 19:55:49 +0100 Subject: [PATCH 8/8] more translations --- data/locales/en.lua | 59 +++++++++++++++++ .../styles/controls/keybinds.otui | 2 +- modules/game_playerdeath/deathwindow.otui | 2 +- modules/game_playerdeath/playerdeath.lua | 14 ++-- modules/game_ruleviolation/ruleviolation.lua | 64 +++++++++---------- modules/game_ruleviolation/ruleviolation.otui | 12 ++-- modules/game_screenshot/game_screenshot.otui | 18 +++--- modules/game_shop/shop.otui | 6 +- 8 files changed, 118 insertions(+), 59 deletions(-) diff --git a/data/locales/en.lua b/data/locales/en.lua index f21f9008ae..7405752723 100644 --- a/data/locales/en.lua +++ b/data/locales/en.lua @@ -59,6 +59,7 @@ locale:translate("UIButtonSettings", "Settings") locale:translate("UIButtonEdit", "Edit") locale:translate("UIButtonRemove", "Remove") locale:translate("UIButtonClear", "Clear") +locale:translate("UIButtonReset", "Reset") locale:translate("UIButtonPaginationPrev", "Prev Page") locale:translate("UIButtonPaginationNext", "Next Page") @@ -259,6 +260,12 @@ locale:translate("EnterGameButtonLogin", "Login") locale:translate("EnterGameButtonCreateAccount", "Create New Account") locale:translate("EnterGameLabelServer", "Server") +-- death screen +locale:translate("DeathWindowTitle", "You are dead") +locale:translate("DeathMessageRegular", "Alas! Brave adventurer, you have met a sad fate.\nBut do not despair, for the gods will bring you back\ninto this world in exchange for a small sacrifice\n\nSimply click on Ok to resume your journeys!") +locale:translate("DeathMessageUnfair", "Alas! Brave adventurer, you have met a sad fate.\nBut do not despair, for the gods will bring you back\ninto this world in exchange for a small sacrifice\n\nThis death penalty has been reduced by %1%%\nbecause it was an unfair fight.\n\nSimply click on Ok to resume your journeys!") +locale:translate("DeathMessageBlessed", "Alas! Brave adventurer, you have met a sad fate.\nBut do not despair, for the gods will bring you back into this world\n\nThis death penalty has been reduced by 100%\nbecause you are blessed with the Adventurer\'s Blessing\n\nSimply click on Ok to resume your journeys!") + -- item selector locale:translate("ItemSelectorCountSubtype", "Count / SubType") locale:translate("ItemSelectorItemID", "Item ID") @@ -268,6 +275,56 @@ locale:translate("ItemSelectorWindowTitle", "Select Item") locale:translate("MinimapWindowTitleSetMark", "Create Map Mark") locale:translate("MinimapButtonCenter", "Center") +-- rule violation +locale:translate("RuleViolationRule1a", "1a) Offensive Name") +locale:translate("RuleViolationRule1b", "1b) Invalid Name Format") +locale:translate("RuleViolationRule1c", "1c) Unsuitable Name") +locale:translate("RuleViolationRule1d", "1d) Name Inciting Rule Violation") +locale:translate("RuleViolationRule2a", "2a) Offensive Statement") +locale:translate("RuleViolationRule2b", "2b) Spamming") +locale:translate("RuleViolationRule2c", "2c) Illegal Advertising") +locale:translate("RuleViolationRule2d", "2d) Off-Topic Public Statement") +locale:translate("RuleViolationRule2e", "2e) Non-English Public Statement") +locale:translate("RuleViolationRule2f", "2f) Inciting Rule Violation") +locale:translate("RuleViolationRule3a", "3a) Bug Abuse") +locale:translate("RuleViolationRule3b", "3b) Game Weakness Abuse") +locale:translate("RuleViolationRule3c", "3c) Using Unofficial Software to Play") +locale:translate("RuleViolationRule3d", "3d) Hacking") +locale:translate("RuleViolationRule3e", "3e) Multi-Clienting") +locale:translate("RuleViolationRule3f", "3f) Account Trading or Sharing") +locale:translate("RuleViolationRule4a", "4a) Threatening Gamemaster") +locale:translate("RuleViolationRule4b", "4b) Pretending to Have Influence on Rule Enforcement") +locale:translate("RuleViolationRule4c", "4c) False Report to Gamemaster") +locale:translate("RuleViolationDestructiveBehaviour", "Destructive Behaviour") +locale:translate("RuleViolationExcessivePK", "Excessive Unjustified Player Killing") +locale:translate("RuleViolationActionNote", "Notation") +locale:translate("RuleViolationActionNamelock", "Name Report") +locale:translate("RuleViolationActionBan", "Banishment") +locale:translate("RuleViolationActionBanPlusNamelock", "Name Report + Banishment") +locale:translate("RuleViolationActionBanPlusFinalWarning", "Banishment + Final Warning") +locale:translate("RuleViolationActionBanPlusFinalPlusNamelock", "Name Report + Banishment + Final Warning") +locale:translate("RuleViolationActionReport", "Statement Report") +locale:translate("RuleViolationNeedAction", "You must select an action.") +locale:translate("RuleViolationNeedReason", "You must select a reason.") +locale:translate("RuleViolationNeedStatement", "No statement has been selected.") +locale:translate("RuleViolationNeedComment", "You must enter a comment.") +locale:translate("RuleViolationLabelPlayerName", "Name") +locale:translate("RuleViolationLabelPlayerMessage", "Statement") +locale:translate("RuleViolationLabelPenaltyReason", "Reason") +locale:translate("RuleViolationLabelAction", "Action") +locale:translate("RuleViolationCheckboxIpBan", "IP Address Banishment") +locale:translate("RuleViolationLabelComment", "Comment") + +-- screenshot +locale:translate("ScreenshotCheckboxGameWindow", "Only Capture Game Window") +locale:translate("ScreenshotTooltipGameWindow", "If you check this option, the screenshots will only be taken from\nthe game window instead of the complete client interface. This\nmight improve your game performance, particularly if you have\nticked the Screenshot Backlog option.") +locale:translate("ScreenshotCheckboxBacklog", "Keep Blacklog of the Screenshots of the Last 5 Seconds") +locale:translate("ScreenshotTooltipBacklog", "If you check this option, the client takes a screenshot every\nsecond and caches the last 5 of them. Whenever a screenshot is\ntaken either automatically for a selected event or manually using a\nhotkey, also the screenshots of the previous 5 seconds will be\nsaved.\nIf you experience frame stuttering, you should consider disabling\nthis option.") +locale:translate("ScreenshotCheckboxAutoCapture", "Enable Auto Screenshots") +locale:translate("ScreenshotTooltipAutoCapture", "Enable this option to save screenshots of the most important\nmoments of your career! Whenever one of the events you\nhave selected takes place, a screenshot will be taken\nautomatically.\n\nThe following events can be selected to trigger an auto screenshot:\n\n- Level Up: Your character has reached the next level\n- Skill Up: You advanced in one of your skills (e.g. Magic Level\nor Sword Fighting)\n- Achievement: You earned an achievement, either while\nplaying or upon login\n- Bestiary Entry Unlocked: You unlocked new information\nabout a creature in the Bestiary\n- Bestiary Entry Completed: You unlocked all information about\na creature in the Bestiary\n- Treasure Found: You received some reward from a container\nfor solving a quest or a riddle\n- Valuable Loot: You just found some loot which you have\nmarked in the Drop Tracker\n- Boss Defeated: You defeated a boss monster, either alone or\ntogether with other players, and are entitled to loot it\n- Death PvE: You were just killed by some creature (PvE)\n- Death PvP: You were just killed by another player (PvP)\n- Player Kill: You defeated another player\n- Player Killer Assist: You assisted the killing of another player\n- Player Attacking: Another player just started to attack you\n- Highest Damage Dealt: You dealt a new all-time high damage\non a foe. To see or reset your current all-time high, check\nthe Impact Analyser\n- Highest Healing Done: You healed someone with a new all-\ntime high healing value. To see or reset your current all-time\nhigh, check the Impact Analyser\n- Low Health: You have reached a threshold of deep red\nhealth Copy") +locale:translate("ScreenshotLabelAutoCapture", "Select all events that should trigger auto Screenshots") +locale:translate("ScreenshotButtonOpenFolder", "Open Screenshots Folder") + -- skills locale:translate("SkillsWindowTitle", "Skills") locale:translate("SkillsWindowTooltipPercentNeeded", "You have %1 percent to go") @@ -375,6 +432,8 @@ locale:translate("StoreTitleBuyItem", "Buying from shop") locale:translate("StoreMessageBuyItem", "Do you want to buy %1 for %2 premium points?"") locale:translate("StoreCoinBalanceLabel", "Points") locale:translate("StoreButton", "Store") +locale:translate("StoreWindowTitle", "Store") +locale:translate("StoreButtonBuyPoints", "Buy points") -- tasks locale:translate("TaskSystemWindowTitle", "Tasks") diff --git a/modules/client_options/styles/controls/keybinds.otui b/modules/client_options/styles/controls/keybinds.otui index 98ca8999c4..9d143c2363 100644 --- a/modules/client_options/styles/controls/keybinds.otui +++ b/modules/client_options/styles/controls/keybinds.otui @@ -281,5 +281,5 @@ UIWidget anchors.right: parent.right width: 45 margin-top: 8 - !text: tr('Reset') + !text: localize('UIButtonReset') @onClick : resetActions() diff --git a/modules/game_playerdeath/deathwindow.otui b/modules/game_playerdeath/deathwindow.otui index 2992581e5e..b0f803459e 100644 --- a/modules/game_playerdeath/deathwindow.otui +++ b/modules/game_playerdeath/deathwindow.otui @@ -1,6 +1,6 @@ DeathWindow < MainWindow id: deathWindow - !text: tr('You are dead') + !text: localize('DeathWindowTitle') &baseWidth: 350 &baseHeight: 15 diff --git a/modules/game_playerdeath/playerdeath.lua b/modules/game_playerdeath/playerdeath.lua index 7a7ee08950..5097b14275 100644 --- a/modules/game_playerdeath/playerdeath.lua +++ b/modules/game_playerdeath/playerdeath.lua @@ -1,16 +1,16 @@ local deathTexts = { regular = { - text = 'Alas! Brave adventurer, you have met a sad fate.\nBut do not despair, for the gods will bring you back\ninto this world in exchange for a small sacrifice\n\nSimply click on Ok to resume your journeys!', + text = 'DeathMessageRegular', height = 140, width = 0 }, unfair = { - text = 'Alas! Brave adventurer, you have met a sad fate.\nBut do not despair, for the gods will bring you back\ninto this world in exchange for a small sacrifice\n\nThis death penalty has been reduced by %i%%\nbecause it was an unfair fight.\n\nSimply click on Ok to resume your journeys!', + text = 'DeathMessageUnfair', height = 185, width = 0 }, blessed = { - text = 'Alas! Brave adventurer, you have met a sad fate.\nBut do not despair, for the gods will bring you back into this world\n\nThis death penalty has been reduced by 100%\nbecause you are blessed with the Adventurer\'s Blessing\n\nSimply click on Ok to resume your journeys!', + text = 'DeathMessageBlessed', height = 170, width = 90 } @@ -48,7 +48,7 @@ function displayDeadMessage() return end - modules.game_textmessage.displayGameMessage(tr('You are dead.')) + modules.game_textmessage.displayGameMessage(localize('DeathWindowTitle') .. ".") end function openWindow(deathType, penalty) @@ -62,16 +62,16 @@ function openWindow(deathType, penalty) local textLabel = deathController.ui:getChildById('labelText') if deathType == DeathType.Regular then if penalty == 100 then - textLabel:setText(deathTexts.regular.text) + textLabel:setText(localize(deathTexts.regular.text)) deathController.ui:setHeight(deathController.ui.baseHeight + deathTexts.regular.height) deathController.ui:setWidth(deathController.ui.baseWidth + deathTexts.regular.width) else - textLabel:setText(string.format(deathTexts.unfair.text, 100 - penalty)) + textLabel:setText(localize(deathTexts.unfair.text, 100 - penalty)) deathController.ui:setHeight(deathController.ui.baseHeight + deathTexts.unfair.height) deathController.ui:setWidth(deathController.ui.baseWidth + deathTexts.unfair.width) end elseif deathType == DeathType.Blessed then - textLabel:setText(deathTexts.blessed.text) + textLabel:setText(localize(deathTexts.blessed.text)) deathController.ui:setHeight(deathController.ui.baseHeight + deathTexts.blessed.height) deathController.ui:setWidth(deathController.ui.baseWidth + deathTexts.blessed.width) end diff --git a/modules/game_ruleviolation/ruleviolation.lua b/modules/game_ruleviolation/ruleviolation.lua index 66e7935dc3..22790cd931 100644 --- a/modules/game_ruleviolation/ruleviolation.lua +++ b/modules/game_ruleviolation/ruleviolation.lua @@ -1,34 +1,34 @@ rvreasons = {} -rvreasons[1] = tr('1a) Offensive Name') -rvreasons[2] = tr('1b) Invalid Name Format') -rvreasons[3] = tr('1c) Unsuitable Name') -rvreasons[4] = tr('1d) Name Inciting Rule Violation') -rvreasons[5] = tr('2a) Offensive Statement') -rvreasons[6] = tr('2b) Spamming') -rvreasons[7] = tr('2c) Illegal Advertising') -rvreasons[8] = tr('2d) Off-Topic Public Statement') -rvreasons[9] = tr('2e) Non-English Public Statement') -rvreasons[10] = tr('2f) Inciting Rule Violation') -rvreasons[11] = tr('3a) Bug Abuse') -rvreasons[12] = tr('3b) Game Weakness Abuse') -rvreasons[13] = tr('3c) Using Unofficial Software to Play') -rvreasons[14] = tr('3d) Hacking') -rvreasons[15] = tr('3e) Multi-Clienting') -rvreasons[16] = tr('3f) Account Trading or Sharing') -rvreasons[17] = tr('4a) Threatening Gamemaster') -rvreasons[18] = tr('4b) Pretending to Have Influence on Rule Enforcement') -rvreasons[19] = tr('4c) False Report to Gamemaster') -rvreasons[20] = tr('Destructive Behaviour') -rvreasons[21] = tr('Excessive Unjustified Player Killing') +rvreasons[1] = localize('RuleViolationRule1a') +rvreasons[2] = localize('RuleViolationRule1b') +rvreasons[3] = localize('RuleViolationRule1c') +rvreasons[4] = localize('RuleViolationRule1d') +rvreasons[5] = localize('RuleViolationRule2a') +rvreasons[6] = localize('RuleViolationRule2b') +rvreasons[7] = localize('RuleViolationRule2c') +rvreasons[8] = localize('RuleViolationRule2d') +rvreasons[9] = localize('RuleViolationRule2e') +rvreasons[10] = localize('RuleViolationRule2f') +rvreasons[11] = localize('RuleViolationRule3a') +rvreasons[12] = localize('RuleViolationRule3b') +rvreasons[13] = localize('RuleViolationRule3c') +rvreasons[14] = localize('RuleViolationRule3d') +rvreasons[15] = localize('RuleViolationRule3e') +rvreasons[16] = localize('RuleViolationRule3f') +rvreasons[17] = localize('RuleViolationRule4a') +rvreasons[18] = localize('RuleViolationRule4b') +rvreasons[19] = localize('RuleViolationRule4c') +rvreasons[20] = localize('RuleViolationDestructiveBehaviour') +rvreasons[21] = localize('RuleViolationExcessivePK') rvactions = {} -rvactions[0] = tr('Notation') -rvactions[1] = tr('Name Report') -rvactions[2] = tr('Banishment') -rvactions[3] = tr('Name Report + Banishment') -rvactions[4] = tr('Banishment + Final Warning') -rvactions[5] = tr('Name Report + Banishment + Final Warning') -rvactions[6] = tr('Statement Report') +rvactions[0] = localize('RuleViolationActionNote') +rvactions[1] = localize('RuleViolationActionNamelock') +rvactions[2] = localize('RuleViolationActionBan') +rvactions[3] = localize('RuleViolationActionBanPlusNamelock') +rvactions[4] = localize('RuleViolationActionBanPlusFinalWarning') +rvactions[5] = localize('RuleViolationActionBanPlusFinalPlusNamelock') +rvactions[6] = localize('RuleViolationActionReport') ruleViolationWindow = nil reasonsTextList = nil @@ -124,13 +124,13 @@ end function report() local reasonLabel = reasonsTextList:getFocusedChild() if not reasonLabel then - displayErrorBox(tr('Error'), tr('You must select a reason.')) + displayErrorBox(localize('Error'), localize('RuleViolationNeedReason')) return end local actionLabel = actionsTextList:getFocusedChild() if not actionLabel then - displayErrorBox(tr('Error'), tr('You must select an action.')) + displayErrorBox(localize('Error'), localize('RuleViolationNeedAction')) return end @@ -142,9 +142,9 @@ function report() local statementId = 0 -- TODO: message unique id ? local ipBanishment = ruleViolationWindow:getChildById('ipBanCheckBox'):isChecked() if action == 6 and statement == '' then - displayErrorBox(tr('Error'), tr('No statement has been selected.')) + displayErrorBox(localize('Error'), localize('RuleViolationNeedStatement')) elseif comment == '' then - displayErrorBox(tr('Error'), tr('You must enter a comment.')) + displayErrorBox(localize('Error'), localize('RuleViolationNeedComment')) else g_game.reportRuleViolation(target, reason, action, comment, statement, statementId, ipBanishment) hide() diff --git a/modules/game_ruleviolation/ruleviolation.otui b/modules/game_ruleviolation/ruleviolation.otui index cd27299a18..13f32b5860 100644 --- a/modules/game_ruleviolation/ruleviolation.otui +++ b/modules/game_ruleviolation/ruleviolation.otui @@ -36,20 +36,20 @@ MainWindow @onEscape: hide() RVLabel - !text: tr('Name') .. ':' + !text: localize('RuleViolationLabelPlayerName') .. ':' RVTextEdit id: nameText RVLabel - !text: tr('Statement') .. ':' + !text: localize('RuleViolationLabelPlayerMessage') .. ':' RVTextEdit id: statementText enabled: false RVLabel - !text: tr('Reason') .. ':' + !text: localize('RuleViolationLabelPenaltyReason') .. ':' TextList id: reasonList @@ -70,7 +70,7 @@ MainWindow pixels-scroll: true RVLabel - !text: tr('Action') .. ':' + !text: localize('RuleViolationLabelAction') .. ':' TextList id: actionList @@ -92,14 +92,14 @@ MainWindow CheckBox id: ipBanCheckBox - !text: tr('IP Address Banishment') + !text: localize('RuleViolationCheckboxIpBan') margin-top: 10 anchors.top: prev.bottom anchors.left: parent.left anchors.right: parent.right RVLabel - !text: tr('Comment') .. ':' + !text: localize('RuleViolationLabelComment') .. ':' RVTextEdit id: commentText diff --git a/modules/game_screenshot/game_screenshot.otui b/modules/game_screenshot/game_screenshot.otui index 57a71a2c13..9451e597b5 100644 --- a/modules/game_screenshot/game_screenshot.otui +++ b/modules/game_screenshot/game_screenshot.otui @@ -9,8 +9,8 @@ UIWidget OptionCheckBoxMarked id: onlyCaptureGameWindow - !text: tr('Only Capture Game Window') - !tooltip: tr('If you check this option, the screenshots will only be taken from\nthe game window instead of the complete client interface. This\nmight improve your game performance, particularly if you have\nticked the Screenshot Backlog option.') + !text: localize('ScreenshotCheckboxGameWindow') + !tooltip: localize('ScreenshotTooltipGameWindow') SmallReversedQtPanel anchors.left: parent.left @@ -21,8 +21,8 @@ UIWidget OptionCheckBoxMarked id: keepBlacklog - !text: tr('Keep Blacklog of the Screenshots of the Last 5 Seconds') - !tooltip: tr('If you check this option, the client takes a screenshot every\nsecond and caches the last 5 of them. Whenever a screenshot is\ntaken either automatically for a selected event or manually using a\nhotkey, also the screenshots of the previous 5 seconds will be\nsaved.\nIf you experience frame stuttering, you should consider disabling\nthis option..') + !text: localize('ScreenshotCheckboxBacklog') + !tooltip: localize('ScreenshotTooltipBacklog') SmallReversedQtPanel id: Opciones3 @@ -34,12 +34,12 @@ UIWidget OptionCheckBoxMarked id: enableScreenshots - !text: tr('Enable Auto Screenshots') - !tooltip: tr('Enable this option to save screenshots of the most important\nmoments of your Tibia career! Whenever one of the events you\nhave selected takes place, a screenshot will be taken\nautomatically.\n\nThe following events can be selected to trigger an auto screenshot:\n\n- Level Up: Your character has reached the next level\n- Skill Up: You advanced in one of your skills (e.g. Magic Level\nor Sword Fighting)\n- Achievement: You earned an achievement, either while\nplaying or upon login\n- Bestiary Entry Unlocked: You unlocked new information\nabout a creature in the Bestiary\n- Bestiary Entry Completed: You unlocked all information about\na creature in the Bestiary\n- Treasure Found: You received some reward from a container\nfor solving a quest or a riddle\n- Valuable Loot: You just found some loot which you have\nmarked in the Drop Tracker\n- Boss Defeated: You defeated a boss monster, either alone or\ntogether with other players, and are entitled to loot it\n- Death PvE: You were just killed by some creature (PvE)\n- Death PvP: You were just killed by another player (PvP)\n- Player Kill: You defeated another player\n- Player Killer Assist: You assisted the killing of another player\n- Player Attacking: Another player just started to attack you\n- Highest Damage Dealt: You dealt a new all-time high damage\non a foe. To see or reset your current all-time high, check\nthe Impact Analyser\n- Highest Healing Done: You healed someone with a new all-\ntime high healing value. To see or reset your current all-time\nhigh, check the Impact Analyser\n- Low Health: You have reached a threshold of deep red\nhealth Copy') + !text: localize('ScreenshotCheckboxAutoCapture') + !tooltip: localize('ScreenshotTooltipAutoCapture') checked: false Label - !text: tr('Select all events that sould trigger auto Screenshots:') + !text: localize('ScreenshotLabelAutoCapture') .. ":" anchors.left: parent.left margin-left: 18 margin-top: 5 @@ -62,14 +62,14 @@ UIWidget fit-children: true Button - !text: tr('Reset') + !text: localize('UIButtonReset') width: 64 anchors.right: parent.right anchors.bottom: parent.bottom @onClick: modules.game_screenshot.resetValues() Button - !text: tr('Open Screenshots Folder') + !text: localize('ScreenshotButtonOpenFolder') width: 164 anchors.left: parent.left anchors.bottom: parent.bottom diff --git a/modules/game_shop/shop.otui b/modules/game_shop/shop.otui index 89a0fdebbc..ff0db18d14 100644 --- a/modules/game_shop/shop.otui +++ b/modules/game_shop/shop.otui @@ -132,7 +132,7 @@ ShopOfferImage < ShopOffer MainWindow id: shopWindow - !text: tr('Shop') + !text: localize('StoreWindowTitle') size: 750 500 @onEscape: modules.game_shop.hide() $mobile: @@ -160,7 +160,7 @@ MainWindow anchors.top: prev.bottom margin-top: 10 visible: false - !text: tr("Buy points2") + !text: localize("StoreButtonBuyPoints") Panel id: adPanel @@ -222,7 +222,7 @@ MainWindow Button id: transactionHistory - !text: tr('Transaction history') + !text: localize('StoreButtonTransactionHistory') width: 128 anchors.left: parent.left anchors.bottom: parent.bottom