[translate] Translated to Portuguse Language.

This commit is contained in:
Lunovox 2024-03-23 04:32:11 -03:00
parent 0cc7b87076
commit d1594296dc
7 changed files with 676 additions and 6 deletions

View file

@ -135,7 +135,7 @@ minetest.register_craftitem("components:engine_combustion", {
description = core.colorize("#00FF00",
modComponents.translate("Combustion Engine")
)
.."\n * "..modComponents.translate("Engine for producing torque from controlled explosions of fuel and oxygen inside a chamber."),
.."\n * "..modComponents.translate("Engine for producing torque from controlled @nexplosions of fuel and oxygen inside a chamber."),
inventory_image = "obj_engine_combustion_128.png",
})
--########################################################################################################################
@ -148,7 +148,7 @@ minetest.register_craftitem("components:engine_emdrive", {
description = core.colorize("#00FF00",
modComponents.translate("Emdrive Engine")
)
.."\n * "..modComponents.translate("Engine for producing impulse from an electromagnetic field within a cavity, without the need to eject mass."),
.."\n * "..modComponents.translate("Engine for producing impulse from an electromagnetic field @nwithin a cavity, without the need to eject mass."),
inventory_image = "obj_engine_emdrive_96.png",
})
--########################################################################################################################
@ -203,7 +203,7 @@ minetest.register_craftitem("components:computer", {
modComponents.translate("Computer")
)
.."\n * "..modComponents.translate(
"An embedded system is a microprocessor system in which the computer is completely encapsulated or dedicated to the device or system it controls."
"An embedded system is a microprocessor system in which @nthe computer is completely encapsulated or dedicated to @nthe device or system it controls."
),
inventory_image = "obj_computer_128.png",
})

104
locale/README.md Normal file
View file

@ -0,0 +1,104 @@
# TRANSLATES
Update: 2024-03-23
version of Readme: 1.7
-----
To generate file [template.pot], did use terminal command:
```bash
cd components
xgettext -n *.lua -L Lua --force-po --keyword=modComponents.translate --from-code=UTF-8 -o ./locale/template.pot
```
-----
### Generate file '.po' per [template.pot] file:
To translate [template.pot] to your language in '.po' file:
* Locales used: ca;cs;da;de;dv;eo;es;et;fr;hu;id;it;ja;jbo;kn;lt;ms;nb;nl;pl;pt;pt;ro;ru;sl;sr_Cyrl;sv;sw;tr;uk
Sintaxe:
```bash
$ msginit --no-translator --no-wrap --locale=$LANG.UTF-8 --output-file=$LANG.po --input=$POT
```
* Example to brazilian portuguese language: [locale/pt.po]
Example:
```bash
msginit --no-translator --no-wrap --locale=pt.UTF-8 --output-file=./locale/pt.po --input=./locale/template.pot
```
-----
### To Update ".po" file from a [template.pot] file.
Sintaxe:
```bash
$ msgmerge --sort-output --no-wrap --update --backup=off $LANG.po $POT
```
* Example to brazilian portuguese language: [locale/pt.po]
Example:
```bash
msgmerge --sort-output --no-wrap --update --backup=off ./locale/pt.po ./locale/template.pot
```
-----
To translate [template.pot] to your language use GUI App [PoEdit].:
### Install the PoEdit:
```bash
sudo apt-get install poedit
```
-----
### Convert '.po' file to '.tr' file.
Translate Sample: [locale/components.pt.tr]
```bash
cd ./locale/
lua5.3 po2tr.lua "components" "pt.po"
mv "pt.tr" "components.pt.tr"
```
-----
### Exemple of enable the portuguese language in minetest:
Translate Sample: `locale/components.pt.tr`
To enable the translate to brazilian portuguese language, write "language = pt" in file "minetest.conf". Or write the command ```/set -n language pt``` in game chat, and run again the minetest game.
-----
### PLEASE SUBMIT YOUR NEW TRANSLATION TO THE DEVELOPERS OF THIS MOD THROUGH THE GIT PROJECT BELOW:
* `https://gitlab.com/lunovox/components`
----
> See more:
* https://forum.minetest.net/viewtopic.php?f=47&t=21974
* https://github.com/minetest/minetest/issues/8158
* https://gist.githubusercontent.com/mamchenkov/3690981/raw/8ebd48c2af20c893c164e8d5245d9450ad682104/update_translations.sh
* https://gitlab.com/4w/xtend/-/blob/master/xtend_default/tools/convert_po_file_to_tr_file/convert_po_file_to_tr_file.lua
[locale/pt.po]:https://gitlab.com/lunovox/components/-/raw/master/locale/pt.po
[locale/components.pt.tr]:https://gitlab.com/lunovox/components/-/raw/master/locale/components.pt.tr
[PoEdit]:https://poedit.net
[template.pot]:https://gitlab.com/lunovox/components/-/raw/master/locale/template.pot

