Adicição de sistema se segurança e novos idiomas

master
BrunoMine 2017-08-12 12:04:38 -03:00
parent 2bbd8ce894
commit 9b5c7d13d7
8 changed files with 169 additions and 38 deletions

View File

@ -15,11 +15,15 @@ local S, NS, SS, SNS = dofile(minetest.get_modpath("mymenu").."/lib/intllib.lua"
-- Algoritimo para pegar idioma com "mylang" -- Algoritimo para pegar idioma com "mylang"
local getlang, setlang = dofile(minetest.get_modpath(minetest.get_current_modname()).."/lib/mylang.lua") 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 = { local tb_idiomas = {
["English"] = "en", ["English"] = "en",
["Portugues"] = "pt", ["Portugues"] = "pt",
["Espanol"] = "es", ["Espanol"] = "es",
["Italiano"] = "it",
["Deutsch"] = "de",
["Nederlands"] = "nl",
["Français"] = "fr",
} }
-- Tabela de codigos com o numero -- Tabela de codigos com o numero
tb_idiomas_code = {} tb_idiomas_code = {}
@ -43,18 +47,25 @@ local acessar_menu_idiomas = function(player)
local name = player:get_player_name() local name = player:get_player_name()
local lang = getlang(name) or "en" -- não pode ser nulo local lang = getlang(name) or "en" -- não pode ser nulo
-- Idioma salvo
local idioma_st = ""
-- Idioma selecionado -- Idioma selecionado
local idioma_sel = "1" local idioma_sel = "1"
if lang and tb_idiomas_code[lang] then if lang then
idioma_sel = tonumber(tb_idiomas_code[lang]) if tb_idiomas_code[lang] then
idioma_sel = tonumber(tb_idiomas_code[lang])
else
-- mostra idioma salvo
idioma_st = lang..","
end
end end
local formspec = "size[5,5]" local formspec = "size[5,5]"
..default.gui_bg ..default.gui_bg
..default.gui_bg_img ..default.gui_bg_img
.."label[0,0;"..SS(lang, "Escolha seu idioma").."]" .."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").."]" .."button_exit[0,4.3;3,1;voltar;"..SS(lang, "Voltar").."]"
minetest.show_formspec(name, "mymenu:idiomas", formspec) minetest.show_formspec(name, "mymenu:idiomas", formspec)

30
locale/de.po Normal file
View File

@ -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 <borgesdossantosbruno@gmail.com>, 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 <borgesdossantosbruno@gmail.com>\n"
"Language-Team: BrunoMine <borgesdossantosbruno@gmail.com>\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"

View File

@ -1,20 +1,19 @@
# SOME DESCRIPTIVE TITLE. # Translation for MyMenu Mod
# Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER # Copyright (C) LGPL v3.0
# This file is distributed under the same license as the PACKAGE package. # This file is distributed under the same license as the MyMenu package.
# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR. # BrunoMine <borgesdossantosbruno@gmail.com>, 2017.
# FULL NAME <EMAIL@ADDRESS>, 2017.
# #
msgid "" msgid ""
msgstr "" msgstr ""
"Project-Id-Version: PACKAGE VERSION\n" "Project-Id-Version: v1.0.0\n"
"Report-Msgid-Bugs-To: \n" "Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2017-08-11 14:38-0300\n" "POT-Creation-Date: 2017-08-11 14:38-0300\n"
"PO-Revision-Date: 2017-08-11 14:39-0300\n" "PO-Revision-Date: 2017-08-12 11:56-0300\n"
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n" "Last-Translator: BrunoMine <borgesdossantosbruno@gmail.com>\n"
"Language-Team: LANGUAGE <LL@li.org>\n" "Language-Team: BrunoMine <borgesdossantosbruno@gmail.com>\n"
"Language: \n" "Language: English\n"
"MIME-Version: 1.0\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" "Content-Transfer-Encoding: 8bit\n"
"X-Generator: Gtranslator 2.91.7\n" "X-Generator: Gtranslator 2.91.7\n"
@ -24,7 +23,7 @@ msgstr "Choose your language"
#: idioma.lua #: idioma.lua
msgid "Voltar" msgid "Voltar"
msgstr "Return" msgstr "Back"
#: idioma.lua #: idioma.lua
msgid "Idioma" msgid "Idioma"

