diff --git a/README.md b/README.md index ca607d6..e3a14a5 100644 --- a/README.md +++ b/README.md @@ -1,29 +1,24 @@ -# Oficios v1.0.0 +# Oficios para Minetest -[![Baixar](https://img.shields.io/badge/Baixar-v1.0.0-green.svg)](https://github.com/BrunoMine/oficios/archive/v1.0.0.zip) -[![Projeto](https://img.shields.io/badge/Git-Projeto-green.svg)](https://github.com/BrunoMine/oficios) -[![Licença](https://img.shields.io/badge/Licença-LGPL_v3.0-blue.svg)](https://github.com/BrunoMine/oficios/blob/master/LICENSE) +[![download](https://img.shields.io/github/tag/BrunoMine/sociedades.svg?style=flat-square&label=release)](https://github.com/BrunoMine/oficios/archive/master.zip) +[![git](https://img.shields.io/badge/git-project-green.svg?style=flat-square)](https://github.com/BrunoMine/oficios) +[![forum](https://img.shields.io/badge/minetest-mod-green.svg?style=flat-square)](https://forum.minetest.net) +[![bower](https://img.shields.io/badge/bower-mod-green.svg?style=flat-square)](https://minetest-bower.herokuapp.com/mods/oficios) -## Descrição -API de oficios - -## Recursos do projeto - -* [Baixar](https://github.com/BrunoMine/oficios/archive/v1.0.0.zip) -* [Projeto](https://github.com/BrunoMine/oficios) - -## Requisitos - -* Minetest 0.4.15 ou superior +## Requitos +* Minetest 0.5.0 ou superior +* Mod shields +* Mod shooter +* Mod macronodes +* Mod macronodes (opicional) +* Mod sfinv (opicional) * Mod default +* Mod wool +* Mod beds +* Mod stairs +* Mod fire +* Mod tnt -## Licença -Veja LICENSE.txt para informações detalhadas da licença LGPL 3.0 - -### Autores do código fonte -Originalmente por BrunoMine, Bruno Borges (LGPL 3.0) - -### Autores de mídias (texturas, modelos and sons) -Todos os que não estão listados aqui são de autoria de -BrunoMine, Bruno Borges (CC BY-SA 3.0) +## Sobre +Esse modpack adiciona oficios em minetest. diff --git a/depends.txt b/depends.txt index 13f19e4..8b13789 100644 --- a/depends.txt +++ b/depends.txt @@ -1,2 +1 @@ -default -sfinv? + diff --git a/description.txt b/description.txt new file mode 100644 index 0000000..6aa533e --- /dev/null +++ b/description.txt @@ -0,0 +1 @@ +Adiciona oficios ao jogo | Adds metier to the game diff --git a/formularios.lua b/formularios.lua deleted file mode 100644 index 80fd0a1..0000000 --- a/formularios.lua +++ /dev/null @@ -1,132 +0,0 @@ ---[[ - Mod Oficios para Minetest - Copyright (C) 2017 BrunoMine (https://github.com/BrunoMine) - - Recebeste uma cópia da GNU Lesser General - Public License junto com esse software, - se não, veja em . - - Formulários - ]] - -oficios.form = {} - --- Menu de Escolha -oficios.form.inicial = "size[8,4.5]".. - default.gui_bg.. - default.gui_bg_img.. - "label[0,0;Escolha o seu Oficio]".. - -- "button_exit[5,0;3,1;;Escolher depois]".. - -- Nomes dos Oficios - "label[0.2,1.1;Ferreiro]".. - "label[2.2,1.1;Cientista]".. - "label[4.2,1.1;Cozinheiro]".. - "label[6.2,1.1;Construtor]".. - -- Imagens dos Oficios - "image[0.1,1.5;2,2;oficios_ferreiro.png]".. - "image[2.1,1.5;2,2;oficios_cientista.png]".. - "image[4.1,1.5;2,2;oficios_cozinheiro.png]".. - "image[6.1,1.5;2,2;oficios_construtor.png]".. - -- Botoes de escolha de Oficio - "button[0.25,3.3;1.55,1;escolher_ferreiro;Escolher]".. - "button[2.25,3.3;1.55,1;escolher_cientista;Escolher]".. - "button[4.25,3.3;1.55,1;escolher_cozinheiro;Escolher]".. - "button[6.25,3.3;1.55,1;escolher_construtor;Escolher]" - --- Descricao de Ferreiro -oficios.form.desc_ferreiro = "size[9,4.5]".. - default.gui_bg.. - default.gui_bg_img.. - "label[1.4,0;FERREIRO]".. - -- Image do Oficio - "image[0.5,0.5;3,3;oficios_ferreiro.png]".. - -- Descricao - "label[3.4,0.5;O Ferreiro pode montar ".. - "\nvarios itens compostos de ".. - "\nmetais. ".. - "\nSeu foco maior acaba por ser ".. - "\nem itens para combate onde ".. - "\npode causar maior dano. ]".. - "button[1,3.5;3,1;aceitar;Ser Ferreiro]".. - "button[4,3.5;3,1;voltar;Voltar]" - --- Descricao de Cientista -oficios.form.desc_cientista = "size[9,4.5]".. - default.gui_bg.. - default.gui_bg_img.. - "label[1.4,0;CIENTISTA]".. - -- Image do Oficio - "image[0.5,0.5;3,3;oficios_cientista.png]".. - -- Descricao - "label[3.4,0.5;O Cientista possui uma ".. - "\ncaracteristica especial de ".. - "\nmontar itens diversificados. ".. - "\nSeu foco costuma estar em ".. - "\nutilidades nada convensionais ".. - "\nque as vezes pode surpreender. ]".. - "button[1,3.5;3,1;aceitar;Ser Cientista]".. - "button[4,3.5;3,1;voltar;Voltar]" - --- Descricao de Cientista -oficios.form.desc_cozinheiro = "size[9,4.5]".. - default.gui_bg.. - default.gui_bg_img.. - "label[1.4,0;COZINHEIRO]".. - -- Image do Oficio - "image[0.5,0.5;3,3;oficios_cozinheiro.png]".. - -- Descricao - "label[3.4,0.5;O Cozinheiro consegue ".. - "\nperceber o que existe de ".. - "\nmelhor para comer e prepara ".. - "\nsempre bons pratos. ".. - "\nSeu enfoque se encontra nos ".. - "\ncomestiveis. ]".. - "button[1,3.5;3,1;aceitar;Ser Cozinheiro]".. - "button[4,3.5;3,1;voltar;Voltar]" - --- Descricao de Construtor -oficios.form.desc_construtor = "size[9,4.5]".. - default.gui_bg.. - default.gui_bg_img.. - "label[1.4,0;CONSTRUTOR]".. - -- Image do Oficio - "image[0.5,0.5;3,3;oficios_construtor.png]".. - -- Descricao - "label[3.4,0.5;O Construtor sempre sabe ".. - "\ncomo erguer uma bela ".. - "\nestrutura seja qual for ".. - "\no material ou necessidade. ".. - "\nSeu enfoque vai em itens".. - "\npara estruturar. ]".. - "button[1,3.5;3,1;aceitar;Ser Construtor]".. - "button[4,3.5;3,1;voltar;Voltar]" - --- Aviso de falta de itens -oficios.form.aviso_falta_item = "size[6,2]".. - default.gui_bg.. - default.gui_bg_img.. - "label[0,0;Precisar ter os itens requisitados \npara iniciar a montagem]".. - "button_exit[2,1;2,1;voltar_ao_item;Voltar]" - --- Aviso de falta espaco no inventario -oficios.form.aviso_inv_lotado = "size[6,2]".. - default.gui_bg.. - default.gui_bg_img.. - "label[0,0;Inventario lotado \nEsvazie um pouco]".. - "button_exit[2,1;2,1;voltar_ao_item;Voltar]" - --- Aviso de nivel insuficiente -oficios.form.aviso_nivel_insuficiente = "size[6,2]".. - default.gui_bg.. - default.gui_bg_img.. - "label[0,0;Nivel muito baixo. Precisa ter um \nnivel maior para montar esse item]".. - "button_exit[2,1;2,1;voltar_ao_item;Voltar]" - --- Aviso de falta de receitas em algum oficio -oficios.form.aviso_sem_receita = "size[6,2]".. - default.gui_bg.. - default.gui_bg_img.. - "label[0,0;Faltam receitas e algum oficios \nPrecisa existir ao menos uma receita \npara cada oficio]" - - - diff --git a/modpack.txt b/modpack.txt new file mode 100644 index 0000000..8b13789 --- /dev/null +++ b/modpack.txt @@ -0,0 +1 @@ + diff --git a/API.txt b/oficios/API.txt similarity index 100% rename from API.txt rename to oficios/API.txt diff --git a/LICENSE b/oficios/LICENSE similarity index 100% rename from LICENSE rename to oficios/LICENSE diff --git a/oficios/README.md b/oficios/README.md new file mode 100644 index 0000000..4fe6812 --- /dev/null +++ b/oficios/README.md @@ -0,0 +1,20 @@ +# Oficios v1.0.0 + +## Descrição +API de oficios + +## Requisitos +* Minetest 0.5.0 ou superior +* Mod default +* Mod sfinv (opicional) + +## Licença +Veja LICENSE.txt para informações detalhadas da licença LGPL 3.0 + +### Autores do código fonte +Originalmente por BrunoMine, Bruno Borges (LGPL 3.0) + +### Autores de mídias (texturas, modelos and sons) +Todos os que não estão listados aqui são de autoria de +BrunoMine, Bruno Borges (CC BY-SA 3.0) + diff --git a/banco_de_dados.lua b/oficios/banco_de_dados.lua similarity index 100% rename from banco_de_dados.lua rename to oficios/banco_de_dados.lua diff --git a/contador_tempo.lua b/oficios/contador_tempo.lua similarity index 100% rename from contador_tempo.lua rename to oficios/contador_tempo.lua diff --git a/oficios/depends.txt b/oficios/depends.txt new file mode 100644 index 0000000..13f19e4 --- /dev/null +++ b/oficios/depends.txt @@ -0,0 +1,2 @@ +default +sfinv? diff --git a/diretrizes.lua b/oficios/diretrizes.lua similarity index 100% rename from diretrizes.lua rename to oficios/diretrizes.lua diff --git a/oficios/formularios.lua b/oficios/formularios.lua new file mode 100644 index 0000000..682cc69 --- /dev/null +++ b/oficios/formularios.lua @@ -0,0 +1,115 @@ +--[[ + Mod Oficios para Minetest + Copyright (C) 2017 BrunoMine (https://github.com/BrunoMine) + + Recebeste uma cópia da GNU Lesser General + Public License junto com esse software, + se não, veja em . + + Formulários + ]] + +local S = oficios.S + +oficios.form = {} + +-- Menu de Escolha +oficios.form.inicial = "size[8,4.5]".. + default.gui_bg.. + default.gui_bg_img.. + "label[0,0;"..S("Escolha o seu Ofício").."]".. + -- "button_exit[5,0;3,1;;Escolher depois]".. + -- Nomes dos Oficios + "label[0.2,1.1;"..S("Ferreiro").."]".. + "label[2.2,1.1;"..S("Cientista").."]".. + "label[4.2,1.1;"..S("Cozinheiro").."]".. + "label[6.2,1.1;"..S("Construtor").."]".. + -- Imagens dos Oficios + "image[0.1,1.5;2,2;oficios_ferreiro.png]".. + "image[2.1,1.5;2,2;oficios_cientista.png]".. + "image[4.1,1.5;2,2;oficios_cozinheiro.png]".. + "image[6.1,1.5;2,2;oficios_construtor.png]".. + -- Botoes de escolha de Oficio + "button[0.25,3.3;1.55,1;escolher_ferreiro;"..S("Escolher").."]".. + "button[2.25,3.3;1.55,1;escolher_cientista;"..S("Escolher").."]".. + "button[4.25,3.3;1.55,1;escolher_cozinheiro;"..S("Escolher").."]".. + "button[6.25,3.3;1.55,1;escolher_construtor;"..S("Escolher").."]" + +-- Descricao de Ferreiro +oficios.form.desc_ferreiro = "size[9,4.5]".. + default.gui_bg.. + default.gui_bg_img.. + "label[0.6,0;"..S("Ferreiro").."]".. + -- Image do Oficio + "image[0.5,0.5;3,3;oficios_ferreiro.png]".. + -- Descricao + "textarea[3.6,0.5;4.4,3.4;;"..S("O Ferreiro pode montar varios itens compostos de metais. Seu foco maior acaba por ser em itens para combate onde pode causar maior dano.")..";]".. + "label[3.4,0.5;]".. + "button[1,3.5;3,1;aceitar;"..S("Ser Ferreiro").."]".. + "button[4,3.5;3,1;voltar;"..S("Voltar").."]" + +-- Descricao de Cientista +oficios.form.desc_cientista = "size[9,4.5]".. + default.gui_bg.. + default.gui_bg_img.. + "label[0.6,0;"..S("Cientista").."]".. + -- Image do Oficio + "image[0.5,0.5;3,3;oficios_cientista.png]".. + -- Descricao + "textarea[3.6,0.5;4.4,3.4;;"..S("O Cientista possui uma característica especial de montar itens diversificados. Seu foco costuma estar em utilidades nada convencionais que as vezes pode surpreender.")..";]".. + "button[1,3.5;3,1;aceitar;"..S("Ser Cientista").."]".. + "button[4,3.5;3,1;voltar;"..S("Voltar").."]" + +-- Descricao de Cientista +oficios.form.desc_cozinheiro = "size[9,4.5]".. + default.gui_bg.. + default.gui_bg_img.. + "label[0.6,0;"..S("Cozinheiro").."]".. + -- Image do Oficio + "image[0.5,0.5;3,3;oficios_cozinheiro.png]".. + -- Descricao + "textarea[3.6,0.5;4.4,3.4;;"..S("O Cozinheiro consegue perceber o que existe de melhor para comer e prepara sempre bons pratos. Seu enfoque se encontra nos comestíveis.")..";]".. + "button[1,3.5;3,1;aceitar;"..S("Ser Cozinheiro").."]".. + "button[4,3.5;3,1;voltar;"..S("Voltar").."]" + +-- Descricao de Construtor +oficios.form.desc_construtor = "size[9,4.5]".. + default.gui_bg.. + default.gui_bg_img.. + "label[0.6,0;"..S("Construtor").."]".. + -- Image do Oficio + "image[0.5,0.5;3,3;oficios_construtor.png]".. + -- Descricao + "textarea[3.6,0.5;4.4,3.4;;"..S("O Construtor sempre sabe como erguer uma bela estrutura seja qual for o material ou necessidade. Seu enfoque vai em itens para estruturar.")..";]".. + "button[1,3.5;3,1;aceitar;"..S("Ser Construtor").."]".. + "button[4,3.5;3,1;voltar;"..S("Voltar").."]" + +-- Aviso de falta de itens +oficios.form.aviso_falta_item = "size[6,2]".. + default.gui_bg.. + default.gui_bg_img.. + "textarea[1,1;6.4,2;;"..S("Precisa ter os itens requisitados para iniciar a montagem.")..";]".. + "button_exit[3,3;2,1;voltar_ao_item;"..S("Voltar").."]" + +-- Aviso de falta espaco no inventario +oficios.form.aviso_inv_lotado = "size[6,2]".. + default.gui_bg.. + default.gui_bg_img.. + "textarea[1,1;6.4,2;;"..S("Inventário lotado. Esvazie um pouco.")..";]".. + "button_exit[3,3;2,1;voltar_ao_item;"..S("Voltar").."]" + +-- Aviso de nivel insuficiente +oficios.form.aviso_nivel_insuficiente = "size[6,2]".. + default.gui_bg.. + default.gui_bg_img.. + "textarea[1,1;6.4,2;;"..S("Nível muito baixo. Precisa ter um nível maior para montar esse item.")..";]".. + "button_exit[3,3;2,1;voltar_ao_item;"..S("Voltar").."]" + +-- Aviso de falta de receitas em algum oficio +oficios.form.aviso_sem_receita = "size[6,2]".. + default.gui_bg.. + default.gui_bg_img.. + "textarea[1,1;6.4,2;;"..S("Falta receita em algum ofício. Precisa existir ao menos uma receita para cada ofício.")..";]" + + + diff --git a/funcoes.lua b/oficios/funcoes.lua similarity index 83% rename from funcoes.lua rename to oficios/funcoes.lua index a3f5fca..0ee9696 100644 --- a/funcoes.lua +++ b/oficios/funcoes.lua @@ -1,6 +1,6 @@ --[[ Mod Oficios para Minetest - Copyright (C) 2017 BrunoMine (https://github.com/BrunoMine) + Copyright (C) 2018 BrunoMine (https://github.com/BrunoMine) Recebeste uma cópia da GNU Lesser General Public License junto com esse software, @@ -10,7 +10,7 @@ ]] - +local S = oficios.S -- Botao de retorno local bt_sair = function(loc) @@ -21,6 +21,13 @@ local bt_sair = function(loc) end end +-- Nome exibido de cada oficio +local nome_oficio_tb = { + ["ferreiro"] = S("Ferreiro"), + ["cientista"] = S("Cientista"), + ["cozinheiro"] = S("Cozinheiro"), + ["construtor"] = S("Construtor") +} -- Show Formspec oficios.show_formspec = minetest.show_formspec @@ -66,7 +73,7 @@ local tabela_IDNome = {} -- Tabela de relacionamento de sequencia NomeItem-IDItem local dropdown_NomeID = {["ferreiro"]={},["cientista"]={},["cozinheiro"]={},["construtor"]={}} oficios.montar_receita = function(oficio, item, nivel, desc, xp, item_requisitado, tempo) - + local st = S("(Nível @1) @2", nivel, minetest.registered_items[item].description) -- Inserindo novos dados nas tabelas oficios.receitas[minetest.registered_items[item].description] = { item=item, @@ -77,7 +84,7 @@ oficios.montar_receita = function(oficio, item, nivel, desc, xp, item_requisitad tempo=tempo } table.insert(vetor_niveis[oficio], {nivel=nivel, nome=minetest.registered_items[item].description, item=item}) - tabela_IDNome["(Nivel "..nivel..") "..minetest.registered_items[item].description]={ + tabela_IDNome["(Nível "..nivel..") "..minetest.registered_items[item].description]={ item_id=item, item_nome_real=minetest.registered_items[item].description } @@ -88,14 +95,21 @@ oficios.montar_receita = function(oficio, item, nivel, desc, xp, item_requisitad -- Ordenar vetor_niveis[oficio] = ordenar_por_nivel(vetor_niveis[oficio], lim) - -- Escrever lista - lista_receitas[oficio] = "(Nivel "..vetor_niveis[oficio][1].nivel..") "..vetor_niveis[oficio][1].nome - dropdown_NomeID[oficio]["(Nivel "..vetor_niveis[oficio][1].nivel..") "..vetor_niveis[oficio][1].nome]=1 - local i = 2 - while (i <= lim) do - dropdown_NomeID[oficio]["(Nivel "..vetor_niveis[oficio][i].nivel..") "..vetor_niveis[oficio][i].nome]=i - lista_receitas[oficio] = lista_receitas[oficio]..",(Nivel "..vetor_niveis[oficio][i].nivel..") "..vetor_niveis[oficio][i].nome - i = i + 1 + -- Re/Escrever lista + lista_receitas[oficio] = "" + for + i=1, + lim + do + local stn = S("(Nível @1) @2", vetor_niveis[oficio][i].nivel, vetor_niveis[oficio][i].nome) + -- Atualiza index da tabela com nova string traduzida + tabela_IDNome[stn]={ + item_id=vetor_niveis[oficio][i].item, + item_nome_real=vetor_niveis[oficio][i].nome + } + dropdown_NomeID[oficio][stn]=i + if lista_receitas[oficio] ~= "" then lista_receitas[oficio] = lista_receitas[oficio] .. "," end + lista_receitas[oficio] = lista_receitas[oficio]..stn end end -- Fim de Montar Receitas @@ -325,31 +339,31 @@ oficios.gerar_menu_oficio = function(name, item_nome) local tempo_escrito = "" if tempo[1] > 0 then if tempo[1] == 1 then - tempo[1] = tempo[1].." dia" + tempo[1] = S("1 dia") else - tempo[1] = tempo[1].." dias" + tempo[1] = S("@1 dias", tempo[1]) end end if tempo[2] > 0 then if tempo[2] == 1 then - tempo[2] = tempo[2].." hora" + tempo[2] = S("1 hora") else - tempo[2] = tempo[2].." horas" + tempo[2] = S("@1 horas", tempo[2]) end end if tempo[3] > 0 then if tempo[3] == 1 then - tempo[3] = tempo[3].." minuto" + tempo[3] = S("1 minuto") else - tempo[3] = tempo[3].." minutos" + tempo[3] = S("@1 minutos", tempo[3]) end end if dias > 0 and horas > 0 then - tempo_escrito = tempo[1].." e "..tempo[2] + tempo_escrito = S("@1 e @2", tempo[1], tempo[2]) else if horas > 0 and minutos > 0 then - tempo_escrito = tempo[2].." e "..tempo[3] + tempo_escrito = S("@1 e @2", tempo[2], tempo[3]) else if dias > 0 then tempo_escrito = tempo[1] @@ -370,13 +384,13 @@ oficios.gerar_menu_oficio = function(name, item_nome) inv_formspec(0,4.25).. -- Cabecalho do Oficio "image[0,0;2.5,2.5;oficios_"..oficio..".png]".. - "label[2.2,-0.1;"..string.upper(oficio).." Nivel "..registros_oficios[name].nivel.."]".. + "label[2.2,-0.1;"..S("@1 Nível @2", nome_oficio_tb[oficio], registros_oficios[name].nivel).."]".. -- Painel de espera - "label[4.3,0.6;Montando \n"..registros_oficios[name].montagem.item.. - "\n\nTermina em \n"..tempo_escrito.."]".. + "label[4.3,0.6;"..S("Montando").." \n"..registros_oficios[name].montagem.item.. + "\n\n"..S("Termina em").." \n"..tempo_escrito.."]".. "item_image_button[2.2,0.6;2,2;"..item_id..";;]".. -- Botao sair - bt_sair("6.9,3.3;1.2,1") + bt_sair("6.9,3.3;1.2,1") end @@ -384,7 +398,6 @@ oficios.gerar_menu_oficio = function(name, item_nome) if registros_oficios[name].coletar == "" then - -- Gerar painel normal local xp_prox_nivel = OFICIOS_NIVEIS[(registros_oficios[name].nivel+1)] formspec = "size[8,8.5]".. @@ -393,18 +406,18 @@ oficios.gerar_menu_oficio = function(name, item_nome) inv_formspec(0,4.25).. -- Cabecalho do Oficio "image[0,0;2.5,2.5;oficios_"..oficio..".png]".. - "label[2.2,-0.1;"..string.upper(oficio).." Nivel "..registros_oficios[name].nivel.."]".. + "label[2.2,-0.1;"..S("@1 Nível @2", nome_oficio_tb[oficio], registros_oficios[name].nivel).."]".. -- Botao sair bt_sair("6.9,3.3;1.2,1").. -- Painel de Montagem "dropdown[2.2,0.35;6.15,1;item_selecionado;"..lista_receitas[oficio]..";]".. - "label[2.2,1.1;Selecione algo para produzir]" + "label[2.2,1.1;"..S("Selecione algo para produzir").."]" -- Calcular e inserir dados de desempenho - formspec = formspec .. "label[0.2,2.3;Seu Desempenho \nAtualmente "..registros_oficios[name].xp.." XP " + formspec = formspec .. "label[0.2,2.3;"..S("Seu Desempenho").." \n"..S("Atualmente @1 XP", registros_oficios[name].xp) if registros_oficios[name].nivel < LIMITE_DE_NIVEL then - formspec = formspec .. "\nProximo Nivel "..xp_prox_nivel.." XP" + formspec = formspec .. "\n"..S("Próximo Nível @1 XP", xp_prox_nivel) end - formspec = formspec .. "\nTotal de "..registros_oficios[name].total_itens.." itens montados]" + formspec = formspec .. "\n"..S("Total de @1 itens montados", registros_oficios[name].total_itens).."]" else @@ -415,11 +428,11 @@ oficios.gerar_menu_oficio = function(name, item_nome) inv_formspec(0,4.25).. -- Cabecalho do Oficio "image[0,0;2.5,2.5;oficios_"..oficio..".png]".. - "label[2.2,-0.1;"..string.upper(oficio).." Nivel "..registros_oficios[name].nivel.."]".. + "label[2.2,-0.1;"..S("@1 Nível @2", nome_oficio_tb[oficio], registros_oficios[name].nivel).."]".. -- Painel de conclusao "label[2.3,0.4;"..minetest.registered_items[registros_oficios[name].coletar].description.."]".. - "label[5.2,1;Montado]".. - "item_image_button[2.2,1;3,3;"..registros_oficios[name].coletar..";coletar;Coletar]".. + "label[5.2,1;"..S("Montado").."]".. + "item_image_button[2.2,1;3,3;"..registros_oficios[name].coletar..";coletar;"..S("Coletar").."]".. -- Botao sair bt_sair() @@ -438,14 +451,14 @@ oficios.gerar_menu_oficio = function(name, item_nome) inv_formspec(0,4.75).. -- Cabecalho do Oficio "image[0,0;2.5,2.5;oficios_"..oficio..".png]".. - "label[2.2,-0.1;"..string.upper(oficio).." Nivel "..registros_oficios[name].nivel.."]".. + "label[2.2,-0.1;"..S("@1 Nível @2", nome_oficio_tb[oficio], registros_oficios[name].nivel).."]".. -- Dados sobre a Montagem "label[2.2,1.1;"..item_nome_real.."]".. "item_image_button[0.1,2.5;2,2;"..dados.item..";item;]".. -- descricao - "label[2.2,1.7;"..dados.desc.."]".. + "textarea[2.45,1.7;4.8,3.1;;"..dados.desc..";]".. -- Botao voltar - "button[6.9,3.3;1.2,1;voltar_ao_item;Voltar]".. + "button[6.9,3.3;1.2,1;voltar_ao_item;"..S("Voltar").."]".. -- Painel de Montagem "dropdown[2.2,0.35;6.15,1;item_selecionado;"..lista_receitas[oficio]..";"..dropdown_NomeID[oficio][receita_visualizada[name]].."]" @@ -460,7 +473,7 @@ oficios.gerar_menu_oficio = function(name, item_nome) default.gui_bg.. default.gui_bg_img.. inv_formspec(0,4.75).. - "label[2.2,3.1;Itens requisitados]" + "label[2.2,3.1;"..S("Itens requisitados").."]" if item_requisitado[1] ~= nil then formspec = formspec .. "item_image_button[2.2,3.5;1,1;"..item_requisitado[1][1].." "..item_requisitado[1][2]..";item_req1;]" end @@ -481,38 +494,38 @@ oficios.gerar_menu_oficio = function(name, item_nome) end -- Colocando Tempo de montagem local tempo = oficios.receitas[item_nome_real].tempo - formspec = formspec .. "label[2.2,1.6;Tempo estimado \n" + formspec = formspec .. "label[2.2,1.6;"..S("Tempo estimado").." \n" if tempo[1] > 0 then if tempo[1] == 1 then - formspec = formspec .. tempo[1].." dia" + formspec = formspec .. S("1 dia") else - formspec = formspec .. tempo[1].." dias" + formspec = formspec .. S("@1 dias", tempo[1]) end if tempo[2] > 0 then if tempo[2] == 1 then - formspec = formspec .. " e "..tempo[2].." hora" + formspec = S("@1 e 1 hora", formspec) else - formspec = formspec .. " e "..tempo[2].." horas" + formspec = S("@1 e @2 horas", formspec, tempo[1]) end end elseif tempo[2] > 0 then if tempo[2] == 1 then - formspec = formspec .. tempo[2].." hora" + formspec = S("@1 1 hora") else - formspec = formspec .. tempo[2].." horas" + formspec = S("@1 @2 horas", formspec, tempo[1]) end if tempo[3] > 0 then if tempo[3] == 1 then - formspec = formspec .. " e "..tempo[3].." minuto" + formspec = S("@1 e 1 minuto", formspec) else - formspec = formspec .. " e "..tempo[3].." minutos" + formspec = S("@1 e @2 minutos", formspec, tempo[1]) end end else if tempo[3] == 1 then - formspec = formspec .. tempo[3].." minuto" + formspec = S("@1 1 minuto", formspec) else - formspec = formspec .. tempo[3].." minutos" + formspec = S("@1 @2 minutos", formspec, tempo[1]) end end formspec = formspec .. "]" @@ -520,16 +533,16 @@ oficios.gerar_menu_oficio = function(name, item_nome) formspec = formspec .. -- Cabecalho do Oficio "image[0,0;2.5,2.5;oficios_"..oficio..".png]".. - "label[2.2,-0.1;"..string.upper(oficio).." Nivel "..registros_oficios[name].nivel.."]".. + "label[2.2,-0.1;"..S("@1 Nível @2", nome_oficio_tb[oficio], registros_oficios[name].nivel).."]".. -- Painel de Montagem "dropdown[2.2,0.35;6.15,1;item_selecionado;"..lista_receitas[oficio]..";"..dropdown_NomeID[oficio][item_nome].."]".. -- Dados sobre a Montagem - "label[2.2,1.1;Montar "..item_nome_real.."]".. - "item_image_button[0.1,2.5;2,2;"..item_id..";iniciar;Iniciar]".. - "label[2.2,2.5;Recebe "..core.colorize("#00FF00", oficios.receitas[item_nome_real].xp.." XP").."]".. + "label[2.2,1.1;"..S("Montar @1", item_nome_real).."]".. + "item_image_button[0.1,2.5;2,2;"..item_id..";iniciar;"..S("Iniciar").."]".. + "label[2.2,2.5;"..S("Recebe @1 XP", core.colorize("#00FF00", oficios.receitas[item_nome_real].xp)).."]".. "image_button[7,1.3;1,1;oficios_botao_desc.png;desc;]".. -- Botao voltar - "button[6.9,2.3;1.2,1;voltar;Voltar]" + "button[6.9,2.3;1.2,1;voltar;"..S("Voltar").."]" end end @@ -580,7 +593,7 @@ end -- Registrar em 'sfinv' if sfinv then sfinv.register_page("oficios:oficio", { - title = "Oficio", + title = S("Ofício"), get = function(self, player, context) if context.formspec then return sfinv.make_formspec(player, context, context.formspec, true) diff --git a/imagens tematicas/cubo amarelo.png b/oficios/imagens tematicas/cubo amarelo.png similarity index 100% rename from imagens tematicas/cubo amarelo.png rename to oficios/imagens tematicas/cubo amarelo.png diff --git a/imagens tematicas/cubo azul.png b/oficios/imagens tematicas/cubo azul.png similarity index 100% rename from imagens tematicas/cubo azul.png rename to oficios/imagens tematicas/cubo azul.png diff --git a/imagens tematicas/cubo verde.png b/oficios/imagens tematicas/cubo verde.png similarity index 100% rename from imagens tematicas/cubo verde.png rename to oficios/imagens tematicas/cubo verde.png diff --git a/imagens tematicas/cubo vermelho.png b/oficios/imagens tematicas/cubo vermelho.png similarity index 100% rename from imagens tematicas/cubo vermelho.png rename to oficios/imagens tematicas/cubo vermelho.png diff --git a/imagens tematicas/cubos agrupados.png b/oficios/imagens tematicas/cubos agrupados.png similarity index 100% rename from imagens tematicas/cubos agrupados.png rename to oficios/imagens tematicas/cubos agrupados.png diff --git a/imagens tematicas/oficios cientista fundo.png b/oficios/imagens tematicas/oficios cientista fundo.png similarity index 100% rename from imagens tematicas/oficios cientista fundo.png rename to oficios/imagens tematicas/oficios cientista fundo.png diff --git a/imagens tematicas/oficios cientista.png b/oficios/imagens tematicas/oficios cientista.png similarity index 100% rename from imagens tematicas/oficios cientista.png rename to oficios/imagens tematicas/oficios cientista.png diff --git a/imagens tematicas/oficios construtor fundo.png b/oficios/imagens tematicas/oficios construtor fundo.png similarity index 100% rename from imagens tematicas/oficios construtor fundo.png rename to oficios/imagens tematicas/oficios construtor fundo.png diff --git a/imagens tematicas/oficios construtor.png b/oficios/imagens tematicas/oficios construtor.png similarity index 100% rename from imagens tematicas/oficios construtor.png rename to oficios/imagens tematicas/oficios construtor.png diff --git a/imagens tematicas/oficios cozinheiro fundo.png b/oficios/imagens tematicas/oficios cozinheiro fundo.png similarity index 100% rename from imagens tematicas/oficios cozinheiro fundo.png rename to oficios/imagens tematicas/oficios cozinheiro fundo.png diff --git a/imagens tematicas/oficios cozinheiro.png b/oficios/imagens tematicas/oficios cozinheiro.png similarity index 100% rename from imagens tematicas/oficios cozinheiro.png rename to oficios/imagens tematicas/oficios cozinheiro.png diff --git a/imagens tematicas/oficios ferreiro fundo.png b/oficios/imagens tematicas/oficios ferreiro fundo.png similarity index 100% rename from imagens tematicas/oficios ferreiro fundo.png rename to oficios/imagens tematicas/oficios ferreiro fundo.png diff --git a/imagens tematicas/oficios ferreiro.png b/oficios/imagens tematicas/oficios ferreiro.png similarity index 100% rename from imagens tematicas/oficios ferreiro.png rename to oficios/imagens tematicas/oficios ferreiro.png diff --git a/imagens tematicas/oficios moldura.png b/oficios/imagens tematicas/oficios moldura.png similarity index 100% rename from imagens tematicas/oficios moldura.png rename to oficios/imagens tematicas/oficios moldura.png diff --git a/init.lua b/oficios/init.lua similarity index 82% rename from init.lua rename to oficios/init.lua index 0a80409..5018d4d 100644 --- a/init.lua +++ b/oficios/init.lua @@ -1,6 +1,6 @@ --[[ Mod Oficios para Minetest - Copyright (C) 2017 BrunoMine (https://github.com/BrunoMine) + Copyright (C) 2018 BrunoMine (https://github.com/BrunoMine) Recebeste uma cópia da GNU Lesser General Public License junto com esse software, @@ -17,6 +17,9 @@ oficios.receitas = {} minetest.log('verbose',"[OFICIOS] iniciando carreamento...") +dofile(path.."/tradutor.lua") +minetest.log('verbose',"[OFICIOS] tradutor carregado...") + dofile(path.."/diretrizes.lua") minetest.log('verbose',"[OFICIOS] diretrizes carregadas...") diff --git a/oficios/lib/intllib.lua b/oficios/lib/intllib.lua new file mode 100644 index 0000000..6669d72 --- /dev/null +++ b/oficios/lib/intllib.lua @@ -0,0 +1,45 @@ + +-- Fallback functions for when `intllib` is not installed. +-- Code released under Unlicense . + +-- Get the latest version of this file at: +-- https://raw.githubusercontent.com/minetest-mods/intllib/master/lib/intllib.lua + +local function format(str, ...) + local args = { ... } + local function repl(escape, open, num, close) + if escape == "" then + local replacement = tostring(args[tonumber(num)]) + if open == "" then + replacement = replacement..close + end + return replacement + else + return "@"..open..num..close + end + end + return (str:gsub("(@?)@(%(?)(%d+)(%)?)", repl)) +end + +local gettext, ngettext +if minetest.get_modpath("intllib") then + if intllib.make_gettext_pair then + -- New method using gettext. + gettext, ngettext = intllib.make_gettext_pair() + else + -- Old method using text files. + gettext = intllib.Getter() + end +end + +-- Fill in missing functions. + +gettext = gettext or function(msgid, ...) + return format(msgid, ...) +end + +ngettext = ngettext or function(msgid, msgid_plural, n, ...) + return format(n==1 and msgid or msgid_plural, ...) +end + +return gettext, ngettext diff --git a/oficios/locale/Arquivos para traduzir.txt b/oficios/locale/Arquivos para traduzir.txt new file mode 100644 index 0000000..a5f1fca --- /dev/null +++ b/oficios/locale/Arquivos para traduzir.txt @@ -0,0 +1 @@ +banco_de_dados.lua contador_tempo.lua diretrizes.lua formularios.lua funcoes.lua diff --git a/oficios/locale/en.mo b/oficios/locale/en.mo new file mode 100644 index 0000000..e637584 Binary files /dev/null and b/oficios/locale/en.mo differ diff --git a/oficios/locale/en.po b/oficios/locale/en.po new file mode 100644 index 0000000..66dff22 --- /dev/null +++ b/oficios/locale/en.po @@ -0,0 +1,244 @@ +# SOME DESCRIPTIVE TITLE. +# Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER +# This file is distributed under the same license as the PACKAGE package. +# FIRST AUTHOR , YEAR. +# +msgid "" +msgstr "" +"Project-Id-Version: \n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2018-08-17 21:19-0300\n" +"PO-Revision-Date: 2018-08-17 21:25-0300\n" +"Last-Translator: \n" +"Language-Team: \n" +"Language: en\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" +"X-Generator: Poedit 2.0.6\n" +"Plural-Forms: nplurals=2; plural=(n != 1);\n" + +#: formularios.lua +msgid "Escolha o seu Ofício" +msgstr "Choose your Metier" + +#: formularios.lua funcoes.lua +msgid "Ferreiro" +msgstr "Blacksmith" + +#: formularios.lua funcoes.lua +msgid "Cientista" +msgstr "Scientist" + +#: formularios.lua funcoes.lua +msgid "Cozinheiro" +msgstr "Cook" + +#: formularios.lua funcoes.lua +msgid "Construtor" +msgstr "Builder" + +#: formularios.lua +msgid "Escolher" +msgstr "Choose" + +#: formularios.lua +msgid "" +"O Ferreiro pode montar varios itens compostos de metais. Seu foco maior " +"acaba por ser em itens para combate onde pode causar maior dano." +msgstr "" +"The Blacksmith can craft items made of metals. Its major focus turns out to " +"be in combat items where it can cause more damage." + +#: formularios.lua +msgid "Ser Ferreiro" +msgstr "To be Blacksmith" + +#: formularios.lua funcoes.lua +msgid "Voltar" +msgstr "Return" + +#: formularios.lua +msgid "" +"O Cientista possui uma característica especial de montar itens " +"diversificados. Seu foco costuma estar em utilidades nada convencionais que " +"as vezes pode surpreender." +msgstr "" +"The Scientist has a special feature of craft uncommon items. Its focus is " +"usually on unconventional utilities that can sometimes surprise." + +#: formularios.lua +msgid "Ser Cientista" +msgstr "To be Scientist" + +#: formularios.lua +msgid "" +"O Cozinheiro consegue perceber o que existe de melhor para comer e prepara " +"sempre bons pratos. Seu enfoque se encontra nos comestíveis." +msgstr "" +"The Cook can perceive what is best to eat and always prepares good dishes. " +"Its focus is on edibles." + +#: formularios.lua +msgid "Ser Cozinheiro" +msgstr "To be Cook" + +#: formularios.lua +msgid "" +"O Construtor sempre sabe como erguer uma bela estrutura seja qual for o " +"material ou necessidade. Seu enfoque vai em itens para estruturar." +msgstr "" +"The Builder always knows how to make a beautiful structure whatever the " +"material or need. Your focus goes on items to structure." + +#: formularios.lua +msgid "Ser Construtor" +msgstr "To be Builder" + +#: formularios.lua +msgid "Precisa ter os itens requisitados para iniciar a montagem." +msgstr "You must have the required items to start the craft." + +#: formularios.lua +msgid "Inventário lotado. Esvazie um pouco." +msgstr "Full inventory. Clean a little." + +#: formularios.lua +msgid "Nível muito baixo. Precisa ter um nível maior para montar esse item." +msgstr "Very low level. You need to have a higher level to mount this item." + +#: formularios.lua +msgid "" +"Falta receita em algum ofício. Precisa existir ao menos uma receita para " +"cada ofício." +msgstr "" +"Missing recipes in some metier. There must be at least one recipe for each " +"metier." + +#: funcoes.lua +msgid "(Nível @1) @2" +msgstr "(Level @1) @2" + +#: funcoes.lua +msgid "1 dia" +msgstr "1 day" + +#: funcoes.lua +msgid "@1 dias" +msgstr "@1 days" + +#: funcoes.lua +msgid "1 hora" +msgstr "1 hour" + +#: funcoes.lua +msgid "@1 horas" +msgstr "@1 hours" + +#: funcoes.lua +msgid "1 minuto" +msgstr "1 minute" + +#: funcoes.lua +msgid "@1 minutos" +msgstr "@1 minutes" + +#: funcoes.lua +msgid "@1 e @2" +msgstr "@1 and @2" + +#: funcoes.lua +msgid "@1 Nível @2" +msgstr "@1 Level @2" + +#: funcoes.lua +msgid "Montando" +msgstr "Crafting" + +#: funcoes.lua +msgid "Termina em" +msgstr "Ends in" + +#: funcoes.lua +msgid "Selecione algo para produzir" +msgstr "Select something to produce" + +#: funcoes.lua +msgid "Seu Desempenho" +msgstr "Your Performance" + +#: funcoes.lua +msgid "Atualmente @1 XP" +msgstr "Currently @1 XP" + +#: funcoes.lua +msgid "Próximo Nível @1 XP" +msgstr "Next Level @1 XP" + +#: funcoes.lua +msgid "Total de @1 itens montados" +msgstr "Total of @1 items crafted" + +#: funcoes.lua +msgid "Montado" +msgstr "Crafted" + +#: funcoes.lua +msgid "Coletar" +msgstr "Collect" + +#: funcoes.lua +msgid "Itens requisitados" +msgstr "Required Items" + +#: funcoes.lua +msgid "Tempo estimado" +msgstr "Estimated time" + +#: funcoes.lua +msgid "@1 e 1 hora" +msgstr "@1 and 1 hour" + +#: funcoes.lua +msgid "@1 e @2 horas" +msgstr "@1 and @2 hours" + +#: funcoes.lua +msgid "@1 1 hora" +msgstr "@1 1 hour" + +#: funcoes.lua +msgid "@1 @2 horas" +msgstr "@1 @2 hours" + +#: funcoes.lua +msgid "@1 e 1 minuto" +msgstr "@1 and 1 minute" + +#: funcoes.lua +msgid "@1 e @2 minutos" +msgstr "@1 and @2 minutes" + +#: funcoes.lua +msgid "@1 1 minuto" +msgstr "@1 1 minute" + +#: funcoes.lua +msgid "@1 @2 minutos" +msgstr "@1 @2 minutes" + +#: funcoes.lua +msgid "Montar @1" +msgstr "Craft @1" + +#: funcoes.lua +msgid "Iniciar" +msgstr "Start" + +#: funcoes.lua +msgid "Recebe @1 XP" +msgstr "Receive @1 XP" + +#: funcoes.lua +msgid "Ofício" +msgstr "Metier" diff --git a/oficios/locale/en.po~ b/oficios/locale/en.po~ new file mode 100644 index 0000000..598d220 --- /dev/null +++ b/oficios/locale/en.po~ @@ -0,0 +1,244 @@ +# SOME DESCRIPTIVE TITLE. +# Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER +# This file is distributed under the same license as the PACKAGE package. +# FIRST AUTHOR , YEAR. +# +msgid "" +msgstr "" +"Project-Id-Version: \n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2018-08-17 21:09-0300\n" +"PO-Revision-Date: 2018-08-17 21:19-0300\n" +"Last-Translator: \n" +"Language-Team: \n" +"Language: en\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" +"X-Generator: Poedit 2.0.6\n" +"Plural-Forms: nplurals=2; plural=(n != 1);\n" + +#: formularios.lua +msgid "Escolha o seu Ofício" +msgstr "Choose your Metier" + +#: formularios.lua funcoes.lua +msgid "Ferreiro" +msgstr "Blacksmith" + +#: formularios.lua funcoes.lua +msgid "Cientista" +msgstr "Scientist" + +#: formularios.lua funcoes.lua +msgid "Cozinheiro" +msgstr "Cook" + +#: formularios.lua funcoes.lua +msgid "Construtor" +msgstr "Builder" + +#: formularios.lua +msgid "Escolher" +msgstr "Choose" + +#: formularios.lua +msgid "" +"O Ferreiro pode montar varios itens compostos de metais. Seu foco maior " +"acaba por ser em itens para combate onde pode causar maior dano." +msgstr "" +"The Blacksmith can craft items made of metals. Its major focus turns out to " +"be in combat items where it can cause more damage." + +#: formularios.lua +msgid "Ser Ferreiro" +msgstr "To be Blacksmith" + +#: formularios.lua funcoes.lua +msgid "Voltar" +msgstr "Return" + +#: formularios.lua +msgid "" +"O Cientista possui uma característica especial de montar itens " +"diversificados. Seu foco costuma estar em utilidades nada convencionais que " +"as vezes pode surpreender." +msgstr "" +"The Scientist has a special feature of craft uncommon items. Its focus is " +"usually on unconventional utilities that can sometimes surprise." + +#: formularios.lua +msgid "Ser Cientista" +msgstr "To be Scientist" + +#: formularios.lua +msgid "" +"O Cozinheiro consegue perceber o que existe de melhor para comer e prepara " +"sempre bons pratos. Seu enfoque se encontra nos comestíveis." +msgstr "" +"The Cook can perceive what is best to eat and always prepares good dishes. " +"Its focus is on edibles." + +#: formularios.lua +msgid "Ser Cozinheiro" +msgstr "To be Cook" + +#: formularios.lua +msgid "" +"O Construtor sempre sabe como erguer uma bela estrutura seja qual for o " +"material ou necessidade. Seu enfoque vai em itens para estruturar." +msgstr "" +"The Builder always knows how to make a beautiful structure whatever the " +"material or need. Your focus goes on items to structure." + +#: formularios.lua +msgid "Ser Construtor" +msgstr "To be Builder" + +#: formularios.lua +msgid "Precisa ter os itens requisitados para iniciar a montagem." +msgstr "You must have the required items to start the craft." + +#: formularios.lua +msgid "Inventário lotado. Esvazie um pouco." +msgstr "Full inventory. Clean a little." + +#: formularios.lua +msgid "Nível muito baixo. Precisa ter um nível maior para montar esse item." +msgstr "Very low level. You need to have a higher level to mount this item." + +#: formularios.lua +msgid "" +"Faltam receitas e algum ofícios. Precisa existir ao menos uma receita para " +"cada ofício." +msgstr "" +"Missing recipes in some crafts. There must be at least one recipe for each " +"metier." + +#: funcoes.lua +msgid "(Nível @1) @2" +msgstr "(Level @1) @2" + +#: funcoes.lua +msgid "1 dia" +msgstr "1 day" + +#: funcoes.lua +msgid "@1 dias" +msgstr "@1 days" + +#: funcoes.lua +msgid "1 hora" +msgstr "1 hour" + +#: funcoes.lua +msgid "@1 horas" +msgstr "@1 hours" + +#: funcoes.lua +msgid "1 minuto" +msgstr "1 minute" + +#: funcoes.lua +msgid "@1 minutos" +msgstr "@1 minutes" + +#: funcoes.lua +msgid "@1 e @2" +msgstr "@1 and @2" + +#: funcoes.lua +msgid "@1 Nível @2" +msgstr "@1 Level @2" + +#: funcoes.lua +msgid "Montando" +msgstr "Crafting" + +#: funcoes.lua +msgid "Termina em" +msgstr "Ends in" + +#: funcoes.lua +msgid "Selecione algo para produzir" +msgstr "Select something to produce" + +#: funcoes.lua +msgid "Seu Desempenho" +msgstr "Your Performance" + +#: funcoes.lua +msgid "Atualmente @1 XP" +msgstr "Currently @1 XP" + +#: funcoes.lua +msgid "Próximo Nível @1 XP" +msgstr "Next Level @1 XP" + +#: funcoes.lua +msgid "Total de @1 itens montados" +msgstr "Total of 1 items crafted" + +#: funcoes.lua +msgid "Montado" +msgstr "Crafted" + +#: funcoes.lua +msgid "Coletar" +msgstr "Collect" + +#: funcoes.lua +msgid "Itens requisitados" +msgstr "Required Items" + +#: funcoes.lua +msgid "Tempo estimado" +msgstr "Estimated time" + +#: funcoes.lua +msgid "@1 e 1 hora" +msgstr "@1 and 1 hour" + +#: funcoes.lua +msgid "@1 e @2 horas" +msgstr "@1 and @2 hours" + +#: funcoes.lua +msgid "@1 1 hora" +msgstr "@1 1 hour" + +#: funcoes.lua +msgid "@1 @2 horas" +msgstr "@1 @2 hours" + +#: funcoes.lua +msgid "@1 e 1 minuto" +msgstr "@1 and 1 minute" + +#: funcoes.lua +msgid "@1 e @2 minutos" +msgstr "@1 and @2 minutes" + +#: funcoes.lua +msgid "@1 1 minuto" +msgstr "@1 1 minute" + +#: funcoes.lua +msgid "@1 @2 minutos" +msgstr "@1 @2 minutes" + +#: funcoes.lua +msgid "Montar @1" +msgstr "Craft @1" + +#: funcoes.lua +msgid "Iniciar" +msgstr "Start" + +#: funcoes.lua +msgid "Recebe @1 XP" +msgstr "Receive @1 XP" + +#: funcoes.lua +msgid "Ofício" +msgstr "Metier" diff --git a/oficios/locale/oficios.en.tr b/oficios/locale/oficios.en.tr new file mode 100644 index 0000000..0f41492 --- /dev/null +++ b/oficios/locale/oficios.en.tr @@ -0,0 +1,53 @@ +### Arquivo gerado por oficios apartir de en.po +# textdomain: oficios +@1 @2 minutes=@1 @2 minutes +Currently @1 XP=Currently @1 XP +The Cook can perceive what is best to eat and always prepares good dishes. Its focus is on edibles.=The Cook can perceive what is best to eat and always prepares good dishes. Its focus is on edibles. +1 day=1 day +@1 and 1 hour=@1 and 1 hour +Choose=Choose +Next Level @1 XP=Next Level @1 XP +Crafting=Crafting +Blacksmith=Blacksmith +Missing recipes in some metier. There must be at least one recipe for each metier.=Missing recipes in some metier. There must be at least one recipe for each metier. +To be Cook=To be Cook +Required Items=Required Items +To be Blacksmith=To be Blacksmith +Builder=Builder +Receive @1 XP=Receive @1 XP +@1 and @2=@1 and @2 +@1 @2 hours=@1 @2 hours +Start=Start +@1 and @2 hours=@1 and @2 hours +Very low level. You need to have a higher level to mount this item.=Very low level. You need to have a higher level to mount this item. +Full inventory. Clean a little.=Full inventory. Clean a little. +Select something to produce=Select something to produce +(Level @1) @2=(Level @1) @2 +Metier=Metier +@1 minutes=@1 minutes +@1 1 hour=@1 1 hour +Craft @1=Craft @1 +1 hour=1 hour +Choose your Metier=Choose your Metier +@1 Level @2=@1 Level @2 +To be Scientist=To be Scientist +@1 hours=@1 hours +Your Performance=Your Performance +Crafted=Crafted +@1 and @2 minutes=@1 and @2 minutes +@1 1 minute=@1 1 minute +Ends in=Ends in +Estimated time=Estimated time +Return=Return +Cook=Cook +Total of @1 items crafted=Total of @1 items crafted +Collect=Collect +You must have the required items to start the craft.=You must have the required items to start the craft. +@1 days=@1 days +The Scientist has a special feature of craft uncommon items. Its focus is usually on unconventional utilities that can sometimes surprise.=The Scientist has a special feature of craft uncommon items. Its focus is usually on unconventional utilities that can sometimes surprise. +1 minute=1 minute +@1 and 1 minute=@1 and 1 minute +The Blacksmith can craft items made of metals. Its major focus turns out to be in combat items where it can cause more damage.=The Blacksmith can craft items made of metals. Its major focus turns out to be in combat items where it can cause more damage. +To be Builder=To be Builder +The Builder always knows how to make a beautiful structure whatever the material or need. Your focus goes on items to structure.=The Builder always knows how to make a beautiful structure whatever the material or need. Your focus goes on items to structure. +Scientist=Scientist diff --git a/oficios/locale/oficios.pt.tr b/oficios/locale/oficios.pt.tr new file mode 100644 index 0000000..1c30f55 --- /dev/null +++ b/oficios/locale/oficios.pt.tr @@ -0,0 +1,53 @@ +### Arquivo gerado por oficios apartir de pt.po +# textdomain: oficios +@1 @2 minutes=@1 @2 minutos +Currently @1 XP=Atualmente @1 XP +The Cook can perceive what is best to eat and always prepares good dishes. Its focus is on edibles.=O Cozinheiro consegue perceber o que existe de melhor para comer e prepara sempre bons pratos. Seu enfoque se encontra nos comestíveis. +1 day=1 dia +@1 and 1 hour=@1 e 1 hora +Choose=Escolher +Next Level @1 XP=Próximo Nível @1 XP +Crafting=Montando +Blacksmith=Ferreiro +Missing recipes in some metier. There must be at least one recipe for each metier.=Falta receita em algum ofício. Precisa existir ao menos uma receita para cada ofício. +To be Cook=Ser Cozinheiro +Required Items=Itens requisitados +To be Blacksmith=Ser Ferreiro +Builder=Construtor +Receive @1 XP=Recebe @1 XP +@1 and @2=@1 e @2 +@1 @2 hours=@1 @2 horas +Start=Iniciar +@1 and @2 hours=@1 e @2 horas +Very low level. You need to have a higher level to mount this item.=Nível muito baixo. Precisa ter um nível maior para montar esse item. +Full inventory. Clean a little.=Inventário lotado. Esvazie um pouco. +Select something to produce=Selecione algo para produzir +(Level @1) @2=(Nível @1) @2 +Metier=Ofício +@1 minutes=@1 minutos +@1 1 hour=@1 1 hora +Craft @1=Montar @1 +1 hour=1 hora +Choose your Metier=Escolha o seu Ofício +@1 Level @2=@1 Nível @2 +To be Scientist=Ser Cientista +@1 hours=@1 horas +Your Performance=Seu Desempenho +Crafted=Montado +@1 and @2 minutes=@1 e @2 minutos +@1 1 minute=@1 1 minuto +Ends in=Termina em +Estimated time=Tempo estimado +Return=Voltar +Cook=Cozinheiro +Total of @1 items crafted=Total de @1 itens montados +Collect=Coletar +You must have the required items to start the craft.=Precisa ter os itens requisitados para iniciar a montagem. +@1 days=@1 dias +The Scientist has a special feature of craft uncommon items. Its focus is usually on unconventional utilities that can sometimes surprise.=O Cientista possui uma característica especial de montar itens diversificados. Seu foco costuma estar em utilidades nada convencionais que as vezes pode surpreender. +1 minute=1 minuto +@1 and 1 minute=@1 e 1 minuto +The Blacksmith can craft items made of metals. Its major focus turns out to be in combat items where it can cause more damage.=O Ferreiro pode montar varios itens compostos de metais. Seu foco maior acaba por ser em itens para combate onde pode causar maior dano. +To be Builder=Ser Construtor +The Builder always knows how to make a beautiful structure whatever the material or need. Your focus goes on items to structure.=O Construtor sempre sabe como erguer uma bela estrutura seja qual for o material ou necessidade. Seu enfoque vai em itens para estruturar. +Scientist=Cientista diff --git a/oficios/locale/pt.mo b/oficios/locale/pt.mo new file mode 100644 index 0000000..e762b5f Binary files /dev/null and b/oficios/locale/pt.mo differ diff --git a/oficios/locale/pt.po b/oficios/locale/pt.po new file mode 100644 index 0000000..00bfcf5 --- /dev/null +++ b/oficios/locale/pt.po @@ -0,0 +1,264 @@ +# SOME DESCRIPTIVE TITLE. +# Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER +# This file is distributed under the same license as the PACKAGE package. +# FIRST AUTHOR , YEAR. +# +msgid "" +msgstr "" +"Project-Id-Version: \n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2018-08-17 21:19-0300\n" +"PO-Revision-Date: 2018-08-17 21:21-0300\n" +"Last-Translator: \n" +"Language-Team: \n" +"Language: pt\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" +"X-Generator: Poedit 2.0.6\n" +"Plural-Forms: nplurals=2; plural=(n != 1);\n" + +#: formularios.lua +msgid "Escolha o seu Ofício" +msgstr "Escolha o seu Ofício" + +#: formularios.lua funcoes.lua +msgid "Ferreiro" +msgstr "Ferreiro" + +#: formularios.lua funcoes.lua +msgid "Cientista" +msgstr "Cientista" + +#: formularios.lua funcoes.lua +msgid "Cozinheiro" +msgstr "Cozinheiro" + +#: formularios.lua funcoes.lua +msgid "Construtor" +msgstr "Construtor" + +#: formularios.lua +msgid "Escolher" +msgstr "Escolher" + +#: formularios.lua +msgid "" +"O Ferreiro pode montar varios itens compostos de metais. Seu foco maior " +"acaba por ser em itens para combate onde pode causar maior dano." +msgstr "" +"O Ferreiro pode montar varios itens compostos de metais. Seu foco maior " +"acaba por ser em itens para combate onde pode causar maior dano." + +#: formularios.lua +msgid "Ser Ferreiro" +msgstr "Ser Ferreiro" + +#: formularios.lua funcoes.lua +msgid "Voltar" +msgstr "Voltar" + +#: formularios.lua +msgid "" +"O Cientista possui uma característica especial de montar itens " +"diversificados. Seu foco costuma estar em utilidades nada convencionais que " +"as vezes pode surpreender." +msgstr "" +"O Cientista possui uma característica especial de montar itens " +"diversificados. Seu foco costuma estar em utilidades nada convencionais que " +"as vezes pode surpreender." + +#: formularios.lua +msgid "Ser Cientista" +msgstr "Ser Cientista" + +#: formularios.lua +msgid "" +"O Cozinheiro consegue perceber o que existe de melhor para comer e prepara " +"sempre bons pratos. Seu enfoque se encontra nos comestíveis." +msgstr "" +"O Cozinheiro consegue perceber o que existe de melhor para comer e prepara " +"sempre bons pratos. Seu enfoque se encontra nos comestíveis." + +#: formularios.lua +msgid "Ser Cozinheiro" +msgstr "Ser Cozinheiro" + +#: formularios.lua +msgid "" +"O Construtor sempre sabe como erguer uma bela estrutura seja qual for o " +"material ou necessidade. Seu enfoque vai em itens para estruturar." +msgstr "" +"O Construtor sempre sabe como erguer uma bela estrutura seja qual for o " +"material ou necessidade. Seu enfoque vai em itens para estruturar." + +#: formularios.lua +msgid "Ser Construtor" +msgstr "Ser Construtor" + +#: formularios.lua +msgid "Precisa ter os itens requisitados para iniciar a montagem." +msgstr "Precisa ter os itens requisitados para iniciar a montagem." + +#: formularios.lua +msgid "Inventário lotado. Esvazie um pouco." +msgstr "Inventário lotado. Esvazie um pouco." + +#: formularios.lua +msgid "Nível muito baixo. Precisa ter um nível maior para montar esse item." +msgstr "Nível muito baixo. Precisa ter um nível maior para montar esse item." + +#: formularios.lua +msgid "" +"Falta receita em algum ofício. Precisa existir ao menos uma receita para " +"cada ofício." +msgstr "" +"Falta receita em algum ofício. Precisa existir ao menos uma receita para " +"cada ofício." + +#: funcoes.lua +msgid "(Nível @1) @2" +msgstr "(Nível @1) @2" + +#: funcoes.lua +msgid "1 dia" +msgstr "1 dia" + +#: funcoes.lua +msgid "@1 dias" +msgstr "@1 dias" + +#: funcoes.lua +msgid "1 hora" +msgstr "1 hora" + +#: funcoes.lua +msgid "@1 horas" +msgstr "@1 horas" + +#: funcoes.lua +msgid "1 minuto" +msgstr "1 minuto" + +#: funcoes.lua +msgid "@1 minutos" +msgstr "@1 minutos" + +#: funcoes.lua +msgid "@1 e @2" +msgstr "@1 e @2" + +#: funcoes.lua +msgid "@1 Nível @2" +msgstr "@1 Nível @2" + +#: funcoes.lua +msgid "Montando" +msgstr "Montando" + +#: funcoes.lua +msgid "Termina em" +msgstr "Termina em" + +#: funcoes.lua +msgid "Selecione algo para produzir" +msgstr "Selecione algo para produzir" + +#: funcoes.lua +msgid "Seu Desempenho" +msgstr "Seu Desempenho" + +#: funcoes.lua +msgid "Atualmente @1 XP" +msgstr "Atualmente @1 XP" + +#: funcoes.lua +msgid "Próximo Nível @1 XP" +msgstr "Próximo Nível @1 XP" + +#: funcoes.lua +msgid "Total de @1 itens montados" +msgstr "Total de @1 itens montados" + +#: funcoes.lua +msgid "Montado" +msgstr "Montado" + +#: funcoes.lua +msgid "Coletar" +msgstr "Coletar" + +#: funcoes.lua +msgid "Itens requisitados" +msgstr "Itens requisitados" + +#: funcoes.lua +msgid "Tempo estimado" +msgstr "Tempo estimado" + +#: funcoes.lua +msgid "@1 e 1 hora" +msgstr "@1 e 1 hora" + +#: funcoes.lua +msgid "@1 e @2 horas" +msgstr "@1 e @2 horas" + +#: funcoes.lua +msgid "@1 1 hora" +msgstr "@1 1 hora" + +#: funcoes.lua +msgid "@1 @2 horas" +msgstr "@1 @2 horas" + +#: funcoes.lua +msgid "@1 e 1 minuto" +msgstr "@1 e 1 minuto" + +#: funcoes.lua +msgid "@1 e @2 minutos" +msgstr "@1 e @2 minutos" + +#: funcoes.lua +msgid "@1 1 minuto" +msgstr "@1 1 minuto" + +#: funcoes.lua +msgid "@1 @2 minutos" +msgstr "@1 @2 minutos" + +#: funcoes.lua +msgid "Montar @1" +msgstr "Montar @1" + +#: funcoes.lua +msgid "Iniciar" +msgstr "Iniciar" + +#: funcoes.lua +msgid "Recebe @1 XP" +msgstr "Recebe @1 XP" + +#: funcoes.lua +msgid "Ofício" +msgstr "Ofício" + +#, fuzzy +#~ msgid "Ferreira" +#~ msgstr "Ferreiro" + +#~ msgid "FERREIRO" +#~ msgstr "FERREIRO" + +#~ msgid "CIENTISTA" +#~ msgstr "CIENTISTA" + +#~ msgid "COZINHEIRO" +#~ msgstr "COZINHEIRO" + +#~ msgid "CONSTRUTOR" +#~ msgstr "CONSTRUTOR" + +#~ msgid "Nível @1" +#~ msgstr "Nível @1" diff --git a/oficios/locale/pt.po~ b/oficios/locale/pt.po~ new file mode 100644 index 0000000..ce7d532 --- /dev/null +++ b/oficios/locale/pt.po~ @@ -0,0 +1,264 @@ +# SOME DESCRIPTIVE TITLE. +# Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER +# This file is distributed under the same license as the PACKAGE package. +# FIRST AUTHOR , YEAR. +# +msgid "" +msgstr "" +"Project-Id-Version: \n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2018-08-17 21:09-0300\n" +"PO-Revision-Date: 2018-08-17 21:10-0300\n" +"Last-Translator: \n" +"Language-Team: \n" +"Language: pt\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" +"X-Generator: Poedit 2.0.6\n" +"Plural-Forms: nplurals=2; plural=(n != 1);\n" + +#: formularios.lua +msgid "Escolha o seu Ofício" +msgstr "Escolha o seu Ofício" + +#: formularios.lua funcoes.lua +msgid "Ferreiro" +msgstr "Ferreiro" + +#: formularios.lua funcoes.lua +msgid "Cientista" +msgstr "Cientista" + +#: formularios.lua funcoes.lua +msgid "Cozinheiro" +msgstr "Cozinheiro" + +#: formularios.lua funcoes.lua +msgid "Construtor" +msgstr "Construtor" + +#: formularios.lua +msgid "Escolher" +msgstr "Escolher" + +#: formularios.lua +msgid "" +"O Ferreiro pode montar varios itens compostos de metais. Seu foco maior " +"acaba por ser em itens para combate onde pode causar maior dano." +msgstr "" +"O Ferreiro pode montar varios itens compostos de metais. Seu foco maior " +"acaba por ser em itens para combate onde pode causar maior dano." + +#: formularios.lua +msgid "Ser Ferreiro" +msgstr "Ser Ferreiro" + +#: formularios.lua funcoes.lua +msgid "Voltar" +msgstr "Voltar" + +#: formularios.lua +msgid "" +"O Cientista possui uma característica especial de montar itens " +"diversificados. Seu foco costuma estar em utilidades nada convencionais que " +"as vezes pode surpreender." +msgstr "" +"O Cientista possui uma característica especial de montar itens " +"diversificados. Seu foco costuma estar em utilidades nada convencionais que " +"as vezes pode surpreender." + +#: formularios.lua +msgid "Ser Cientista" +msgstr "Ser Cientista" + +#: formularios.lua +msgid "" +"O Cozinheiro consegue perceber o que existe de melhor para comer e prepara " +"sempre bons pratos. Seu enfoque se encontra nos comestíveis." +msgstr "" +"O Cozinheiro consegue perceber o que existe de melhor para comer e prepara " +"sempre bons pratos. Seu enfoque se encontra nos comestíveis." + +#: formularios.lua +msgid "Ser Cozinheiro" +msgstr "Ser Cozinheiro" + +#: formularios.lua +msgid "" +"O Construtor sempre sabe como erguer uma bela estrutura seja qual for o " +"material ou necessidade. Seu enfoque vai em itens para estruturar." +msgstr "" +"O Construtor sempre sabe como erguer uma bela estrutura seja qual for o " +"material ou necessidade. Seu enfoque vai em itens para estruturar." + +#: formularios.lua +msgid "Ser Construtor" +msgstr "Ser Construtor" + +#: formularios.lua +msgid "Precisa ter os itens requisitados para iniciar a montagem." +msgstr "Precisa ter os itens requisitados para iniciar a montagem." + +#: formularios.lua +msgid "Inventário lotado. Esvazie um pouco." +msgstr "Inventário lotado. Esvazie um pouco." + +#: formularios.lua +msgid "Nível muito baixo. Precisa ter um nível maior para montar esse item." +msgstr "Nível muito baixo. Precisa ter um nível maior para montar esse item." + +#: formularios.lua +msgid "" +"Faltam receitas e algum ofícios. Precisa existir ao menos uma receita para " +"cada ofício." +msgstr "" +"Faltam receitas e algum ofícios. Precisa existir ao menos uma receita para " +"cada ofício." + +#: funcoes.lua +msgid "(Nível @1) @2" +msgstr "(Nível @1) @2" + +#: funcoes.lua +msgid "1 dia" +msgstr "1 dia" + +#: funcoes.lua +msgid "@1 dias" +msgstr "@1 dias" + +#: funcoes.lua +msgid "1 hora" +msgstr "1 hora" + +#: funcoes.lua +msgid "@1 horas" +msgstr "@1 horas" + +#: funcoes.lua +msgid "1 minuto" +msgstr "1 minuto" + +#: funcoes.lua +msgid "@1 minutos" +msgstr "@1 minutos" + +#: funcoes.lua +msgid "@1 e @2" +msgstr "@1 e @2" + +#: funcoes.lua +msgid "@1 Nível @2" +msgstr "@1 Nível @2" + +#: funcoes.lua +msgid "Montando" +msgstr "Montando" + +#: funcoes.lua +msgid "Termina em" +msgstr "Termina em" + +#: funcoes.lua +msgid "Selecione algo para produzir" +msgstr "Selecione algo para produzir" + +#: funcoes.lua +msgid "Seu Desempenho" +msgstr "Seu Desempenho" + +#: funcoes.lua +msgid "Atualmente @1 XP" +msgstr "Atualmente @1 XP" + +#: funcoes.lua +msgid "Próximo Nível @1 XP" +msgstr "Próximo Nível @1 XP" + +#: funcoes.lua +msgid "Total de @1 itens montados" +msgstr "Total de @1 itens montados" + +#: funcoes.lua +msgid "Montado" +msgstr "Montado" + +#: funcoes.lua +msgid "Coletar" +msgstr "Coletar" + +#: funcoes.lua +msgid "Itens requisitados" +msgstr "Itens requisitados" + +#: funcoes.lua +msgid "Tempo estimado" +msgstr "Tempo estimado" + +#: funcoes.lua +msgid "@1 e 1 hora" +msgstr "@1 e 1 hora" + +#: funcoes.lua +msgid "@1 e @2 horas" +msgstr "@1 e @2 horas" + +#: funcoes.lua +msgid "@1 1 hora" +msgstr "@1 1 hora" + +#: funcoes.lua +msgid "@1 @2 horas" +msgstr "@1 @2 horas" + +#: funcoes.lua +msgid "@1 e 1 minuto" +msgstr "@1 e 1 minuto" + +#: funcoes.lua +msgid "@1 e @2 minutos" +msgstr "@1 e @2 minutos" + +#: funcoes.lua +msgid "@1 1 minuto" +msgstr "@1 1 minuto" + +#: funcoes.lua +msgid "@1 @2 minutos" +msgstr "@1 @2 minutos" + +#: funcoes.lua +msgid "Montar @1" +msgstr "Montar @1" + +#: funcoes.lua +msgid "Iniciar" +msgstr "Iniciar" + +#: funcoes.lua +msgid "Recebe @1 XP" +msgstr "Recebe @1 XP" + +#: funcoes.lua +msgid "Ofício" +msgstr "Ofício" + +#, fuzzy +#~ msgid "Ferreira" +#~ msgstr "Ferreiro" + +#~ msgid "FERREIRO" +#~ msgstr "FERREIRO" + +#~ msgid "CIENTISTA" +#~ msgstr "CIENTISTA" + +#~ msgid "COZINHEIRO" +#~ msgstr "COZINHEIRO" + +#~ msgid "CONSTRUTOR" +#~ msgstr "CONSTRUTOR" + +#~ msgid "Nível @1" +#~ msgstr "Nível @1" diff --git a/oficios/locale/template.pot b/oficios/locale/template.pot new file mode 100644 index 0000000..3b35046 --- /dev/null +++ b/oficios/locale/template.pot @@ -0,0 +1,233 @@ +# SOME DESCRIPTIVE TITLE. +# Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER +# This file is distributed under the same license as the PACKAGE package. +# FIRST AUTHOR , YEAR. +# +#, fuzzy +msgid "" +msgstr "" +"Project-Id-Version: PACKAGE VERSION\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2018-08-17 21:20-0300\n" +"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" +"Last-Translator: FULL NAME \n" +"Language-Team: LANGUAGE \n" +"Language: \n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" + +#: formularios.lua +msgid "Escolha o seu Ofício" +msgstr "" + +#: formularios.lua funcoes.lua +msgid "Ferreiro" +msgstr "" + +#: formularios.lua funcoes.lua +msgid "Cientista" +msgstr "" + +#: formularios.lua funcoes.lua +msgid "Cozinheiro" +msgstr "" + +#: formularios.lua funcoes.lua +msgid "Construtor" +msgstr "" + +#: formularios.lua +msgid "Escolher" +msgstr "" + +#: formularios.lua +msgid "" +"O Ferreiro pode montar varios itens compostos de metais. Seu foco maior " +"acaba por ser em itens para combate onde pode causar maior dano." +msgstr "" + +#: formularios.lua +msgid "Ser Ferreiro" +msgstr "" + +#: formularios.lua funcoes.lua +msgid "Voltar" +msgstr "" + +#: formularios.lua +msgid "" +"O Cientista possui uma característica especial de montar itens " +"diversificados. Seu foco costuma estar em utilidades nada convencionais que " +"as vezes pode surpreender." +msgstr "" + +#: formularios.lua +msgid "Ser Cientista" +msgstr "" + +#: formularios.lua +msgid "" +"O Cozinheiro consegue perceber o que existe de melhor para comer e prepara " +"sempre bons pratos. Seu enfoque se encontra nos comestíveis." +msgstr "" + +#: formularios.lua +msgid "Ser Cozinheiro" +msgstr "" + +#: formularios.lua +msgid "" +"O Construtor sempre sabe como erguer uma bela estrutura seja qual for o " +"material ou necessidade. Seu enfoque vai em itens para estruturar." +msgstr "" + +#: formularios.lua +msgid "Ser Construtor" +msgstr "" + +#: formularios.lua +msgid "Precisa ter os itens requisitados para iniciar a montagem." +msgstr "" + +#: formularios.lua +msgid "Inventário lotado. Esvazie um pouco." +msgstr "" + +#: formularios.lua +msgid "Nível muito baixo. Precisa ter um nível maior para montar esse item." +msgstr "" + +#: formularios.lua +msgid "" +"Falta receita em algum ofício. Precisa existir ao menos uma receita para " +"cada ofício." +msgstr "" + +#: funcoes.lua +msgid "(Nível @1) @2" +msgstr "" + +#: funcoes.lua +msgid "1 dia" +msgstr "" + +#: funcoes.lua +msgid "@1 dias" +msgstr "" + +#: funcoes.lua +msgid "1 hora" +msgstr "" + +#: funcoes.lua +msgid "@1 horas" +msgstr "" + +#: funcoes.lua +msgid "1 minuto" +msgstr "" + +#: funcoes.lua +msgid "@1 minutos" +msgstr "" + +#: funcoes.lua +msgid "@1 e @2" +msgstr "" + +#: funcoes.lua +msgid "@1 Nível @2" +msgstr "" + +#: funcoes.lua +msgid "Montando" +msgstr "" + +#: funcoes.lua +msgid "Termina em" +msgstr "" + +#: funcoes.lua +msgid "Selecione algo para produzir" +msgstr "" + +#: funcoes.lua +msgid "Seu Desempenho" +msgstr "" + +#: funcoes.lua +msgid "Atualmente @1 XP" +msgstr "" + +#: funcoes.lua +msgid "Próximo Nível @1 XP" +msgstr "" + +#: funcoes.lua +msgid "Total de @1 itens montados" +msgstr "" + +#: funcoes.lua +msgid "Montado" +msgstr "" + +#: funcoes.lua +msgid "Coletar" +msgstr "" + +#: funcoes.lua +msgid "Itens requisitados" +msgstr "" + +#: funcoes.lua +msgid "Tempo estimado" +msgstr "" + +#: funcoes.lua +msgid "@1 e 1 hora" +msgstr "" + +#: funcoes.lua +msgid "@1 e @2 horas" +msgstr "" + +#: funcoes.lua +msgid "@1 1 hora" +msgstr "" + +#: funcoes.lua +msgid "@1 @2 horas" +msgstr "" + +#: funcoes.lua +msgid "@1 e 1 minuto" +msgstr "" + +#: funcoes.lua +msgid "@1 e @2 minutos" +msgstr "" + +#: funcoes.lua +msgid "@1 1 minuto" +msgstr "" + +#: funcoes.lua +msgid "@1 @2 minutos" +msgstr "" + +#: funcoes.lua +msgid "Montar @1" +msgstr "" + +#: funcoes.lua +msgid "Iniciar" +msgstr "" + +#: funcoes.lua +msgid "Recebe @1 XP" +msgstr "" + +#: funcoes.lua +msgid "Ofício" +msgstr "" diff --git a/textures/oficios_botao.png b/oficios/textures/oficios_botao.png similarity index 100% rename from textures/oficios_botao.png rename to oficios/textures/oficios_botao.png diff --git a/textures/oficios_botao_atualizar.png b/oficios/textures/oficios_botao_atualizar.png similarity index 100% rename from textures/oficios_botao_atualizar.png rename to oficios/textures/oficios_botao_atualizar.png diff --git a/textures/oficios_botao_desc.png b/oficios/textures/oficios_botao_desc.png similarity index 100% rename from textures/oficios_botao_desc.png rename to oficios/textures/oficios_botao_desc.png diff --git a/textures/oficios_cientista.png b/oficios/textures/oficios_cientista.png similarity index 100% rename from textures/oficios_cientista.png rename to oficios/textures/oficios_cientista.png diff --git a/textures/oficios_construtor.png b/oficios/textures/oficios_construtor.png similarity index 100% rename from textures/oficios_construtor.png rename to oficios/textures/oficios_construtor.png diff --git a/textures/oficios_cozinheiro.png b/oficios/textures/oficios_cozinheiro.png similarity index 100% rename from textures/oficios_cozinheiro.png rename to oficios/textures/oficios_cozinheiro.png diff --git a/textures/oficios_ferreiro.png b/oficios/textures/oficios_ferreiro.png similarity index 100% rename from textures/oficios_ferreiro.png rename to oficios/textures/oficios_ferreiro.png diff --git a/oficios/tools/xgettext.bat b/oficios/tools/xgettext.bat new file mode 100644 index 0000000..18403db --- /dev/null +++ b/oficios/tools/xgettext.bat @@ -0,0 +1,33 @@ +@echo off +setlocal + +set me=%~n0 + +rem # Uncomment the following line if gettext is not in your PATH. +rem # Value must be absolute and end in a backslash. +rem set gtprefix=C:\path\to\gettext\bin\ + +if "%1" == "" ( + echo Usage: %me% FILE... 1>&2 + exit 1 +) + +set xgettext=%gtprefix%xgettext.exe +set msgmerge=%gtprefix%msgmerge.exe + +md locale > nul 2>&1 +echo Generating template... 1>&2 +echo %xgettext% --from-code=UTF-8 -kS -kNS:1,2 -k_ -o locale/template.pot %* +%xgettext% --from-code=UTF-8 -kS -kNS:1,2 -k_ -o locale/template.pot %* +if %ERRORLEVEL% neq 0 goto done + +cd locale + +for %%f in (*.po) do ( + echo Updating %%f... 1>&2 + %msgmerge% --update %%f template.pot +) + +echo DONE! 1>&2 + +:done diff --git a/oficios/tools/xgettext.sh b/oficios/tools/xgettext.sh new file mode 100755 index 0000000..1504f42 --- /dev/null +++ b/oficios/tools/xgettext.sh @@ -0,0 +1,27 @@ +#! /bin/bash + +me=$(basename "${BASH_SOURCE[0]}"); + +if [[ $# -lt 1 ]]; then + echo "Usage: $me FILE..." >&2; + exit 1; +fi + +mkdir -p locale; +echo "Generating template..." >&2; +xgettext --from-code=UTF-8 \ + --keyword=S \ + --keyword=NS:1,2 \ + --keyword=N_ \ + --add-comments='Translators:' \ + --add-location=file \ + -o locale/template.pot \ + "$@" \ + || exit; + +find locale -name '*.po' -type f | while read -r file; do + echo "Updating $file..." >&2; + msgmerge --update "$file" locale/template.pot; +done + +echo "DONE!" >&2; diff --git a/oficios/tradutor.lua b/oficios/tradutor.lua new file mode 100644 index 0000000..9f7ed42 --- /dev/null +++ b/oficios/tradutor.lua @@ -0,0 +1,177 @@ +--[[ + Mod oficios para Minetest + Copyright (C) 2018 BrunoMine (https://github.com/BrunoMine) + + Recebeste uma cópia da GNU Lesser General + Public License junto com esse software, + se não, veja em . + + Sistema de tradução + ]] + +-- Modpath +local modpath = minetest.get_modpath("oficios") + +-- Tradução intllib +oficios.intllib = {} +oficios.intllib.S, oficios.intllib.NS = dofile(modpath.."/lib/intllib.lua") + +-- Configura tradutor opicional +oficios.S = oficios.intllib.S +oficios.NS = oficios.intllib.NS + +-- +-- Ajustes devido ao bug de tradutor ler apenas traduzir do ingles +-- + +-- Strings para repassar textos em ingles +local pt_to_en = {} + +-- Gera arquivos de tradução oficios.*.tr +do + local file_to_tb = function(file) + local msgid = nil + local msgstr = nil + local tb = {} + for line in io.lines(file) do + + -- Iniciando 'msgid' + if string.sub(line, 1, 5) == "msgid" then + + -- Escrever no catalogo a anterior + if msgid ~= nil and msgstr ~= nil then + if msgid ~= "" then + tb[msgid] = msgstr + end + msgid = nil + msgstr = nil + end + + if line == "msgid \"\"" then + msgid = "" + else + msgid = string.sub(line, 8, (string.len(line)-1)) + end + + -- Continuando 'msgid' + elseif string.sub(line, 1, 1) == "\"" and msgstr == nil and msgid ~= nil then + msgid = msgid .. string.sub(line, 2, (string.len(line)-1)) + + -- Iniciando 'msgstr' + elseif string.sub(line, 1, 6) == "msgstr" then + + if line == "msgstr \"\"" then + msgstr = "" + else + msgstr = string.sub(line, 9, (string.len(line)-1)) + end + + -- Continuando 'msgstr' + elseif string.sub(line, 1, 1) == "\"" and msgstr ~= nil then + msgstr = msgstr .. string.sub(line, 2, (string.len(line)-1)) + + end + + + end + + -- Escrever ultima + if msgid ~= nil and msgstr ~= nil then + if msgid ~= "" then + tb[msgid] = msgstr + end + msgid = nil + msgstr = nil + end + + return tb + end + + -- Pegar strings principais en-pt para realizar as trocas + pt_to_en = file_to_tb(modpath.."/locale/en.po") + + --minetest.log("error", "pt_to_en = "..dump(pt_to_en)) + + local list = minetest.get_dir_list(modpath.."/locale") + for _,file in ipairs(list) do + + if string.match(file, "~") == nil then + + -- Traduções ".po" + if string.match(file, ".pot") == nil and string.match(file, ".po") then + + local lang_code = string.gsub(file, ".po", "") + + local pt_to_lang = file_to_tb(modpath.."/locale/"..file) + + -- tabela desejada + local en_to_lang = {} + for pt,en in pairs(pt_to_en) do + en_to_lang[en] = pt_to_lang[pt] + end + + -- Novo arquivo + local new_file = "### Arquivo gerado por oficios apartir de "..file.."\n# textdomain: oficios\n" + for en,lang in pairs(en_to_lang) do + new_file = new_file .. en .. "=" .. lang .. "\n" + end + -- Escrever arquivo + local saida = io.open(modpath.."/locale/oficios."..lang_code..".tr", "w") + saida:write(new_file) + io.close(saida) + end + end + end +end + +-- Ajuste para repassar termos em ingles +local s +if minetest.get_translator ~= nil then + s = minetest.get_translator("oficios") +else + s = oficios.intllib.S +end + +oficios.s = function(...) + local args = { ... } + if pt_to_en[args[1]] ~= nil then + return s(pt_to_en[args[1]], unpack(args, 2)) + end + minetest.log("error", "[oficios] String "..dump(args[1]).." nao catalogada") + return s(...) +end + +-- Não troca string caso esteja trabalhando com intllib +if minetest.get_modpath("intllib") ~= nil + and minetest.get_translator == nil +then + oficios.s = s +end + +oficios.S = function(...) + local args = { ... } + if type(args[1]) == "table" then + local r = {} + for n,a in ipairs(args[1]) do + if n ~= 1 then -- Não traduz o primeiro + table.insert(r, oficios.S(a)) + else + table.insert(r, a) + end + end + + return oficios.s(unpack(r)) + + elseif type(args[1]) == "string" then + -- Não traduz caso faltem argumentos (devido strings ilustrativas) + return oficios.s(...) + + else + return args[1] + end +end + +-- Função que retorna a string inalterada para passar pela checagem +oficios.Sfake = function(s) return s end + + diff --git a/oficios_basicos/LICENSE b/oficios_basicos/LICENSE new file mode 100644 index 0000000..65c5ca8 --- /dev/null +++ b/oficios_basicos/LICENSE @@ -0,0 +1,165 @@ + GNU LESSER GENERAL PUBLIC LICENSE + Version 3, 29 June 2007 + + Copyright (C) 2007 Free Software Foundation, Inc. + Everyone is permitted to copy and distribute verbatim copies + of this license document, but changing it is not allowed. + + + This version of the GNU Lesser General Public License incorporates +the terms and conditions of version 3 of the GNU General Public +License, supplemented by the additional permissions listed below. + + 0. Additional Definitions. + + As used herein, "this License" refers to version 3 of the GNU Lesser +General Public License, and the "GNU GPL" refers to version 3 of the GNU +General Public License. + + "The Library" refers to a covered work governed by this License, +other than an Application or a Combined Work as defined below. + + An "Application" is any work that makes use of an interface provided +by the Library, but which is not otherwise based on the Library. +Defining a subclass of a class defined by the Library is deemed a mode +of using an interface provided by the Library. + + A "Combined Work" is a work produced by combining or linking an +Application with the Library. The particular version of the Library +with which the Combined Work was made is also called the "Linked +Version". + + The "Minimal Corresponding Source" for a Combined Work means the +Corresponding Source for the Combined Work, excluding any source code +for portions of the Combined Work that, considered in isolation, are +based on the Application, and not on the Linked Version. + + The "Corresponding Application Code" for a Combined Work means the +object code and/or source code for the Application, including any data +and utility programs needed for reproducing the Combined Work from the +Application, but excluding the System Libraries of the Combined Work. + + 1. Exception to Section 3 of the GNU GPL. + + You may convey a covered work under sections 3 and 4 of this License +without being bound by section 3 of the GNU GPL. + + 2. Conveying Modified Versions. + + If you modify a copy of the Library, and, in your modifications, a +facility refers to a function or data to be supplied by an Application +that uses the facility (other than as an argument passed when the +facility is invoked), then you may convey a copy of the modified +version: + + a) under this License, provided that you make a good faith effort to + ensure that, in the event an Application does not supply the + function or data, the facility still operates, and performs + whatever part of its purpose remains meaningful, or + + b) under the GNU GPL, with none of the additional permissions of + this License applicable to that copy. + + 3. Object Code Incorporating Material from Library Header Files. + + The object code form of an Application may incorporate material from +a header file that is part of the Library. You may convey such object +code under terms of your choice, provided that, if the incorporated +material is not limited to numerical parameters, data structure +layouts and accessors, or small macros, inline functions and templates +(ten or fewer lines in length), you do both of the following: + + a) Give prominent notice with each copy of the object code that the + Library is used in it and that the Library and its use are + covered by this License. + + b) Accompany the object code with a copy of the GNU GPL and this license + document. + + 4. Combined Works. + + You may convey a Combined Work under terms of your choice that, +taken together, effectively do not restrict modification of the +portions of the Library contained in the Combined Work and reverse +engineering for debugging such modifications, if you also do each of +the following: + + a) Give prominent notice with each copy of the Combined Work that + the Library is used in it and that the Library and its use are + covered by this License. + + b) Accompany the Combined Work with a copy of the GNU GPL and this license + document. + + c) For a Combined Work that displays copyright notices during + execution, include the copyright notice for the Library among + these notices, as well as a reference directing the user to the + copies of the GNU GPL and this license document. + + d) Do one of the following: + + 0) Convey the Minimal Corresponding Source under the terms of this + License, and the Corresponding Application Code in a form + suitable for, and under terms that permit, the user to + recombine or relink the Application with a modified version of + the Linked Version to produce a modified Combined Work, in the + manner specified by section 6 of the GNU GPL for conveying + Corresponding Source. + + 1) Use a suitable shared library mechanism for linking with the + Library. A suitable mechanism is one that (a) uses at run time + a copy of the Library already present on the user's computer + system, and (b) will operate properly with a modified version + of the Library that is interface-compatible with the Linked + Version. + + e) Provide Installation Information, but only if you would otherwise + be required to provide such information under section 6 of the + GNU GPL, and only to the extent that such information is + necessary to install and execute a modified version of the + Combined Work produced by recombining or relinking the + Application with a modified version of the Linked Version. (If + you use option 4d0, the Installation Information must accompany + the Minimal Corresponding Source and Corresponding Application + Code. If you use option 4d1, you must provide the Installation + Information in the manner specified by section 6 of the GNU GPL + for conveying Corresponding Source.) + + 5. Combined Libraries. + + You may place library facilities that are a work based on the +Library side by side in a single library together with other library +facilities that are not Applications and are not covered by this +License, and convey such a combined library under terms of your +choice, if you do both of the following: + + a) Accompany the combined library with a copy of the same work based + on the Library, uncombined with any other library facilities, + conveyed under the terms of this License. + + b) Give prominent notice with the combined library that part of it + is a work based on the Library, and explaining where to find the + accompanying uncombined form of the same work. + + 6. Revised Versions of the GNU Lesser General Public License. + + The Free Software Foundation may publish revised and/or new versions +of the GNU Lesser General Public License from time to time. Such new +versions will be similar in spirit to the present version, but may +differ in detail to address new problems or concerns. + + Each version is given a distinguishing version number. If the +Library as you received it specifies that a certain numbered version +of the GNU Lesser General Public License "or any later version" +applies to it, you have the option of following the terms and +conditions either of that published version or of any later version +published by the Free Software Foundation. If the Library as you +received it does not specify a version number of the GNU Lesser +General Public License, you may choose any version of the GNU Lesser +General Public License ever published by the Free Software Foundation. + + If the Library as you received it specifies that a proxy can decide +whether future versions of the GNU Lesser General Public License shall +apply, that proxy's public statement of acceptance of any version is +permanent authorization for you to choose that version for the +Library. diff --git a/oficios_basicos/README.md b/oficios_basicos/README.md new file mode 100644 index 0000000..fd900b1 --- /dev/null +++ b/oficios_basicos/README.md @@ -0,0 +1,28 @@ +# Oficios_Basicos v1.0.0 + +## Descrição +Itens basicos para oficios + +## Requisitos +* Minetest 0.5.0 ou superior +* Mod oficios +* Mod shields +* Mod shooter +* Mod macronodes +* Mod default +* Mod farming +* Mod fire +* Mod tnt + +## Licença +Veja LICENSE.txt para informações detalhadas da licença LGPL 3.0 + +### Autores do código fonte +Originalmente por BrunoMine, Bruno Borges (LGPL 3.0) + +### Autores de mídias (texturas, modelos and sons) +Todos os que não estão listados aqui são de autoria de +BrunoMine, Bruno Borges (CC BY-SA 3.0) + +Desconhecido (CC0) + oficios_basicos_esqueiro.ogg diff --git a/oficios_basicos/cientista.lua b/oficios_basicos/cientista.lua new file mode 100644 index 0000000..b707d42 --- /dev/null +++ b/oficios_basicos/cientista.lua @@ -0,0 +1,87 @@ +--[[ + Mod Oficios_Basicos para Minetest + Copyright (C) 2018 BrunoMine (https://github.com/BrunoMine) + + Recebeste uma cópia da GNU Lesser General + Public License junto com esse software, + se não, veja em . + + Cientista + ]] + +local S = oficios_basicos.S + +-- formspec do Bau Expandido +local bau_formspec = + "size[10,8.5]".. + default.gui_bg.. + default.gui_bg_img.. + default.gui_slots.. + "list[current_name;main;0,0;10,4;]".. + "list[current_player;main;1,4.3;8,1;]".. + "list[current_player;main;1,5.4.08;8,3;8]".. + "listring[current_name;main]".. + "listring[current_player;main]" + +-- Bau Expandido +minetest.register_node("oficios_basicos:bau_expandido", { + description = S("Bau Expandido"), + tiles = {"default_chest_top.png", "default_chest_top.png", "default_chest_side.png", + "default_chest_side.png", "default_chest_side.png", "default_chest_front.png"}, + paramtype2 = "facedir", + groups = {choppy=2,oddly_breakable_by_hand=2}, + legacy_facedir_simple = true, + is_ground_content = false, + sounds = default.node_sound_wood_defaults(), + + on_construct = function(pos) + local meta = minetest.get_meta(pos) + meta:set_string("formspec", bau_formspec) + meta:set_string("infotext", S("Bau Expandido")) + local inv = meta:get_inventory() + inv:set_size("main", 10*4) + end, + can_dig = function(pos,player) + local meta = minetest.get_meta(pos); + local inv = meta:get_inventory() + return inv:is_empty("main") + end, + +}) + +-- Registrando receita de Bau Expandido +local itens_requeridos = { + {"default:wood", 30}, + {"default:steel_ingot", 2} +} +local desc = S("Esse baú cabe mais coisas do que imagina. Perfeito para colocar tralhas.") +oficios.montar_receita( + "cientista", -- Nome do oficio + "oficios_basicos:bau_expandido", -- Item a ser criado + 1, -- Nivel requerido + desc, -- Descricao + 25, -- XP recebido + itens_requeridos, -- Itens requeridos + {00,00,20} -- Tempo +) + +-- Mosquete +if minetest.get_modpath("musket") then + + -- Registrando receita de Mosquete + local itens_requeridos = { + {"default:steel_ingot", 3}, + {"default:junglewood", 3}, + {"musket:ammo_mosquete", 1}, + } + local desc = S("Esse belo mosquete consegue atingir um alvo a 20 blocos de distância.") + oficios.montar_receita( + "cientista", -- Nome do oficio + "musket:mosquete", -- Item a ser criado + 5, -- Nivel requerido + desc, -- Descricao + 200, -- XP recebido + itens_requeridos, -- Itens requeridos + {01,00,00} -- Tempo + ) +end diff --git a/oficios_basicos/construtor.lua b/oficios_basicos/construtor.lua new file mode 100644 index 0000000..34e627d --- /dev/null +++ b/oficios_basicos/construtor.lua @@ -0,0 +1,55 @@ +--[[ + Mod Oficios_Basicos para Minetest + Copyright (C) 2018 BrunoMine (https://github.com/BrunoMine) + + Recebeste uma cópia da GNU Lesser General + Public License junto com esse software, + se não, veja em . + + Construtor + ]] + +local S = oficios_basicos.S + +-- Mesa +minetest.register_node("oficios_basicos:mesa", { + description = S("Mesa"), + drawtype = "nodebox", + paramtype = 'light', + tiles = { + "oficios_basicos_mesa_cima.png", -- Cima + "oficios_basicos_mesa_cima.png", -- Baixo + "oficios_basicos_mesa_lado.png", -- Lado direito + "oficios_basicos_mesa_lado.png", -- Lado esquerda + "oficios_basicos_mesa_lado.png", -- Fundo + "oficios_basicos_mesa_lado.png" -- Frente + }, + node_box = { + type = "fixed", + fixed = { + {-0.5, 0.3125, -0.5, 0.5, 0.5, 0.5}, -- Tampa + {0.1875, -0.5, -0.4375, 0.4375, 0.4375, -0.1875}, -- Perna_1 + {-0.4375, -0.5, -0.4375, -0.1875, 0.375, -0.1875}, -- Perna_2 + {-0.4375, -0.5, 0.1875, -0.1875, 0.375, 0.4375}, -- Perna_3 + {0.1875, -0.5, 0.1875, 0.4375, 0.375, 0.4375}, -- Perna_4 + } + }, + groups = {choppy=3,oddly_breakable_by_hand=3}, + sounds = default.node_sound_wood_defaults(), +}) + +-- Registrando receita +local itens_requeridos = { + {"default:tree", 3}, + {"default:steel_ingot", 2} +} +local desc = S("Uma mesa simples para decorar o ambiente.") +oficios.montar_receita( + "construtor", -- Nome do oficio + "oficios_basicos:mesa", -- Item a ser criado + 1, -- Nivel requerido + desc, -- Descricao + 20, -- XP recebido + itens_requeridos, -- Itens requeridos + {00,00,20} -- Tempo +) diff --git a/oficios_basicos/cozinheiro.lua b/oficios_basicos/cozinheiro.lua new file mode 100644 index 0000000..c5f7a56 --- /dev/null +++ b/oficios_basicos/cozinheiro.lua @@ -0,0 +1,38 @@ +--[[ + Mod Oficios_Basicos para Minetest + Copyright (C) 2018 BrunoMine (https://github.com/BrunoMine) + + Recebeste uma cópia da GNU Lesser General + Public License junto com esse software, + se não, veja em . + + Cozinheiro + ]] + +local S = oficios_basicos.S + +-- Bolinho Selvagem +minetest.register_craftitem("oficios_basicos:bolinho_simples", { + description = S("Bolinho Simples"), + inventory_image = "oficios_basicos_bolinho_selvagem.png", + wield_image = "oficios_basicos_bolinho_selvagem_na_mao.png", + wield_scale = 4, + stack_max = 20, + on_use = minetest.item_eat(5), +}) + +-- Registrando receita +local itens_requeridos = { + {"farming:flour", 1}, + {"default:apple", 1} +} +local desc = S("Um singelo bolinho perfeito para a um lanche de tardinha.") +oficios.montar_receita( + "cozinheiro", -- Nome do oficio + "oficios_basicos:bolinho_simples", -- Item a ser criado + 1, -- Nivel requerido + desc, -- Descricao + 5, -- XP recebido + itens_requeridos, -- Itens requeridos + {00,00,05} -- Tempo +) diff --git a/oficios_basicos/depends.txt b/oficios_basicos/depends.txt new file mode 100644 index 0000000..98e8357 --- /dev/null +++ b/oficios_basicos/depends.txt @@ -0,0 +1,7 @@ +oficios +shields +musket? +default +farming +fire +tnt diff --git a/oficios_basicos/description.txt b/oficios_basicos/description.txt new file mode 100644 index 0000000..30aa8bc --- /dev/null +++ b/oficios_basicos/description.txt @@ -0,0 +1 @@ +Itens basicos para oficios diff --git a/oficios_basicos/ferreiro.lua b/oficios_basicos/ferreiro.lua new file mode 100644 index 0000000..d0de282 --- /dev/null +++ b/oficios_basicos/ferreiro.lua @@ -0,0 +1,79 @@ +--[[ + Mod Oficios_Basicos para Minetest + Copyright (C) 2018 BrunoMine (https://github.com/BrunoMine) + + Recebeste uma cópia da GNU Lesser General + Public License junto com esse software, + se não, veja em . + + Ferreiro + ]] + +local S = oficios_basicos.S + +-- Removido receita de escudo de madeira melhorado (apenas a receita não deve existir) +minetest.clear_craft({output = 'shields:shield_enhanced_wood'}) + +-- Registrando receita de Escudo de Madeira Melhorado +local itens_requeridos = { + {"shields:shield_wood", 1}, + {"default:steel_ingot", 2}, + {"default:stick", 1}, +} +local desc = S("Esse escudo parece mais pesado e resistente do que um simples Escudo de Madeira comum.") +oficios.montar_receita( + "ferreiro", -- Nome do oficio + "shields:shield_enhanced_wood", -- Item a ser criado + 1, -- Nivel requerido + desc, -- Descricao + 25, -- XP recebido + itens_requeridos, -- Itens requeridos + {00,00,15} -- Tempo +) + +-- Definir numero de usos do isqueiro +local USOS = 10 + +-- Desgaste por uso +local DESGASTE_POR_USO = math.ceil(65535/USOS) + +-- Isqueiro +minetest.register_tool("oficios_basicos:isqueiro", { + description = S("Isqueiro"), + inventory_image = "oficios_basicos_isqueiro.png", + wield_image = "oficios_basicos_isqueiro_inv.png", + on_place = function(itemstack, placer, pointed_thing) + if pointed_thing then + local pos = pointed_thing.above + local lugar = minetest.get_node(pos) + if lugar.name=="air" then + if minetest.is_protected(pos, placer:get_player_name()) == false then + lugar.name = "fire:basic_flame" + minetest.set_node(pos, lugar) + minetest.sound_play("oficios_basicos_isqueiro", {pos = placer:getpos(), max_hear_distance = 3, loop = false, gain = 1}) + itemstack:add_wear(DESGASTE_POR_USO) + return itemstack + end + end + end + end, +}) + + +-- Registrar receitas par ferreiro +-- Registrando receita de Escudo de Madeira Melhorado +local itens_requeridos = { + {"default:steel_ingot", 1}, + {"default:stick", 1}, + {"default:flint", 1}, +} +local desc = S("É realmente necessário falar sobre quão útil é um isqueiro?") +oficios.montar_receita( + "ferreiro", -- Nome do oficio + "oficios_basicos:isqueiro", -- Item a ser criado + 2, -- Nivel requerido + desc, -- Descricao + 45, -- XP recebido + itens_requeridos, -- Itens requeridos + {00,00,15} -- Tempo +) diff --git a/oficios_basicos/init.lua b/oficios_basicos/init.lua new file mode 100644 index 0000000..b59563a --- /dev/null +++ b/oficios_basicos/init.lua @@ -0,0 +1,33 @@ +--[[ + Mod Oficios_Basicos para Minetest + Copyright (C) 2018 BrunoMine (https://github.com/BrunoMine) + + Recebeste uma cópia da GNU Lesser General + Public License junto com esse software, + se não, veja em . + + Inicializador de scripts + ]] + +local path = minetest.get_modpath("oficios_basicos") + +oficios_basicos = {} + +minetest.log('verbose',"[OFICIOS_BASICO] iniciando carreamento...") + +dofile(path.."/tradutor.lua") +minetest.log('verbose',"[OFICIOS_BASICO] tradutor carregado...") + +dofile(path.."/construtor.lua") +minetest.log('verbose',"[OFICIOS_BASICO] item de construtor carregado...") + +dofile(path.."/cientista.lua") +minetest.log('verbose',"[OFICIOS_BASICO] item de cientista carregado...") + +dofile(path.."/cozinheiro.lua") +minetest.log('verbose',"[OFICIOS_BASICO] item de cozinheiro carregado...") + +dofile(path.."/ferreiro.lua") +minetest.log('verbose',"[OFICIOS_BASICO] item de ferreiro carregado...") + +minetest.log('action',"[OFICIOS_BASICO] carregado.") diff --git a/oficios_basicos/lib/intllib.lua b/oficios_basicos/lib/intllib.lua new file mode 100644 index 0000000..6669d72 --- /dev/null +++ b/oficios_basicos/lib/intllib.lua @@ -0,0 +1,45 @@ + +-- Fallback functions for when `intllib` is not installed. +-- Code released under Unlicense . + +-- Get the latest version of this file at: +-- https://raw.githubusercontent.com/minetest-mods/intllib/master/lib/intllib.lua + +local function format(str, ...) + local args = { ... } + local function repl(escape, open, num, close) + if escape == "" then + local replacement = tostring(args[tonumber(num)]) + if open == "" then + replacement = replacement..close + end + return replacement + else + return "@"..open..num..close + end + end + return (str:gsub("(@?)@(%(?)(%d+)(%)?)", repl)) +end + +local gettext, ngettext +if minetest.get_modpath("intllib") then + if intllib.make_gettext_pair then + -- New method using gettext. + gettext, ngettext = intllib.make_gettext_pair() + else + -- Old method using text files. + gettext = intllib.Getter() + end +end + +-- Fill in missing functions. + +gettext = gettext or function(msgid, ...) + return format(msgid, ...) +end + +ngettext = ngettext or function(msgid, msgid_plural, n, ...) + return format(n==1 and msgid or msgid_plural, ...) +end + +return gettext, ngettext diff --git a/oficios_basicos/locale/Arquivos para traduzir.txt b/oficios_basicos/locale/Arquivos para traduzir.txt new file mode 100644 index 0000000..d561b0e --- /dev/null +++ b/oficios_basicos/locale/Arquivos para traduzir.txt @@ -0,0 +1 @@ +cientista.lua construtor.lua cozinheiro.lua ferreiro.lua diff --git a/oficios_basicos/locale/en.mo b/oficios_basicos/locale/en.mo new file mode 100644 index 0000000..fa02d13 Binary files /dev/null and b/oficios_basicos/locale/en.mo differ diff --git a/oficios_basicos/locale/en.po b/oficios_basicos/locale/en.po new file mode 100644 index 0000000..08e17dc --- /dev/null +++ b/oficios_basicos/locale/en.po @@ -0,0 +1,66 @@ +# SOME DESCRIPTIVE TITLE. +# Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER +# This file is distributed under the same license as the PACKAGE package. +# FIRST AUTHOR , YEAR. +# +msgid "" +msgstr "" +"Project-Id-Version: \n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2018-08-18 01:17-0300\n" +"PO-Revision-Date: 2018-08-18 01:18-0300\n" +"Last-Translator: \n" +"Language-Team: \n" +"Language: en\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" +"X-Generator: Poedit 2.0.6\n" +"Plural-Forms: nplurals=2; plural=(n != 1);\n" + +#: cientista.lua +msgid "Bau Expandido" +msgstr "Extended Chest" + +#: cientista.lua +msgid "" +"Esse baú cabe mais coisas do que imagina. Perfeito para colocar tralhas." +msgstr "This chest fits more things than you think. Perfect for putting junk." + +#: cientista.lua +msgid "Esse belo mosquete consegue atingir um alvo a 20 blocos de distância." +msgstr "This beautiful musket can reach a target 20 blocks away." + +#: construtor.lua +msgid "Mesa" +msgstr "Table" + +#: construtor.lua +msgid "Uma mesa simples para decorar o ambiente." +msgstr "A simple table to decorate a room." + +#: cozinheiro.lua +msgid "Bolinho Simples" +msgstr "Simple Cake" + +#: cozinheiro.lua +msgid "Um singelo bolinho perfeito para a um lanche de tardinha." +msgstr "A simple coke perfect for a snack." + +#: ferreiro.lua +msgid "" +"Esse escudo parece mais pesado e resistente do que um simples Escudo de " +"Madeira comum." +msgstr "" +"This shield looks heavier and sturdier than a simple ordinary wood shield." + +#: ferreiro.lua +msgid "Isqueiro" +msgstr "Lighter" + +#: ferreiro.lua +msgid "É realmente necessário falar sobre quão útil é um isqueiro?" +msgstr "Is it really necessary to talk about how useful a lighter is?" + +#~ msgid "Agora pode levar o poder do fogo em seu bolso (inventário)." +#~ msgstr "Now you can carry the power of fire in your pocket (inventory)." diff --git a/oficios_basicos/locale/en.po~ b/oficios_basicos/locale/en.po~ new file mode 100644 index 0000000..3e14df9 --- /dev/null +++ b/oficios_basicos/locale/en.po~ @@ -0,0 +1,66 @@ +# SOME DESCRIPTIVE TITLE. +# Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER +# This file is distributed under the same license as the PACKAGE package. +# FIRST AUTHOR , YEAR. +# +msgid "" +msgstr "" +"Project-Id-Version: \n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2018-08-18 01:13-0300\n" +"PO-Revision-Date: 2018-08-18 01:14-0300\n" +"Last-Translator: \n" +"Language-Team: \n" +"Language: en\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" +"X-Generator: Poedit 2.0.6\n" +"Plural-Forms: nplurals=2; plural=(n != 1);\n" + +#: cientista.lua +msgid "Bau Expandido" +msgstr "Extended Chest" + +#: cientista.lua +msgid "" +"Esse baú cabe mais coisas do que imagina. Perfeito para colocar tralhas." +msgstr "This chest fits more things than you think. Perfect for putting junk." + +#: cientista.lua +msgid "Esse belo mosquete consegue atingir um alvo a 20 blocos de distância." +msgstr "This beautiful musket can reach a target 20 blocks away." + +#: construtor.lua +msgid "Mesa" +msgstr "Table" + +#: construtor.lua +msgid "Uma mesa simples para decorar o ambiente." +msgstr "A simple table to decorate a room." + +#: cozinheiro.lua +msgid "Bolinho Simples" +msgstr "Simple Cake" + +#: cozinheiro.lua +msgid "Um singelo bolinho perfeito para a um lanche de tardinha." +msgstr "A simple coke perfect for a snack." + +#: ferreiro.lua +msgid "" +"Esse escudo parece mais pesado e resistente do que um simples Escudo de " +"Madeira comum." +msgstr "" +"This shield looks heavier and sturdier than a simple ordinary wood shield." + +#: ferreiro.lua +msgid "Isqueiro" +msgstr "Lighter" + +#: ferreiro.lua +msgid "É realmente necessário falar sobre quao útil é um isqueiro?" +msgstr "Is it really necessary to talk about how useful a lighter is?" + +#~ msgid "Agora pode levar o poder do fogo em seu bolso (inventário)." +#~ msgstr "Now you can carry the power of fire in your pocket (inventory)." diff --git a/oficios_basicos/locale/oficios_basicos.en.tr b/oficios_basicos/locale/oficios_basicos.en.tr new file mode 100644 index 0000000..c8a514b --- /dev/null +++ b/oficios_basicos/locale/oficios_basicos.en.tr @@ -0,0 +1,12 @@ +### Arquivo gerado por oficios_basicos apartir de en.po +# textdomain: oficios_basicos +This beautiful musket can reach a target 20 blocks away.=This beautiful musket can reach a target 20 blocks away. +A simple table to decorate a room.=A simple table to decorate a room. +This chest fits more things than you think. Perfect for putting junk.=This chest fits more things than you think. Perfect for putting junk. +This shield looks heavier and sturdier than a simple ordinary wood shield.=This shield looks heavier and sturdier than a simple ordinary wood shield. +Simple Cake=Simple Cake +Is it really necessary to talk about how useful a lighter is?=Is it really necessary to talk about how useful a lighter is? +Table=Table +Lighter=Lighter +A simple coke perfect for a snack.=A simple coke perfect for a snack. +Extended Chest=Extended Chest diff --git a/oficios_basicos/locale/oficios_basicos.pt.tr b/oficios_basicos/locale/oficios_basicos.pt.tr new file mode 100644 index 0000000..f209268 --- /dev/null +++ b/oficios_basicos/locale/oficios_basicos.pt.tr @@ -0,0 +1,12 @@ +### Arquivo gerado por oficios_basicos apartir de pt.po +# textdomain: oficios_basicos +This beautiful musket can reach a target 20 blocks away.=Esse belo mosquete consegue atingir um alvo a 20 blocos de distância. +A simple table to decorate a room.=Uma mesa simples para decorar o ambiente. +This chest fits more things than you think. Perfect for putting junk.=Esse baú cabe mais coisas do que imagina. Perfeito para colocar tralhas. +This shield looks heavier and sturdier than a simple ordinary wood shield.=Esse escudo parece mais pesado e resistente do que um simples Escudo de Madeira comum. +Simple Cake=Bolinho Simples +Is it really necessary to talk about how useful a lighter is?=É realmente necessário falar sobre quão útil é um isqueiro? +Table=Mesa +Lighter=Isqueiro +A simple coke perfect for a snack.=Um singelo bolinho perfeito para a um lanche de tardinha. +Extended Chest=Bau Expandido diff --git a/oficios_basicos/locale/pt.mo b/oficios_basicos/locale/pt.mo new file mode 100644 index 0000000..e1ee0e3 Binary files /dev/null and b/oficios_basicos/locale/pt.mo differ diff --git a/oficios_basicos/locale/pt.po b/oficios_basicos/locale/pt.po new file mode 100644 index 0000000..94e1918 --- /dev/null +++ b/oficios_basicos/locale/pt.po @@ -0,0 +1,74 @@ +# SOME DESCRIPTIVE TITLE. +# Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER +# This file is distributed under the same license as the PACKAGE package. +# FIRST AUTHOR , YEAR. +# +msgid "" +msgstr "" +"Project-Id-Version: \n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2018-08-18 01:17-0300\n" +"PO-Revision-Date: 2018-08-18 01:17-0300\n" +"Last-Translator: \n" +"Language-Team: \n" +"Language: pt\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" +"X-Generator: Poedit 2.0.6\n" +"Plural-Forms: nplurals=2; plural=(n != 1);\n" + +#: cientista.lua +msgid "Bau Expandido" +msgstr "Bau Expandido" + +#: cientista.lua +msgid "" +"Esse baú cabe mais coisas do que imagina. Perfeito para colocar tralhas." +msgstr "" +"Esse baú cabe mais coisas do que imagina. Perfeito para colocar tralhas." + +#: cientista.lua +msgid "Esse belo mosquete consegue atingir um alvo a 20 blocos de distância." +msgstr "Esse belo mosquete consegue atingir um alvo a 20 blocos de distância." + +#: construtor.lua +msgid "Mesa" +msgstr "Mesa" + +#: construtor.lua +msgid "Uma mesa simples para decorar o ambiente." +msgstr "Uma mesa simples para decorar o ambiente." + +#: cozinheiro.lua +msgid "Bolinho Simples" +msgstr "Bolinho Simples" + +#: cozinheiro.lua +msgid "Um singelo bolinho perfeito para a um lanche de tardinha." +msgstr "Um singelo bolinho perfeito para a um lanche de tardinha." + +#: ferreiro.lua +msgid "" +"Esse escudo parece mais pesado e resistente do que um simples Escudo de " +"Madeira comum." +msgstr "" +"Esse escudo parece mais pesado e resistente do que um simples Escudo de " +"Madeira comum." + +#: ferreiro.lua +msgid "Isqueiro" +msgstr "Isqueiro" + +#: ferreiro.lua +msgid "É realmente necessário falar sobre quão útil é um isqueiro?" +msgstr "É realmente necessário falar sobre quão útil é um isqueiro?" + +#~ msgid "Agora pode levar o poder do fogo em seu bolso (inventário)." +#~ msgstr "Agora pode levar o poder do fogo em seu bolso (inventário)." + +#~ msgid "Frutos Selvagens" +#~ msgstr "Frutos Selvagens" + +#~ msgid "Isso sim parece uma boa obra de ferreiro que se preze." +#~ msgstr "Isso sim parece uma boa obra de ferreiro que se preze." diff --git a/oficios_basicos/locale/pt.po~ b/oficios_basicos/locale/pt.po~ new file mode 100644 index 0000000..2c6063d --- /dev/null +++ b/oficios_basicos/locale/pt.po~ @@ -0,0 +1,74 @@ +# SOME DESCRIPTIVE TITLE. +# Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER +# This file is distributed under the same license as the PACKAGE package. +# FIRST AUTHOR , YEAR. +# +msgid "" +msgstr "" +"Project-Id-Version: \n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2018-08-18 01:13-0300\n" +"PO-Revision-Date: 2018-08-18 01:15-0300\n" +"Last-Translator: \n" +"Language-Team: \n" +"Language: pt\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" +"X-Generator: Poedit 2.0.6\n" +"Plural-Forms: nplurals=2; plural=(n != 1);\n" + +#: cientista.lua +msgid "Bau Expandido" +msgstr "Bau Expandido" + +#: cientista.lua +msgid "" +"Esse baú cabe mais coisas do que imagina. Perfeito para colocar tralhas." +msgstr "" +"Esse baú cabe mais coisas do que imagina. Perfeito para colocar tralhas." + +#: cientista.lua +msgid "Esse belo mosquete consegue atingir um alvo a 20 blocos de distância." +msgstr "Esse belo mosquete consegue atingir um alvo a 20 blocos de distância." + +#: construtor.lua +msgid "Mesa" +msgstr "Mesa" + +#: construtor.lua +msgid "Uma mesa simples para decorar o ambiente." +msgstr "Uma mesa simples para decorar o ambiente." + +#: cozinheiro.lua +msgid "Bolinho Simples" +msgstr "Bolinho Simples" + +#: cozinheiro.lua +msgid "Um singelo bolinho perfeito para a um lanche de tardinha." +msgstr "Um singelo bolinho perfeito para a um lanche de tardinha." + +#: ferreiro.lua +msgid "" +"Esse escudo parece mais pesado e resistente do que um simples Escudo de " +"Madeira comum." +msgstr "" +"Esse escudo parece mais pesado e resistente do que um simples Escudo de " +"Madeira comum." + +#: ferreiro.lua +msgid "Isqueiro" +msgstr "Isqueiro" + +#: ferreiro.lua +msgid "É realmente necessário falar sobre quao útil é um isqueiro?" +msgstr "É realmente necessário falar sobre quao útil é um isqueiro?" + +#~ msgid "Agora pode levar o poder do fogo em seu bolso (inventário)." +#~ msgstr "Agora pode levar o poder do fogo em seu bolso (inventário)." + +#~ msgid "Frutos Selvagens" +#~ msgstr "Frutos Selvagens" + +#~ msgid "Isso sim parece uma boa obra de ferreiro que se preze." +#~ msgstr "Isso sim parece uma boa obra de ferreiro que se preze." diff --git a/oficios_basicos/locale/template.pot b/oficios_basicos/locale/template.pot new file mode 100644 index 0000000..b72a392 --- /dev/null +++ b/oficios_basicos/locale/template.pot @@ -0,0 +1,61 @@ +# SOME DESCRIPTIVE TITLE. +# Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER +# This file is distributed under the same license as the PACKAGE package. +# FIRST AUTHOR , YEAR. +# +#, fuzzy +msgid "" +msgstr "" +"Project-Id-Version: PACKAGE VERSION\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2018-08-18 01:17-0300\n" +"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" +"Last-Translator: FULL NAME \n" +"Language-Team: LANGUAGE \n" +"Language: \n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" + +#: cientista.lua +msgid "Bau Expandido" +msgstr "" + +#: cientista.lua +msgid "" +"Esse baú cabe mais coisas do que imagina. Perfeito para colocar tralhas." +msgstr "" + +#: cientista.lua +msgid "Esse belo mosquete consegue atingir um alvo a 20 blocos de distância." +msgstr "" + +#: construtor.lua +msgid "Mesa" +msgstr "" + +#: construtor.lua +msgid "Uma mesa simples para decorar o ambiente." +msgstr "" + +#: cozinheiro.lua +msgid "Bolinho Simples" +msgstr "" + +#: cozinheiro.lua +msgid "Um singelo bolinho perfeito para a um lanche de tardinha." +msgstr "" + +#: ferreiro.lua +msgid "" +"Esse escudo parece mais pesado e resistente do que um simples Escudo de " +"Madeira comum." +msgstr "" + +#: ferreiro.lua +msgid "Isqueiro" +msgstr "" + +#: ferreiro.lua +msgid "É realmente necessário falar sobre quão útil é um isqueiro?" +msgstr "" diff --git a/oficios_basicos/sounds/oficios_basicos_esqueiro.ogg b/oficios_basicos/sounds/oficios_basicos_esqueiro.ogg new file mode 100644 index 0000000..08d96eb Binary files /dev/null and b/oficios_basicos/sounds/oficios_basicos_esqueiro.ogg differ diff --git a/oficios_basicos/textures/oficios_basicos_bolinho_selvagem.png b/oficios_basicos/textures/oficios_basicos_bolinho_selvagem.png new file mode 100644 index 0000000..38ad520 Binary files /dev/null and b/oficios_basicos/textures/oficios_basicos_bolinho_selvagem.png differ diff --git a/oficios_basicos/textures/oficios_basicos_bolinho_selvagem_na_mao.png b/oficios_basicos/textures/oficios_basicos_bolinho_selvagem_na_mao.png new file mode 100644 index 0000000..0ed8468 Binary files /dev/null and b/oficios_basicos/textures/oficios_basicos_bolinho_selvagem_na_mao.png differ diff --git a/oficios_basicos/textures/oficios_basicos_isqueiro.png b/oficios_basicos/textures/oficios_basicos_isqueiro.png new file mode 100644 index 0000000..86db037 Binary files /dev/null and b/oficios_basicos/textures/oficios_basicos_isqueiro.png differ diff --git a/oficios_basicos/textures/oficios_basicos_isqueiro_inv.png b/oficios_basicos/textures/oficios_basicos_isqueiro_inv.png new file mode 100644 index 0000000..28a6a99 Binary files /dev/null and b/oficios_basicos/textures/oficios_basicos_isqueiro_inv.png differ diff --git a/oficios_basicos/textures/oficios_basicos_mesa_cima.png b/oficios_basicos/textures/oficios_basicos_mesa_cima.png new file mode 100644 index 0000000..9696208 Binary files /dev/null and b/oficios_basicos/textures/oficios_basicos_mesa_cima.png differ diff --git a/oficios_basicos/textures/oficios_basicos_mesa_lado.png b/oficios_basicos/textures/oficios_basicos_mesa_lado.png new file mode 100644 index 0000000..101a268 Binary files /dev/null and b/oficios_basicos/textures/oficios_basicos_mesa_lado.png differ diff --git a/oficios_basicos/tools/xgettext.bat b/oficios_basicos/tools/xgettext.bat new file mode 100644 index 0000000..18403db --- /dev/null +++ b/oficios_basicos/tools/xgettext.bat @@ -0,0 +1,33 @@ +@echo off +setlocal + +set me=%~n0 + +rem # Uncomment the following line if gettext is not in your PATH. +rem # Value must be absolute and end in a backslash. +rem set gtprefix=C:\path\to\gettext\bin\ + +if "%1" == "" ( + echo Usage: %me% FILE... 1>&2 + exit 1 +) + +set xgettext=%gtprefix%xgettext.exe +set msgmerge=%gtprefix%msgmerge.exe + +md locale > nul 2>&1 +echo Generating template... 1>&2 +echo %xgettext% --from-code=UTF-8 -kS -kNS:1,2 -k_ -o locale/template.pot %* +%xgettext% --from-code=UTF-8 -kS -kNS:1,2 -k_ -o locale/template.pot %* +if %ERRORLEVEL% neq 0 goto done + +cd locale + +for %%f in (*.po) do ( + echo Updating %%f... 1>&2 + %msgmerge% --update %%f template.pot +) + +echo DONE! 1>&2 + +:done diff --git a/oficios_basicos/tools/xgettext.sh b/oficios_basicos/tools/xgettext.sh new file mode 100755 index 0000000..1504f42 --- /dev/null +++ b/oficios_basicos/tools/xgettext.sh @@ -0,0 +1,27 @@ +#! /bin/bash + +me=$(basename "${BASH_SOURCE[0]}"); + +if [[ $# -lt 1 ]]; then + echo "Usage: $me FILE..." >&2; + exit 1; +fi + +mkdir -p locale; +echo "Generating template..." >&2; +xgettext --from-code=UTF-8 \ + --keyword=S \ + --keyword=NS:1,2 \ + --keyword=N_ \ + --add-comments='Translators:' \ + --add-location=file \ + -o locale/template.pot \ + "$@" \ + || exit; + +find locale -name '*.po' -type f | while read -r file; do + echo "Updating $file..." >&2; + msgmerge --update "$file" locale/template.pot; +done + +echo "DONE!" >&2; diff --git a/oficios_basicos/tradutor.lua b/oficios_basicos/tradutor.lua new file mode 100644 index 0000000..010dd0f --- /dev/null +++ b/oficios_basicos/tradutor.lua @@ -0,0 +1,177 @@ +--[[ + Mod oficios_basicos para Minetest + Copyright (C) 2018 BrunoMine (https://github.com/BrunoMine) + + Recebeste uma cópia da GNU Lesser General + Public License junto com esse software, + se não, veja em . + + Sistema de tradução + ]] + +-- Modpath +local modpath = minetest.get_modpath("oficios_basicos") + +-- Tradução intllib +oficios_basicos.intllib = {} +oficios_basicos.intllib.S, oficios_basicos.intllib.NS = dofile(modpath.."/lib/intllib.lua") + +-- Configura tradutor opicional +oficios_basicos.S = oficios_basicos.intllib.S +oficios_basicos.NS = oficios_basicos.intllib.NS + +-- +-- Ajustes devido ao bug de tradutor ler apenas traduzir do ingles +-- + +-- Strings para repassar textos em ingles +local pt_to_en = {} + +-- Gera arquivos de tradução oficios_basicos.*.tr +do + local file_to_tb = function(file) + local msgid = nil + local msgstr = nil + local tb = {} + for line in io.lines(file) do + + -- Iniciando 'msgid' + if string.sub(line, 1, 5) == "msgid" then + + -- Escrever no catalogo a anterior + if msgid ~= nil and msgstr ~= nil then + if msgid ~= "" then + tb[msgid] = msgstr + end + msgid = nil + msgstr = nil + end + + if line == "msgid \"\"" then + msgid = "" + else + msgid = string.sub(line, 8, (string.len(line)-1)) + end + + -- Continuando 'msgid' + elseif string.sub(line, 1, 1) == "\"" and msgstr == nil and msgid ~= nil then + msgid = msgid .. string.sub(line, 2, (string.len(line)-1)) + + -- Iniciando 'msgstr' + elseif string.sub(line, 1, 6) == "msgstr" then + + if line == "msgstr \"\"" then + msgstr = "" + else + msgstr = string.sub(line, 9, (string.len(line)-1)) + end + + -- Continuando 'msgstr' + elseif string.sub(line, 1, 1) == "\"" and msgstr ~= nil then + msgstr = msgstr .. string.sub(line, 2, (string.len(line)-1)) + + end + + + end + + -- Escrever ultima + if msgid ~= nil and msgstr ~= nil then + if msgid ~= "" then + tb[msgid] = msgstr + end + msgid = nil + msgstr = nil + end + + return tb + end + + -- Pegar strings principais en-pt para realizar as trocas + pt_to_en = file_to_tb(modpath.."/locale/en.po") + + --minetest.log("error", "pt_to_en = "..dump(pt_to_en)) + + local list = minetest.get_dir_list(modpath.."/locale") + for _,file in ipairs(list) do + + if string.match(file, "~") == nil then + + -- Traduções ".po" + if string.match(file, ".pot") == nil and string.match(file, ".po") then + + local lang_code = string.gsub(file, ".po", "") + + local pt_to_lang = file_to_tb(modpath.."/locale/"..file) + + -- tabela desejada + local en_to_lang = {} + for pt,en in pairs(pt_to_en) do + en_to_lang[en] = pt_to_lang[pt] + end + + -- Novo arquivo + local new_file = "### Arquivo gerado por oficios_basicos apartir de "..file.."\n# textdomain: oficios_basicos\n" + for en,lang in pairs(en_to_lang) do + new_file = new_file .. en .. "=" .. lang .. "\n" + end + -- Escrever arquivo + local saida = io.open(modpath.."/locale/oficios_basicos."..lang_code..".tr", "w") + saida:write(new_file) + io.close(saida) + end + end + end +end + +-- Ajuste para repassar termos em ingles +local s +if minetest.get_translator ~= nil then + s = minetest.get_translator("oficios_basicos") +else + s = oficios_basicos.intllib.S +end + +oficios_basicos.s = function(...) + local args = { ... } + if pt_to_en[args[1]] ~= nil then + return s(pt_to_en[args[1]], unpack(args, 2)) + end + minetest.log("error", "[oficios_basicos] String "..dump(args[1]).." nao catalogada") + return s(...) +end + +-- Não troca string caso esteja trabalhando com intllib +if minetest.get_modpath("intllib") ~= nil + and minetest.get_translator == nil +then + oficios_basicos.s = s +end + +oficios_basicos.S = function(...) + local args = { ... } + if type(args[1]) == "table" then + local r = {} + for n,a in ipairs(args[1]) do + if n ~= 1 then -- Não traduz o primeiro + table.insert(r, oficios_basicos.S(a)) + else + table.insert(r, a) + end + end + + return oficios_basicos.s(unpack(r)) + + elseif type(args[1]) == "string" then + -- Não traduz caso faltem argumentos (devido strings ilustrativas) + return oficios_basicos.s(...) + + else + return args[1] + end +end + +-- Função que retorna a string inalterada para passar pela checagem +oficios_basicos.Sfake = function(s) return s end + +