46
locale/components.pt.tr Normal file
View file

@ -0,0 +1,46 @@
# textdomain: components
An embedded system is a microprocessor system in which @nthe computer is completely encapsulated or dedicated to @nthe device or system it controls.=Um sistema embarcado é um sistema microprocessado no qual @no computador está completamente encapsulado ou dedicado ao @ndispositivo ou sistema que ele controla.
Balloon (for Dirigible)=Balão (para Dirigível)
Batery (Type D)=Bateria (Tipo D)
Bioplastic Ingot=Lingote Bioplástico
Bioplastic Mass=Massa Bioplática
Bioresin=Bioresina
Capacitor=Capacitor
Cockpit=Cabine
Combustion Engine=Motor de Combustão
Computer=Computador
Copper Coil=Bobina de Cobre
Copper Wire=Cabo de Cobre
Cylinder=Cilindro
DNA Checker=Verificador de DNA
Electrical Resistance=Resistência Elétrica
Eletric Lamp=Lâmpada Elétricq
Eletric Pump=Bombeadora Elétrica
Emdrive Engine=Motor Emdrive
Engine for producing impulse from an electromagnetic field @nwithin a cavity, without the need to eject mass.=Motor para produzir impulso a partir de um campo eletromagnético @ndentro de uma cavidade, sem a necessidade de ejetar massa.
Engine for producing torque from controlled @nexplosions of fuel and oxygen inside a chamber.=Motor para produzir torque controlando @nexplosões de combustível e oxigênio dentro de uma câmara.
Extracted from pine wood.=Extraido do tronco de pinheiro.
Fuel Storage (50 liters)=Armazenamento de Combustível (50 litros)
Gauge=Aferidor
Gold Wire=Cabo de Ouro
Helice (4 blades)=Hélice (4 lâminas)
It allows an electronic device to check its owner.=Permite que um dispositivo eletrônico verifique seu proprietário.
Microprocessor=Microprocessador
Microwave Resonance Chamber=Câmara de Ressonância de Microondas
Oxigen System=Sistema de Oxigênio
Panel=Painel
Pilot Manche=Controle do Piloto
Pink Quartzo Crystal=Cristal de Quartzo Rosa
Power Cell (Type Omega)=Célula de Energia (Tipo Omega)
Printed Circuit=Circuito Impresso
RAM Memory=Memória RAM
Speaker=Autofalante
Steel Core=Carretel de Aço
Steel Pipe=Cano de Aço
Steel Ring=Anel de Aço
Steel Spiral=Espiral de Aço
Steel Wire=Cabo de Aço
Switch Button=Botão de Estado
Toroidal Copper Coil=Bobina Toroidal de Cobre
Transistor=Transistor
Upholstered Chair=Cadeira Estofada

116
locale/po2tr.lua Normal file
View file

