diff --git a/modules/client_locales/locales.lua b/modules/client_locales/locales.lua index 23e781a5..b2a02d61 100644 --- a/modules/client_locales/locales.lua +++ b/modules/client_locales/locales.lua @@ -4,6 +4,14 @@ Locales = { } local defaultLocaleName = 'en-us' local installedLocales local currentLocale +local localeComboBox + +-- private functions +local function onLocaleComboBoxOptionChange(self, optionText, optionData) + Locales.setLocale(optionData) + Settings.set('locale', optionData) + reloadModules() +end -- public functions function Locales.init() @@ -21,15 +29,20 @@ function Locales.init() Settings.set('locale', defaultLocaleName) end - -- add event for creating combobox - --for key,value in pairs(installedLocales) do - -- add elements - --end + addEvent( function() + localeComboBox = createWidget('ComboBox', rootWidget:recursiveGetChildById('rightButtonsPanel')) + for key,value in pairs(installedLocales) do + localeComboBox:addOption(value.languageName, value.name) + end + localeComboBox:setCurrentOption(currentLocale.languageName) + localeComboBox.onOptionChange = onLocaleComboBoxOptionChange + end, false) end function Locales.terminate() installedLocales = nil currentLocale = nil + localeComboBox = nil end function Locales.installLocale(locale) diff --git a/modules/client_locales/locales/en-us.lua b/modules/client_locales/locales/en-us.lua index 374ac6d0..2c65a3de 100644 --- a/modules/client_locales/locales/en-us.lua +++ b/modules/client_locales/locales/en-us.lua @@ -1,8 +1,9 @@ locale = { - name = 'en-us', + name = 'en-us', + languageName = 'English', - -- Translations not needed. en-us is already default. - translation = {} + -- Translations not needed. en-us is already default. + translation = {} } Locales.installLocale(locale) \ No newline at end of file diff --git a/modules/client_locales/locales/pt-br.lua b/modules/client_locales/locales/pt-br.lua index 33d8eaf0..ae78f531 100644 --- a/modules/client_locales/locales/pt-br.lua +++ b/modules/client_locales/locales/pt-br.lua @@ -1,13 +1,14 @@ -- to find all possible translations in the source code use the following command: --- find \( -name '*.lua' -o -name '*.otui' \) -exec grep -oE "tr\\('(\\\\'|[^'])*'" {} \; -exec grep -oE "tr\\(\"(\\\\\"|[^\"])*\nil {} \; | sort | uniq | sed "s/^tr(.\(.*\).$/[\"\1\"] = nil,/" +-- find \( -name "*.lua" -o -name "*.otui" \) -exec grep -oE "tr\\("(\\\\"|[^"])*"" {} \; -exec grep -oE "tr\\(\"(\\\\\"|[^\"])*\nil {} \; | sort | uniq | sed "s/^tr(.\(.*\).$/[\"\1\"] = nil,/" locale = { - name = 'pt-br', + name = "pt-br", + languageName = "Português", -- As traduções devem vir sempre em ordem alfabética. translation = { ["Account name"] = "Nome da conta", - ["Account Status:\nFree Account"] = "Estado da conta:\nGratís", + ["Account Status:\nFree Account"] = "Estado da conta:\nGrátis", ["Account Status:\nPremium Account (%s) days left"] = "Estado da conta:\nConta premium (%s) dias faltando", ["Add"] = "Adicionar", ["Add new VIP"] = "Adicionar nova VIP", @@ -16,7 +17,7 @@ locale = { ["Addon 3"] = "Addon 3", ["Add to VIP list"] = "Adicionar a lista VIP", ["Adjust volume"] = "Ajustar volume", - ["All modules and scripts were reloaded."] = "Todos modules e scripts foram recarregados.", + ["All modules and scripts were reloaded."] = "Todos módulos e scripts foram recarregados.", ["Amount:"] = "Quantidade:", ["Attack"] = "Atacar", ["Author"] = "Autor", @@ -24,12 +25,12 @@ locale = { ["Autoload priority"] = "Prioridade de carregamento", ["Auto login"] = "Entrar automaticamente", ["Auto login selected character on next charlist load"] = "Entrar automaticamente com o personagem quando reabrir a lista de personagens", - ["Axe Fighting"] = "Machado", + ["Axe Fighting"] = "Combate com Machado", ["Battle"] = "Batalha", ["Button Assign"] = "Selecionar botão", ["Buy"] = "Comprar", - ["Buy no backpack"] = "Comprar na backpack", - ["Buy with backpack"] = "Comprar com backpack", + ["Buy no backpack"] = "Comprar sem mochila", + ["Buy with backpack"] = "Comprar com mochila", ["Cancel"] = "Cancelar", ["Capacity:"] = "Capacidade:", ["Capacity"] = "Capacidade", @@ -39,8 +40,8 @@ locale = { ["Clear object"] = "Limpar objeto", ["Close"] = "Fechar", ["Close this channel"] = "Fechar esse canal", - ["Club Fighting"] = "Porrete", - ["Combat Controls"] = nil, + ["Club Fighting"] = "Combate com Porrete", + ["Combat Controls"] = "Controles de combate", ["Connecting to game server..."] = "Conectando no servidor do jogo...", ["Connecting to login server..."] = "Conectando no servidor de autenticação...", ["Consider capacity"] = "Considerar capacidade", @@ -48,11 +49,11 @@ locale = { ["Copy Name"] = "Copiar Nome", ["Current hotkeys:"] = "Atalhos atuais", ["Current hotkey to add: %s"] = "Atalho atual para adicionar: %s", - ["Default"] = "Default", + ["Default"] = "Padrão", ["Description"] = "Descrição", ["Detail"] = "Detalhe", ["Disable Shared Experience"] = "Desativar experiência compartilhada", - ["Distance Fighting"] = "Flecha", + ["Distance Fighting"] = "Combate a Distância", ["Edit hotkey text:"] = "Editar texto do atalho", ["Edit Text"] = "Editar Texto", ["Enable Shared Experience"] = "Ativar experiência compartilhada", @@ -66,33 +67,36 @@ locale = { ["Follow"] = "Seguir", ["Frame rate limit"] = "Limite de FPS", ["Fullscreen"] = "Tela cheia", + ["General"] = "Geral", + ["Graphics"] = "Gráficos", ["Head"] = "Cabeça", ["Health Bar"] = "Barra de Vida", + ["Help"] = "Ajuda", ["Hide monsters"] = "Esconder montros", ["Hide non-skull players"] = "Esconder jogadores sem caveira", ["Hide Npcs"] = "Esconder NPCs", ["Hide party members"] = "Esconder membros do grupo", ["Hide players"] = "Esconder jogadores", - ["Hit Points"] = "Vida", + ["Hit Points"] = "Pontos de Vida", ["Hotkeys"] = "Atalhos", ["Ignore capacity"] = "Ignorar capacidade", ["Ignore equipped"] = "Ignorar equipado", ["Inventory"] = "Inventário", ["Invite to Party"] = "Convidar para o grupo", - ["Invite to private chat"] = "Convidar para canal privado", - ["Join %s\'s Party"] = "Entrar no grupo do %s", + ["Invite to private chat"] = "Convidar para o canal privado", + ["Join %s\"s Party"] = "Entrar no grupo do %s", ["Leave Party"] = "Sair do grupo", ["Level"] = "Nível", ["Limits FPS to 60"] = "Limita o FPS para 60", - ["List of items that you're able to buy"] = "Listar itens que você não pode comprar", - ["List of items that you're able to sell"] = "Listar itens que você pode comprar", + ["List of items that you're able to buy"] = "Lista de itens que você pode comprar", + ["List of items that you're able to sell"] = "Lista de itens que você pode vender", ["Load"] = "Carregar", ["Loggin out..."] = "Saindo...", ["Login"] = "Entrar", ["Login Error"] = "Erro de Autenticação", ["Look"] = "Olhar", ["Magic Level"] = "Nível Mágico", - ["Make sure that your client uses\nthe correct game protocol version"] = "Tenha certeza que o seu cliente use\no mesmo protocolo do server do jogo", + ["Make sure that your client uses\nthe correct game protocol version"] = "Tenha certeza que o seu cliente use\no mesmo protocolo do servidor do jogo", ["Mana"] = "Mana", ["Manage hotkeys:"] = "Configurar atalhos:", ["Message of the day"] = "Mensagem do dia", @@ -101,96 +105,97 @@ locale = { ["Module Manager"] = "Gerenciador de Módulos", ["Module name"] = "Nomo do módulo", ["Money:"] = "Dinheiro:", - ["Move Stackable Item"] = "Move item contável", + ["Move Stackable Item"] = "Mover item contável", ["Move up"] = "Mover para cima", ["Name:"] = "Nome:", ["NPC Trade"] = "Troca com NPC", ["Ok"] = "Ok", ["Open"] = "Abrir", ["Open a private message channel:"] = "Abrir um canal privado:", - ["Open charlist automatically when starting otclient"] = "Abrir lista de personágens", - ["Open in new window"] = nil, - ["Open new channel"] = nil, - ["Options"] = nil, - ["Outfit Name"] = nil, - ["Pass Leadership to %s"] = nil, - ["Password"] = nil, - ["Please enter a character name:"] = nil, - ["Please, press the key you wish to add onto your hotkeys manager"] = nil, - ["Please wait"] = nil, - ["Port"] = nil, - ["Price:"] = nil, - ["Primary"] = nil, - ["Quantity:"] = nil, - ["Refresh"] = nil, - ["Reload All"] = nil, - ["Remember account and password when starts otclient"] = nil, - ["Remember password"] = nil, - ["Remove"] = nil, - ["Remove %s"] = nil, - ["Revoke %s\'s Invitation"] = nil, - ["Rotate"] = nil, - ["Search:"] = nil, - ["Secondary"] = nil, - ["Select object"] = nil, - ["Select Outfit"] = nil, - ["Sell"] = nil, - ["Send automatically"] = nil, - ["Server"] = nil, - ["Server Log"] = nil, - ["Set Outfit"] = nil, - ["Shielding"] = nil, - ["Show all items"] = nil, - ["Show event messages in console"] = nil, - ["Show frame rate"] = nil, - ["Show info messages in console"] = nil, - ["Show levels in console"] = nil, - ["Show only holding items"] = nil, - ["Show private messages in console"] = nil, - ["Show status messages in console"] = nil, - ["Show timestamps in console"] = nil, - ["Skills"] = nil, - ["Soul Points"] = nil, - ["Stamina"] = nil, - ["Stop Attack"] = nil, - ["Stop Follow"] = nil, - ["%s: (use object)"] = nil, - ["%s: (use object on target)"] = nil, - ["%s: (use object on yourself)"] = nil, - ["%s: (use object with crosshair)"] = nil, - ["Sword Fighting"] = nil, - ["Terminal"] = nil, - ["There is no way."] = nil, - ["Trade with ..."] = nil, - ["Unable to logout."] = nil, - ["Unload"] = nil, - ["Use"] = nil, - ["Use on target"] = nil, - ["Use on yourself"] = nil, - ["Use with ..."] = nil, - ["Version"] = nil, - ["VIP list"] = nil, - ["VIP List"] = nil, - ["Website"] = nil, - ["Weight:"] = nil, - ["With crosshair"] = nil, - ["You are burning"] = nil, - ["You are cursed"] = nil, - ["You are dazzled"] = nil, - ["You are drowing"] = nil, - ["You are electrified"] = nil, - ["You are freezing"] = nil, - ["You are hasted"] = nil, - ["You are paralysed"] = nil, - ["You are poisoned"] = nil, - ["You are protected by a magic shield"] = nil, - ["You are strengthened"] = nil, - ["You are within a protection zone"] = nil, - ["You have %s percent"] = nil, - ["You have %s percent to go"] = nil, - ["You may not logout during a fight"] = nil, - ["You may not logout or enter a protection zone"] = nil, - ["You must select a character to login!"] = nil, + ["Open charlist automatically when starting otclient"] = "Abrir lista de personagens", + ["Open in new window"] = "Abrir em nova janela", + ["Open new channel"] = "Abrir novo canal", + ["Options"] = "Opções", + ["Outfit Name"] = "Nome da roupa", + ["Pass Leadership to %s"] = "Passar liderança para %s", + ["Password"] = "Senha", + ["Please enter a character name:"] = "Por favor, entre com o nome do personagem:", + ["Please, press the key you wish to add onto your hotkeys manager"] = "Por favor, pressione a tecla que você deseja adicionar no gerenciador de atalhos", + ["Please wait"] = "Por favor, espere", + ["Port"] = "Porta", + ["Price:"] = "Preço", + ["Primary"] = "Primário", + ["Quantity:"] = "Quantidade:", + ["Refresh"] = "Atualizar", + ["Reload All"] = "Recarregar Todos", + ["Remember account and password when starts otclient"] = "Lembrar conta e senha quando o cliente iniciar", + ["Remember password"] = "Lembrar senha", + ["Remove"] = "Remover", + ["Remove %s"] = "Remover %s", + ["Revoke %s\"s Invitation"] = "Rejeitar o convite de %s", + ["Rotate"] = "Girar", + ["Search:"] = "Procurar:", + ["Secondary"] = "Secundário", + ["Select object"] = "Selecionar objeto", + ["Select Outfit"] = "Selecionar Roupa", + ["Sell"] = "Vender", + ["Send automatically"] = "Vender automaticamente", + ["Server"] = "Servidor", + ["Server Log"] = "Registro do servidor", + ["Set Outfit"] = "Escolher Roupa", + ["Shielding"] = "Defesa", + ["Show all items"] = "Exibir todos os itens", + ["Show event messages in console"] = "Exibir mensagens de eventos no console", + ["Show frame rate"] = "Exibir FPS", + ["Show info messages in console"] = "Exibir mensagens informativas no console", + ["Show levels in console"] = "Exibir níveis no console", + ["Show only holding items"] = "Exibir somente seus itens", + ["Show private messages in console"] = "Exibir mensagens privadas no console", + ["Show status messages in console"] = "Exibir mensagens de estado no console", + ["Show timestamps in console"] = "Exibir o horário no console", + ["Skills"] = "Habilidades", + ["Soul Points"] = "Pontos de Alma", + ["Stamina"] = "Vigor", + ["Stop Attack"] = "Parar de Atacar", + ["Stop Follow"] = "Parar de Seguir", + ["%s: (use object)"] = "%s: (usar objeto)", + ["%s: (use object on target)"] = "%s: (usar objeto no alvo)", + ["%s: (use object on yourself)"] = "%s: (usar objeto em si)", + ["%s: (use object with crosshair)"] = "%s: (usar objeto com mira)", + ["Sword Fighting"] = "Combate com Espada", + ["Terminal"] = "Terminal", + ["There is no way."] = "Não há rota", + ["Trade"] = "Trocar", + ["Trade with ..."] = "Trocar com ...", + ["Unable to logout."] = "Não é possivel sair", + ["Unload"] = "Descarregar", + ["Use"] = "Usar", + ["Use on target"] = "Usar no alvo", + ["Use on yourself"] = "Usar em si", + ["Use with ..."] = "Usar com ...", + ["Version"] = "Versão", + ["VIP list"] = "Lista VIP", + ["VIP List"] = "Lista VIP", + ["Website"] = "Website", + ["Weight:"] = "Peso", + ["With crosshair"] = "Com mira", + ["You are burning"] = "Você está queimando", + ["You are cursed"] = "Você está amaldiçoado", + ["You are dazzled"] = "Você está deslumbrado", + ["You are drowing"] = "Você está se afogando", + ["You are electrified"] = "Você está eletrificado", + ["You are freezing"] = "Você está congelando", + ["You are hasted"] = "Você está com pressa", + ["You are paralysed"] = "Você está paralizado", + ["You are poisoned"] = "Você está envenenado", + ["You are protected by a magic shield"] = "Você está protegido com um escudo mágico", + ["You are strengthened"] = "Você está reforçado", + ["You are within a protection zone"] = "Você está dentro de uma zona de proteção", + ["You have %s percent"] = "Você tem %s porcento", + ["You have %s percent to go"] = "Você tem %s porcento para avançar", + ["You may not logout during a fight"] = "Você não pode sair durante um combate", + ["You may not logout or enter a protection zone"] = "Você não pode sair ou entrar em uma zona de proteção", + ["You must select a character to login!"] = "Você deve selecionar um personagem para entrar!", } -- Adicionar informações de números. 1.000 100,00 1.000,00 etc. diff --git a/modules/client_options/options.lua b/modules/client_options/options.lua index 1f6c4f6c..ca4a0796 100644 --- a/modules/client_options/options.lua +++ b/modules/client_options/options.lua @@ -31,8 +31,8 @@ function Options.init() optionsButton = TopMenu.addLeftButton('optionsButton', tr('Options'), 'options.png', Options.toggle) optionsTabBar = optionsWindow:getChildById('optionsTabBar') optionsTabBar:setContentWidget(optionsWindow:getChildById('optionsTabContent')) - optionsTabBar:addTab('General', loadUI('general.otui')) - optionsTabBar:addTab('Graphics', loadUI('graphics.otui')) + optionsTabBar:addTab(tr('General'), loadUI('general.otui')) + optionsTabBar:addTab(tr('Graphics'), loadUI('graphics.otui')) end function Options.terminate() diff --git a/modules/game_console/console.lua b/modules/game_console/console.lua index cea76dc1..183849c6 100644 --- a/modules/game_console/console.lua +++ b/modules/game_console/console.lua @@ -106,7 +106,7 @@ local function onCreatureSpeak(name, level, speaktype, message, channelId, creat end local function onOpenChannel(channelId, channelName) - Console.addChannel(channelName, channelId) + Console.addChannel(tr(channelName), channelId) end local function onOpenPrivateChannel(receiver) diff --git a/modules/game_viplist/viplist.lua b/modules/game_viplist/viplist.lua index e3907cb9..378c22ce 100644 --- a/modules/game_viplist/viplist.lua +++ b/modules/game_viplist/viplist.lua @@ -115,7 +115,7 @@ function VipList.onVipListMousePress(widget, mousePos, mouseButton) local vipList = vipWindow:getChildById('contentsPanel') local menu = createWidget('PopupMenu') - menu:addOption('Add new VIP', function() VipList.createAddWindow() end) + menu:addOption(tr('Add new VIP'), function() VipList.createAddWindow() end) menu:display(mousePos) return true