View File

@ -1,20 +1,20 @@
# SOME DESCRIPTIVE TITLE. # Translation for MyMenu Mod
# Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER # Copyright (C) LGPL v3.0
# This file is distributed under the same license as the PACKAGE package. # This file is distributed under the same license as the MyMenu package.
# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR. # BrunoMine <borgesdossantosbruno@gmail.com>, 2017.
# FULL NAME <EMAIL@ADDRESS>, 2017. # BrunoMine <borgesdossantosbruno@gmail.com>, 2017.
# #
msgid "" msgid ""
msgstr "" msgstr ""
"Project-Id-Version: PACKAGE VERSION\n" "Project-Id-Version: v1.0.0\n"
"Report-Msgid-Bugs-To: \n" "Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2017-08-11 14:38-0300\n" "POT-Creation-Date: 2017-08-11 14:38-0300\n"
"PO-Revision-Date: 2017-08-11 14:39-0300\n" "PO-Revision-Date: 2017-08-11 14:39-0300\n"
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n" "Last-Translator: BrunoMine <borgesdossantosbruno@gmail.com>\n"
"Language-Team: LANGUAGE <LL@li.org>\n" "Language-Team: BrunoMine <borgesdossantosbruno@gmail.com>\n"
"Language: \n" "Language: Spanish\n"
"MIME-Version: 1.0\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" "Content-Transfer-Encoding: 8bit\n"
"X-Generator: Gtranslator 2.91.7\n" "X-Generator: Gtranslator 2.91.7\n"

30
locale/fr.po Normal file
View File

@ -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 <borgesdossantosbruno@gmail.com>, 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 <borgesdossantosbruno@gmail.com>\n"
"Language-Team: BrunoMine <borgesdossantosbruno@gmail.com>\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"

31
locale/it.po Normal file
View File

@ -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 <borgesdossantosbruno@gmail.com>, 2017.
# BrunoMine <borgesdossantosbruno@gmail.com>, 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 <borgesdossantosbruno@gmail.com>\n"
"Language-Team: BrunoMine <borgesdossantosbruno@gmail.com>\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"

30
locale/nl.po Normal file
View File

@ -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 <borgesdossantosbruno@gmail.com>, 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 <borgesdossantosbruno@gmail.com>\n"
"Language-Team: BrunoMine <borgesdossantosbruno@gmail.com>\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"

View File

@ -1,20 +1,20 @@
# SOME DESCRIPTIVE TITLE. # Translation for MyMenu Mod
# Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER # Copyright (C) LGPL v3.0
# This file is distributed under the same license as the PACKAGE package. # This file is distributed under the same license as the MyMenu package.
# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR. # BrunoMine <borgesdossantosbruno@gmail.com>, 2017.
# FULL NAME <EMAIL@ADDRESS>, 2017. # BrunoMine <borgesdossantosbruno@gmail.com>, 2017.
# #
msgid "" msgid ""
msgstr "" msgstr ""
"Project-Id-Version: PACKAGE VERSION\n" "Project-Id-Version: v1.0.0\n"
"Report-Msgid-Bugs-To: \n" "Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2017-08-11 14:38-0300\n" "POT-Creation-Date: 2017-08-11 14:38-0300\n"
"PO-Revision-Date: 2017-08-11 14:38-0300\n" "PO-Revision-Date: 2017-08-11 14:39-0300\n"
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n" "Last-Translator: BrunoMine <borgesdossantosbruno@gmail.com>\n"
"Language-Team: LANGUAGE <LL@li.org>\n" "Language-Team: BrunoMine <borgesdossantosbruno@gmail.com>\n"
"Language: \n" "Language: Portuguese\n"
"MIME-Version: 1.0\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" "Content-Transfer-Encoding: 8bit\n"
"X-Generator: Gtranslator 2.91.7\n" "X-Generator: Gtranslator 2.91.7\n"