@ -0,0 +1,116 @@
#!/usr/bin/env luajit
-- Convert regular Gettext PO files to Minetest-specific TR files. If there is
-- already a TR file with the same name of the PO file except the file suffix
-- bneing .tr (or .TR) instead of .po (or .PO) then THIS FILE WILL BE
-- OVERWRITTEN WITHOUT INFORMATION OR A WAY TO RECOVER THE PREVIOUS FILE!
--
--
-- ▄██▄
-- ▀███
-- █
-- ▄▄▄▄▄ █
-- ▀▄ ▀▄ █ BACKUP
-- ▄▀▀▀▄ █▄▄▄▄█▄▄ ▄▀▀▀▄ █
-- █ ▄ █ █ ▄ █ █
-- ▀▄ ▄▀ ▀▄ ▄▀ █
-- █▀▀▀ ▀▀▀ █ █
-- █ █ █ ALL
-- ▄▀▄▄▀▄ █ ▄█▀█▀█▀█▀█▀█▄ █ █
-- █▒▒▒▒█ █ █████████████▄ █ █
-- █▒▒▒▒█ █ ██████████████▄ █ █
-- █▒▒▒▒█ █ ██████████████▄ █ █
-- █▒▒▒▒█ █ ██████████████ █ █
-- █▒▒▒▒█ █ ██████████████▀ █ █ THE
-- █▒▒▒▒█ ██ ██████████████ █ █
-- ▀████▀ ██▀█ █████████████▀ █▄█
-- ██ ██ ▀█ █▄█▄█▄█▄█▄█▀ ▄█▀
-- ██ ██ ▀█ ▄▀▓█
-- ██ ██ ▀█▀▄▄▄▄▄▄▄▄▄▀▀▓▓▓█
-- ████ █▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓█
-- ███ █▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓█ THINGS
-- ██ █▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓█
-- ██ █▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓█
-- ██ ▐█▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓█
-- ██ ▐█▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓█
-- ██ ▐█▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓█▌ !!!
-- ██ ▐█▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓█▌
-- ██ ▐█▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓█▌
-- ██ ▐█▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓█▌
--
--
-- The syntax of TR files according to the introducing forum post is:
--
-- # textdomain: namespace
-- original 1 = translation 1
-- original 2 = translation 2
-- original 3 = tralslation 3
-- original N = translation N
--
-- Where namespace should be the name of the mod. Following strings have to be
-- escaped using @.
--
-- String | Escape
-- -------+--------
-- `@` |`@@`
-- `=` |`@=`
-- `\n` |`@\n`
--
-- See https://forum.minetest.net/viewtopic.php?t=18349 for details.
-- Preparation
if arg[1] == nil or arg[2] == nil then
print('Provide the namesspace as first parameter')
print('Provide the path to the source PO file as second parameter')
print('Example: '..arg[0]..' mymod path/to/my/source.po')
return
end
local SEP = package.path:match('(%p)%?%.') or '/' -- wonky but hey ... :)
-- Assign parameters to local variables
local namespace = arg[1]
local po_file = arg[2]
local tr_file = arg[2]:gsub('po$', 'tr'):gsub('PO$', 'TR')
-- Get the translations through crude plaintext file parsing
local file_contents = {}
local translations = {}
local po_file_handle = io.open(po_file, 'rb')
if po_file_handle == nil then print('No base file found') return end
for line in po_file_handle:lines() do
if line:match('^msgid') or line:match('^msgstr') then
table.insert(file_contents, line)
end
end
local escape_string = function (s)
s = s:gsub('@([^%d])', '@@%1') -- All @ not followed by a number become @@
s = s:gsub('([^@]@)$', '%1@') -- An @ at the end of the string become @@
s = s:gsub('=', '@=') -- All = become @=
return s
end
for number,line_content in pairs(file_contents) do
if line_content:match('^msgid') then
local o = line_content:gsub('^msgid "(.+)"$', '%1')
local t = file_contents[number + 1]:gsub('^msgstr "(.+)"$', '%1')
if o ~= 'msgid = ""' and t ~= 'msgstr ""' then
table.insert(translations, escape_string(o)..'='..escape_string(t))
end
end
end
print(number)
po_file_handle:close()
-- Write translation to file
local tr_file_handle = io.open(tr_file, 'w+')
if tr_file_handle == nil then print('Could not open target file') return end
tr_file_handle:write('# textdomain: '..namespace, "\n")
for _,line in pairs(translations) do tr_file_handle:write(line, "\n") end
tr_file_handle:close()

