From 9b5c7d13d76b58e6426d64dc89186f82160a37d9 Mon Sep 17 00:00:00 2001 From: BrunoMine Date: Sat, 12 Aug 2017 12:04:38 -0300 Subject: [PATCH] =?UTF-8?q?Adici=C3=A7=C3=A3o=20de=20sistema=20se=20segura?= =?UTF-8?q?n=C3=A7a=20e=20novos=20idiomas?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- idioma.lua | 21 ++++++++++++++++----- locale/de.po | 30 ++++++++++++++++++++++++++++++ locale/en.po | 23 +++++++++++------------ locale/es.po | 20 ++++++++++---------- locale/fr.po | 30 ++++++++++++++++++++++++++++++ locale/it.po | 31 +++++++++++++++++++++++++++++++ locale/nl.po | 30 ++++++++++++++++++++++++++++++ locale/pt.po | 22 +++++++++++----------- 8 files changed, 169 insertions(+), 38 deletions(-) create mode 100644 locale/de.po create mode 100644 locale/fr.po create mode 100644 locale/it.po create mode 100644 locale/nl.po diff --git a/idioma.lua b/idioma.lua index 6899f5e..98b9509 100644 --- a/idioma.lua +++ b/idioma.lua @@ -15,11 +15,15 @@ local S, NS, SS, SNS = dofile(minetest.get_modpath("mymenu").."/lib/intllib.lua" -- Algoritimo para pegar idioma com "mylang" local getlang, setlang = dofile(minetest.get_modpath(minetest.get_current_modname()).."/lib/mylang.lua") --- Tabela de idiomas selecionaveis +-- Tabela de idiomas selecionaveis ISO 639 local tb_idiomas = { ["English"] = "en", ["Portugues"] = "pt", ["Espanol"] = "es", + ["Italiano"] = "it", + ["Deutsch"] = "de", + ["Nederlands"] = "nl", + ["Français"] = "fr", } -- Tabela de codigos com o numero tb_idiomas_code = {} @@ -43,18 +47,25 @@ local acessar_menu_idiomas = function(player) local name = player:get_player_name() local lang = getlang(name) or "en" -- não pode ser nulo + -- Idioma salvo + local idioma_st = "" + -- Idioma selecionado local idioma_sel = "1" - if lang and tb_idiomas_code[lang] then - idioma_sel = tonumber(tb_idiomas_code[lang]) + if lang then + if tb_idiomas_code[lang] then + idioma_sel = tonumber(tb_idiomas_code[lang]) + else + -- mostra idioma salvo + idioma_st = lang.."," + end end - local formspec = "size[5,5]" ..default.gui_bg ..default.gui_bg_img .."label[0,0;"..SS(lang, "Escolha seu idioma").."]" - .."dropdown[0.125,1;5,5;idioma;"..st_idiomas..";"..(idioma_sel).."]" + .."dropdown[0.125,1;5,5;idioma;"..idioma_st..st_idiomas..";"..(idioma_sel).."]" .."button_exit[0,4.3;3,1;voltar;"..SS(lang, "Voltar").."]" minetest.show_formspec(name, "mymenu:idiomas", formspec) diff --git a/locale/de.po b/locale/de.po new file mode 100644 index 0000000..21723dc --- /dev/null +++ b/locale/de.po @@ -0,0 +1,30 @@ +# Translation for MyMenu Mod +# Copyright (C) LGPL v3.0 +# This file is distributed under the same license as the MyMenu package. +# BrunoMine , 2017. +# +msgid "" +msgstr "" +"Project-Id-Version: v1.0.0\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2017-08-11 14:38-0300\n" +"PO-Revision-Date: 2017-08-12 11:57-0300\n" +"Last-Translator: BrunoMine \n" +"Language-Team: BrunoMine \n" +"Language: German\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" +"X-Generator: Gtranslator 2.91.7\n" + +#: idioma.lua +msgid "Escolha seu idioma" +msgstr "Wahlen Sie Ihre Sprache" + +#: idioma.lua +msgid "Voltar" +msgstr "Zuruck" + +#: idioma.lua +msgid "Idioma" +msgstr "Sprache" diff --git a/locale/en.po b/locale/en.po index 0a21f3f..4a58469 100644 --- a/locale/en.po +++ b/locale/en.po @@ -1,20 +1,19 @@ -# 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. -# FULL NAME , 2017. +# Translation for MyMenu Mod +# Copyright (C) LGPL v3.0 +# This file is distributed under the same license as the MyMenu package. +# BrunoMine , 2017. # msgid "" msgstr "" -"Project-Id-Version: PACKAGE VERSION\n" +"Project-Id-Version: v1.0.0\n" "Report-Msgid-Bugs-To: \n" "POT-Creation-Date: 2017-08-11 14:38-0300\n" -"PO-Revision-Date: 2017-08-11 14:39-0300\n" -"Last-Translator: FULL NAME \n" -"Language-Team: LANGUAGE \n" -"Language: \n" +"PO-Revision-Date: 2017-08-12 11:56-0300\n" +"Last-Translator: BrunoMine \n" +"Language-Team: BrunoMine \n" +"Language: English\n" "MIME-Version: 1.0\n" -"Content-Type: text/plain; charset=CHARSET\n" +"Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" "X-Generator: Gtranslator 2.91.7\n" @@ -24,7 +23,7 @@ msgstr "Choose your language" #: idioma.lua msgid "Voltar" -msgstr "Return" +msgstr "Back" #: idioma.lua msgid "Idioma" diff --git a/locale/es.po b/locale/es.po index dd738cc..60b3f91 100644 --- a/locale/es.po +++ b/locale/es.po @@ -1,20 +1,20 @@ -# 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. -# FULL NAME , 2017. +# Translation for MyMenu Mod +# Copyright (C) LGPL v3.0 +# This file is distributed under the same license as the MyMenu package. +# BrunoMine , 2017. +# BrunoMine , 2017. # msgid "" msgstr "" -"Project-Id-Version: PACKAGE VERSION\n" +"Project-Id-Version: v1.0.0\n" "Report-Msgid-Bugs-To: \n" "POT-Creation-Date: 2017-08-11 14:38-0300\n" "PO-Revision-Date: 2017-08-11 14:39-0300\n" -"Last-Translator: FULL NAME \n" -"Language-Team: LANGUAGE \n" -"Language: \n" +"Last-Translator: BrunoMine \n" +"Language-Team: BrunoMine \n" +"Language: Spanish\n" "MIME-Version: 1.0\n" -"Content-Type: text/plain; charset=CHARSET\n" +"Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" "X-Generator: Gtranslator 2.91.7\n" diff --git a/locale/fr.po b/locale/fr.po new file mode 100644 index 0000000..7f2cb31 --- /dev/null +++ b/locale/fr.po @@ -0,0 +1,30 @@ +# Translation for MyMenu Mod +# Copyright (C) LGPL v3.0 +# This file is distributed under the same license as the MyMenu package. +# BrunoMine , 2017. +# +msgid "" +msgstr "" +"Project-Id-Version: v1.0.0\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2017-08-11 14:38-0300\n" +"PO-Revision-Date: 2017-08-12 11:59-0300\n" +"Last-Translator: BrunoMine \n" +"Language-Team: BrunoMine \n" +"Language: French\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" +"X-Generator: Gtranslator 2.91.7\n" + +#: idioma.lua +msgid "Escolha seu idioma" +msgstr "Choisissez votre langue" + +#: idioma.lua +msgid "Voltar" +msgstr "Retour" + +#: idioma.lua +msgid "Idioma" +msgstr "Langue" diff --git a/locale/it.po b/locale/it.po new file mode 100644 index 0000000..d782db6 --- /dev/null +++ b/locale/it.po @@ -0,0 +1,31 @@ +# Translation for MyMenu Mod +# Copyright (C) LGPL v3.0 +# This file is distributed under the same license as the MyMenu package. +# BrunoMine , 2017. +# BrunoMine , 2017. +# +msgid "" +msgstr "" +"Project-Id-Version: v1.0.0\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2017-08-11 14:38-0300\n" +"PO-Revision-Date: 2017-08-11 14:39-0300\n" +"Last-Translator: BrunoMine \n" +"Language-Team: BrunoMine \n" +"Language: Italian\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" +"X-Generator: Gtranslator 2.91.7\n" + +#: idioma.lua +msgid "Escolha seu idioma" +msgstr "Scegli la lingua" + +#: idioma.lua +msgid "Voltar" +msgstr "Indietro" + +#: idioma.lua +msgid "Idioma" +msgstr "Lingua" diff --git a/locale/nl.po b/locale/nl.po new file mode 100644 index 0000000..ee04f6f --- /dev/null +++ b/locale/nl.po @@ -0,0 +1,30 @@ +# Translation for MyMenu Mod +# Copyright (C) LGPL v3.0 +# This file is distributed under the same license as the MyMenu package. +# BrunoMine , 2017. +# +msgid "" +msgstr "" +"Project-Id-Version: v1.0.0\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2017-08-11 14:38-0300\n" +"PO-Revision-Date: 2017-08-12 11:55-0300\n" +"Last-Translator: BrunoMine \n" +"Language-Team: BrunoMine \n" +"Language: Dutch\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" +"X-Generator: Gtranslator 2.91.7\n" + +#: idioma.lua +msgid "Escolha seu idioma" +msgstr "Kies uw taal" + +#: idioma.lua +msgid "Voltar" +msgstr "Back" + +#: idioma.lua +msgid "Idioma" +msgstr "Taal" diff --git a/locale/pt.po b/locale/pt.po index a6f5ee3..3b6d2b8 100644 --- a/locale/pt.po +++ b/locale/pt.po @@ -1,20 +1,20 @@ -# 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. -# FULL NAME , 2017. +# Translation for MyMenu Mod +# Copyright (C) LGPL v3.0 +# This file is distributed under the same license as the MyMenu package. +# BrunoMine , 2017. +# BrunoMine , 2017. # msgid "" msgstr "" -"Project-Id-Version: PACKAGE VERSION\n" +"Project-Id-Version: v1.0.0\n" "Report-Msgid-Bugs-To: \n" "POT-Creation-Date: 2017-08-11 14:38-0300\n" -"PO-Revision-Date: 2017-08-11 14:38-0300\n" -"Last-Translator: FULL NAME \n" -"Language-Team: LANGUAGE \n" -"Language: \n" +"PO-Revision-Date: 2017-08-11 14:39-0300\n" +"Last-Translator: BrunoMine \n" +"Language-Team: BrunoMine \n" +"Language: Portuguese\n" "MIME-Version: 1.0\n" -"Content-Type: text/plain; charset=CHARSET\n" +"Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" "X-Generator: Gtranslator 2.91.7\n"