From 43ca3f2c90945bc99f71fa048db6030ad8ea5a55 Mon Sep 17 00:00:00 2001 From: BrunoMine Date: Sun, 16 Jul 2017 12:59:05 -0300 Subject: [PATCH] Update intltest mod for use SS and SNS methods --- intltest/init.lua | 17 ++++++++++- intltest/locale/de.po | 55 ++++++++++++++++++++++++++++++++++++ intltest/locale/es.po | 16 +++++++++-- intltest/locale/pt.po | 55 ++++++++++++++++++++++++++++++++++++ intltest/locale/template.pot | 12 +++++++- 5 files changed, 151 insertions(+), 4 deletions(-) create mode 100644 intltest/locale/de.po create mode 100644 intltest/locale/pt.po diff --git a/intltest/init.lua b/intltest/init.lua index e855621..0051174 100644 --- a/intltest/init.lua +++ b/intltest/init.lua @@ -1,7 +1,7 @@ -- Load support for intllib. local MP = minetest.get_modpath(minetest.get_current_modname()) -local S, NS = dofile(MP.."/intllib.lua") +local S, NS, SS, SNS = dofile(MP.."/intllib.lua") local use_count = 0 @@ -26,3 +26,18 @@ minetest.register_craftitem("intltest:test", { minetest.chat_send_player(user:get_player_name(), message) end, }) + +minetest.log("action", "Testing SS method") +for _,lang in ipairs({nil, "es", "pt", "de"}) do + minetest.log("action", "("..dump(lang)..")"..SS(lang, "Test: @1 @2", SS(lang, "Green"), SS(lang, "Car"))) +end + +minetest.log("action", "Testing SNS method") +for n=1, 2 do + minetest.log("action", "(nil)"..SNS(nil, "Hello, @1 world!", "Hello, @1 worlds!", n, n)) +end +for _,lang in ipairs({"es", "pt", "de"}) do + for n=1, 2 do + minetest.log("action", "("..lang..")"..SNS(lang, "Hello, @1 world!", "Hello, @1 worlds!", n, n)) + end +end diff --git a/intltest/locale/de.po b/intltest/locale/de.po new file mode 100644 index 0000000..231953d --- /dev/null +++ b/intltest/locale/de.po @@ -0,0 +1,55 @@ +# I18N Test Mod. +# Copyright (C) 2013-2017 Diego Martínez +# This file is distributed under the same license as the intllib mod. +# Diego Martínez , 2013-2017. +# Diego Martnez , 2017. +# +msgid "" +msgstr "" +"Project-Id-Version: I18N Test Mod 0.1.0\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2017-07-16 11:41-0300\n" +"PO-Revision-Date: 2017-07-16 11:45-0300\n" +"Last-Translator: Diego Martnez \n" +"Language-Team: Spanish\n" +"Language: es\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" +"Plural-Forms: nplurals=2; plural=(n != 1);\n" +"X-Generator: Gtranslator 2.91.7\n" + +#: init.lua +msgid "Hello, world!" +msgstr "Hallo Welt!" + +#. Translators: @1 is color, @2 is object. +#: init.lua +msgid "Blue" +msgstr "Blau" + +#: init.lua +msgid "Car" +msgstr "Auto" + +#. Translators: @1 is color, @2 is object. +#: init.lua +msgid "Test: @1 @2" +msgstr "Test: @2 @1" + +#. Translators: @1 is use count. +#: init.lua +msgid "Item has been used @1 time." +msgid_plural "Item has been used @1 times." +msgstr[0] "" +msgstr[1] "" + +#: init.lua +msgid "Green" +msgstr "Grün" + +#: init.lua +msgid "Hello, @1 world!" +msgid_plural "Hello, @1 worlds!" +msgstr[0] "Hallo Welt!" +msgstr[1] "Hallo @1 Welten!" diff --git a/intltest/locale/es.po b/intltest/locale/es.po index cd51b8f..9552e1b 100644 --- a/intltest/locale/es.po +++ b/intltest/locale/es.po @@ -2,13 +2,14 @@ # Copyright (C) 2013-2017 Diego Martínez # This file is distributed under the same license as the intllib mod. # Diego Martínez , 2013-2017. +# Diego Martnez , 2017. # msgid "" msgstr "" "Project-Id-Version: I18N Test Mod 0.1.0\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2017-02-25 20:40-0300\n" -"PO-Revision-Date: 2017-01-23 17:36-0300\n" +"POT-Creation-Date: 2017-07-16 11:41-0300\n" +"PO-Revision-Date: 2017-07-16 11:45-0300\n" "Last-Translator: Diego Martnez \n" "Language-Team: Spanish\n" "Language: es\n" @@ -16,6 +17,7 @@ msgstr "" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" "Plural-Forms: nplurals=2; plural=(n != 1);\n" +"X-Generator: Gtranslator 2.91.7\n" #: init.lua msgid "Hello, world!" @@ -41,3 +43,13 @@ msgid "Item has been used @1 time." msgid_plural "Item has been used @1 times." msgstr[0] "El objeto ha sido usado @1 vez." msgstr[1] "El objeto ha sido usado @1 veces." + +#: init.lua +msgid "Green" +msgstr "Verde" + +#: init.lua +msgid "Hello, @1 world!" +msgid_plural "Hello, @1 worlds!" +msgstr[0] "¡Hola, mundo!" +msgstr[1] "¡Hola, @1 mundos!" diff --git a/intltest/locale/pt.po b/intltest/locale/pt.po new file mode 100644 index 0000000..94b1440 --- /dev/null +++ b/intltest/locale/pt.po @@ -0,0 +1,55 @@ +# I18N Test Mod. +# Copyright (C) 2013-2017 Diego Martínez +# This file is distributed under the same license as the intllib mod. +# Diego Martínez , 2013-2017. +# Diego Martnez , 2017. +# +msgid "" +msgstr "" +"Project-Id-Version: I18N Test Mod 0.1.0\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2017-07-16 11:41-0300\n" +"PO-Revision-Date: 2017-07-16 11:45-0300\n" +"Last-Translator: Diego Martnez \n" +"Language-Team: Spanish\n" +"Language: es\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" +"Plural-Forms: nplurals=2; plural=(n != 1);\n" +"X-Generator: Gtranslator 2.91.7\n" + +#: init.lua +msgid "Hello, world!" +msgstr "Ola, mundo!" + +#. Translators: @1 is color, @2 is object. +#: init.lua +msgid "Blue" +msgstr "Azul" + +#: init.lua +msgid "Car" +msgstr "Carro" + +#. Translators: @1 is color, @2 is object. +#: init.lua +msgid "Test: @1 @2" +msgstr "Teste: @2 @1" + +#. Translators: @1 is use count. +#: init.lua +msgid "Item has been used @1 time." +msgid_plural "Item has been used @1 times." +msgstr[0] "Esse objeto foi usado @1 vez." +msgstr[1] "Esse objeto foi usado @2 vezes." + +#: init.lua +msgid "Green" +msgstr "Verde" + +#: init.lua +msgid "Hello, @1 world!" +msgid_plural "Hello, @1 worlds!" +msgstr[0] "Ola, mundo!" +msgstr[1] "Ola, @1 mundos!" diff --git a/intltest/locale/template.pot b/intltest/locale/template.pot index 2090d61..a8f887b 100644 --- a/intltest/locale/template.pot +++ b/intltest/locale/template.pot @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: PACKAGE VERSION\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2017-02-25 20:40-0300\n" +"POT-Creation-Date: 2017-07-16 11:41-0300\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME \n" "Language-Team: LANGUAGE \n" @@ -42,3 +42,13 @@ msgid "Item has been used @1 time." msgid_plural "Item has been used @1 times." msgstr[0] "" msgstr[1] "" + +#: init.lua +msgid "Green" +msgstr "" + +#: init.lua +msgid "Hello, @1 world!" +msgid_plural "Hello, @1 worlds!" +msgstr[0] "" +msgstr[1] ""