200
locale/pt.po Normal file
View file

@ -0,0 +1,200 @@
# Portuguese translations for PACKAGE package.
# Copyright (C) 2024 THE PACKAGE'S COPYRIGHT HOLDER
# This file is distributed under the same license as the PACKAGE package.
# Automatically generated, 2024.
#
msgid ""
msgstr ""
"Project-Id-Version: PACKAGE VERSION\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2024-03-23 04:04-0300\n"
"PO-Revision-Date: 2024-03-23 03:32-0300\n"
"Last-Translator: Automatically generated\n"
"Language-Team: Lunovox Heavenfinder\n"
"Language: pt\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"
#: components_objects.lua:206
msgid "An embedded system is a microprocessor system in which @nthe computer is completely encapsulated or dedicated to @nthe device or system it controls."
msgstr "Um sistema embarcado é um sistema microprocessado no qual @no computador está completamente encapsulado ou dedicado ao @ndispositivo ou sistema que ele controla."
#: components_objects.lua:120
msgid "Balloon (for Dirigible)"
msgstr "Balão (para Dirigível)"
#: components_objects.lua:171
msgid "Batery (Type D)"
msgstr "Bateria (Tipo D)"
#: components_objects.lua:70
msgid "Bioplastic Ingot"
msgstr "Lingote Bioplástico"
#: components_objects.lua:65
msgid "Bioplastic Mass"
msgstr "Massa Bioplática"
#: components_objects.lua:58
msgid "Bioresin"
msgstr "Bioresina"
#: components_objects.lua:181
msgid "Capacitor"
msgstr "Capacitor"
#: components_objects.lua:156
msgid "Cockpit"
msgstr "Cabine"
#: components_objects.lua:136
msgid "Combustion Engine"
msgstr "Motor de Combustão"
#: components_objects.lua:203
msgid "Computer"
msgstr "Computador"
#: components_objects.lua:47
msgid "Copper Coil"
msgstr "Bobina de Cobre"
#: components_objects.lua:7
msgid "Copper Wire"
msgstr "Cabo de Cobre"
#: components_objects.lua:32
msgid "Cylinder"
msgstr "Cilindro"
#: components_objects.lua:191 components_objects.lua:193
msgid "DNA Checker"
msgstr "Verificador de DNA"
#: components_objects.lua:176
msgid "Electrical Resistance"
msgstr "Resistência Elétrica"
#: components_objects.lua:22
msgid "Eletric Lamp"
msgstr "Lâmpada Elétricq"
#: components_objects.lua:52
msgid "Eletric Pump"
msgstr "Bombeadora Elétrica"
#: components_objects.lua:149
msgid "Emdrive Engine"
msgstr "Motor Emdrive"
#: components_objects.lua:151
#, fuzzy
msgid "Engine for producing impulse from an electromagnetic field @nwithin a cavity, without the need to eject mass."
msgstr "Motor para produzir impulso a partir de um campo eletromagnético @ndentro de uma cavidade, sem a necessidade de ejetar massa."
#: components_objects.lua:138
#, fuzzy
msgid "Engine for producing torque from controlled @nexplosions of fuel and oxygen inside a chamber."
msgstr "Motor para produzir torque controlando @nexplosões de combustível e oxigênio dentro de uma câmara."
#: components_objects.lua:60
msgid "Extracted from pine wood."
msgstr "Extraido do tronco de pinheiro."
#: components_objects.lua:130
msgid "Fuel Storage (50 liters)"
msgstr "Armazenamento de Combustível (50 litros)"
#: components_objects.lua:27
msgid "Gauge"
msgstr "Aferidor"
#: components_objects.lua:12
msgid "Gold Wire"
msgstr "Cabo de Ouro"
#: components_objects.lua:125
msgid "Helice (4 blades)"
msgstr "Hélice (4 lâminas)"
#: components_objects.lua:196
msgid "It allows an electronic device to check its owner."
msgstr "Permite que um dispositivo eletrônico verifique seu proprietário."
#: components_objects.lua:161
msgid "Microprocessor"
msgstr "Microprocessador"
#: components_objects.lua:143
msgid "Microwave Resonance Chamber"
msgstr "Câmara de Ressonância de Microondas"
#: components_objects.lua:85
msgid "Oxigen System"
msgstr "Sistema de Oxigênio"
#: components_objects.lua:95
msgid "Panel"
msgstr "Painel"
#: components_objects.lua:100
msgid "Pilot Manche"
msgstr "Controle do Piloto"
#: components_objects.lua:212
msgid "Pink Quartzo Crystal"
msgstr "Cristal de Quartzo Rosa"
#: components_objects.lua:166
msgid "Power Cell (Type Omega)"
msgstr "Célula de Energia (Tipo Omega)"
#: components_objects.lua:80
msgid "Printed Circuit"
msgstr "Circuito Impresso"
#: components_objects.lua:186
msgid "RAM Memory"
msgstr "Memória RAM"
#: components_objects.lua:75
msgid "Speaker"
msgstr "Autofalante"
#: components_objects.lua:42
msgid "Steel Core"
msgstr "Carretel de Aço"
#: components_objects.lua:37
msgid "Steel Pipe"
msgstr "Cano de Aço"
#: components_objects.lua:110
msgid "Steel Ring"
msgstr "Anel de Aço"
#: components_objects.lua:17
msgid "Steel Spiral"
msgstr "Espiral de Aço"
#: components_objects.lua:2
msgid "Steel Wire"
msgstr "Cabo de Aço"
#: components_objects.lua:90
msgid "Switch Button"
msgstr "Botão de Estado"
#: components_objects.lua:115
msgid "Toroidal Copper Coil"
msgstr "Bobina Toroidal de Cobre"
#: components_objects.lua:217
msgid "Transistor"
msgstr "Transistor"
#: components_objects.lua:105
msgid "Upholstered Chair"
msgstr "Cadeira Estofada"

204
locale/template.pot Normal file
View file

@ -0,0 +1,204 @@
# 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 <EMAIL@ADDRESS>, YEAR.
#
#, fuzzy
msgid ""
msgstr ""
"Project-Id-Version: PACKAGE VERSION\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2024-03-23 04:13-0300\n"
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
"Language-Team: LANGUAGE <LL@li.org>\n"
"Language: \n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=CHARSET\n"
"Content-Transfer-Encoding: 8bit\n"
#: components_objects.lua:2
msgid "Steel Wire"
msgstr ""
#: components_objects.lua:7
msgid "Copper Wire"
msgstr ""
#: components_objects.lua:12
msgid "Gold Wire"
msgstr ""
#: components_objects.lua:17
msgid "Steel Spiral"
msgstr ""
#: components_objects.lua:22
msgid "Eletric Lamp"
msgstr ""
#: components_objects.lua:27
msgid "Gauge"
msgstr ""
#: components_objects.lua:32
msgid "Cylinder"
msgstr ""
#: components_objects.lua:37
msgid "Steel Pipe"
msgstr ""
#: components_objects.lua:42
msgid "Steel Core"
msgstr ""
#: components_objects.lua:47
msgid "Copper Coil"
msgstr ""
#: components_objects.lua:52
msgid "Eletric Pump"
msgstr ""
#: components_objects.lua:58
msgid "Bioresin"
msgstr ""
#: components_objects.lua:60
msgid "Extracted from pine wood."
msgstr ""
#: components_objects.lua:65
msgid "Bioplastic Mass"
msgstr ""
#: components_objects.lua:70
msgid "Bioplastic Ingot"
msgstr ""
#: components_objects.lua:75
msgid "Speaker"
msgstr ""
#: components_objects.lua:80
msgid "Printed Circuit"
msgstr ""
#: components_objects.lua:85
msgid "Oxigen System"
msgstr ""
#: components_objects.lua:90
msgid "Switch Button"
msgstr ""
#: components_objects.lua:95
msgid "Panel"
msgstr ""
#: components_objects.lua:100
msgid "Pilot Manche"
msgstr ""
#: components_objects.lua:105
msgid "Upholstered Chair"
msgstr ""
#: components_objects.lua:110
msgid "Steel Ring"
msgstr ""
#: components_objects.lua:115
msgid "Toroidal Copper Coil"
msgstr ""
#: components_objects.lua:120
msgid "Balloon (for Dirigible)"
msgstr ""
#: components_objects.lua:125
msgid "Helice (4 blades)"
msgstr ""
#: components_objects.lua:130
msgid "Fuel Storage (50 liters)"
msgstr ""
#: components_objects.lua:136
msgid "Combustion Engine"
msgstr ""
#: components_objects.lua:138
msgid ""
"Engine for producing torque from controlled @nexplosions of fuel and oxygen "
"inside a chamber."
msgstr ""
#: components_objects.lua:143
msgid "Microwave Resonance Chamber"
msgstr ""
#: components_objects.lua:149
msgid "Emdrive Engine"
msgstr ""
#: components_objects.lua:151
msgid ""
"Engine for producing impulse from an electromagnetic field @nwithin a "
"cavity, without the need to eject mass."
msgstr ""
#: components_objects.lua:156
msgid "Cockpit"
msgstr ""
#: components_objects.lua:161
msgid "Microprocessor"
msgstr ""
#: components_objects.lua:166
msgid "Power Cell (Type Omega)"
msgstr ""
#: components_objects.lua:171
msgid "Batery (Type D)"
msgstr ""
#: components_objects.lua:176
msgid "Electrical Resistance"
msgstr ""
#: components_objects.lua:181
msgid "Capacitor"
msgstr ""
#: components_objects.lua:186
msgid "RAM Memory"
msgstr ""
#: components_objects.lua:191 components_objects.lua:193
msgid "DNA Checker"
msgstr ""
#: components_objects.lua:196
msgid "It allows an electronic device to check its owner."
msgstr ""
#: components_objects.lua:203
msgid "Computer"
msgstr ""
#: components_objects.lua:206
msgid ""
"An embedded system is a microprocessor system in which @nthe computer is "
"completely encapsulated or dedicated to @nthe device or system it controls."
msgstr ""
#: components_objects.lua:212
msgid "Pink Quartzo Crystal"
msgstr ""
#: components_objects.lua:217
msgid "Transistor"
msgstr ""

View file

@ -1,8 +1,6 @@
local ngettext
if minetest.get_translator ~= nil and minetest.get_current_modname ~= nil and minetest.get_modpath(minetest.get_current_modname()) then
modComponents.translate = minetest.get_translator(minetest.get_current_modname())
elseif minetest.get_modpath("intllib") then
if minetest.get_modpath("intllib") then
if intllib.make_gettext_pair then
-- New method using gettext.
modComponents.translate, ngettext = intllib.make_gettext_pair()
@ -10,6 +8,8 @@ elseif minetest.get_modpath("intllib") then
-- Old method using text files.
modComponents.translate = intllib.Getter()
end
elseif minetest.get_translator ~= nil and minetest.get_current_modname ~= nil and minetest.get_modpath(minetest.get_current_modname()) then
modComponents.translate = minetest.get_translator(minetest.get_current_modname())
else
modComponents.translate = function(s) return s end
end