Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Move to MT 5.0.0+ translation system #255

Merged
merged 12 commits into from
Jan 7, 2022

Conversation

nixnoxus
Copy link
Contributor

@nixnoxus nixnoxus commented Dec 9, 2021

With this PR the translations work.

Tested with minetest-5.4.1

Related to #104

@S-S-X
Copy link
Member

S-S-X commented Dec 10, 2021

Sure about that engine version? 🤣
But one thing, there was non breaking spaces added for reason: to not break line at that point keeping power indicators sane.
That most probably should not be changed (font and screen size affects actual outcome).

assert(technic.pretty_num(-0) == "0 ")
assert(technic.pretty_num(0) == "0 ")
assert(technic.pretty_num(1234) == "1234 ")
assert(technic.pretty_num(123456789) == "123.5 M")
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I mean this should not be changed not even with extensive manual testing, nbsp and regular space are very different things and that's also why assertion tests were originally added.

Copy link
Contributor Author

@nixnoxus nixnoxus Dec 10, 2021

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

okay, sorry i will restore this.
I assumed that these were unintentional.

At this point too: https://github.com/mt-mods/technic/pull/255/files#diff-e385a425c8d367cc288be10c5cc80941966405fd86bf435a1b95a6206b74520fL657-R657 ?

^ I mean technic/machines/network.lua:657 "@1. Supply: @2 Demand: @3"

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

non-breaking spaces restored here dbb7798

@@ -654,7 +654,7 @@ function technic.network_run(network_id)
end
--dprint("Total RE demand:"..RE_eu_demand)

technic.network_infotext(network_id, S("@1. Supply: @2 Demand: @3",
technic.network_infotext(network_id, S("@1. Supply: @2 Demand: @3",
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Answering to https://github.com/mt-mods/technic/pull/255/files#r766267806
Yes here it is also intentional to use non breaking space, I think not as important but better than without.
Space positions are correct to keep "Supply:" together with its amount and similar for "Demand:" to display it correctly with all screen size and font variations.
Normal space between "Supply: @2" and "Demand: @3" is also correct because that's part where possible line breaks should happen, same for first normal space.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

non-breaking spaces restored here dbb7798

@BuckarooBanzay
Copy link
Member

fyi: the mineunit tests are successful:

5 successes / 0 failures / 0 errors / 0 pending : 0.033019 seconds

@nixnoxus
Copy link
Contributor Author

FYI: I converted and updated the locale/ directory with https://github.com/nixnoxus/minetest_hacks/blob/main/bin/update-locale.sh

There is already a script for updating locale: https://github.com/minetest-tools/update_translations
But it removes comments at the beginning (from the translators) and destroys the structure.

Some strings are put together at runtime :(

Lead=
Acacia=
Rubber Tree=
Sulfur=
Stone=
Chernobylite=
Common Tree=

These cannot be recognized by xgettext or regex.
In order to capture them anyway, I used this hack: nixnoxus/minetest_hacks@f8eafd9

@BuckarooBanzay
Copy link
Member

pulled this into the test-server (test.pandorabox.io / use /sudo to the the priv of privs) and didn't find any problems.
LGTM 👍

@OgelGames
Copy link
Contributor

Two things to check before merging this:

  • Are there any strings that are not translated? (i.e. missing S( ))
  • Can any missing translations be copied from the minetest-mods PR?

@nixnoxus
Copy link
Contributor Author

Two things to check before merging this:

* [ ]  Are there any strings that are not translated? (i.e. missing `S( )`)

There are certainly still one or more places in the code.
Critical are such places where the description or infotext are built dynamically with variables (see my comment above).
An example is:

description = S("%s Grinding"):format(S(name)),

I also tested the following:

~/minetest.git/mods/technic$ sed -i 's/^\([^=]\+\)=.*$/\1/;tn;bx;:n;h;s/\<\(\S\)\(\S*\)\>/\L\1\U\2/g;s/@[1-9]/<&>/g;H;x;s/\n/=/;:x' */locale/*.de.tr
~/minetest.git/mods/technic$ git status
On branch mt5_translation
Your branch is up to date with 'origin/mt5_translation'.

Changes not staged for commit:
  (use "git add <file>..." to update what will be committed)
  (use "git restore <file>..." to discard changes in working directory)
        modified:   concrete/locale/concrete.de.tr
        modified:   extranodes/locale/extranodes.de.tr
        modified:   technic/locale/technic.de.tr
        modified:   technic_chests/locale/technic_chests.de.tr
        modified:   technic_cnc/locale/technic_cnc.de.tr
        modified:   technic_worldgen/locale/technic_worldgen.de.tr
        modified:   wrench/locale/wrench.de.tr

no changes added to commit (use "git add" and/or "git commit -a")

this sed script does something like this:

diff --git a/wrench/locale/wrench.de.tr b/wrench/locale/wrench.de.tr
index 1044bec..8c95890 100644
--- a/wrench/locale/wrench.de.tr
+++ b/wrench/locale/wrench.de.tr
@@ -4,11 +4,11 @@
 # Deutsche Übersetzung von technic_wrench
 # by Xanthin
 
-Wrench=Schraubenschluessel
-@1 with items=@1 mit Gegenstaenden
+Wrench=wRENCH
+@1 with items=<@1> wITH iTEMS
 
-Cannot pickup node. Owned by @1.=
-Not enough room in inventory to pickup node.=
-Cannot pickup node containing @1.=
-Cannot pickup node. Nesting inventories is not allowed.=
-Cannot pickup node. Node contains too much metadata.=
+Cannot pickup node. Owned by @1.=cANNOT pICKUP nODE. oWNED bY <@1>.
+Not enough room in inventory to pickup node.=nOT eNOUGH rOOM iN iNVENTORY tO pICKUP nODE.
+Cannot pickup node containing @1.=cANNOT pICKUP nODE cONTAINING <@1>.
+Cannot pickup node. Nesting inventories is not allowed.=cANNOT pICKUP nODE. nESTING iNVENTORIES iS nOT aLLOWED.
+Cannot pickup node. Node contains too much metadata.=cANNOT pICKUP nODE. nODE cONTAINS tOO mUCH mETADATA.

With this I did not detect any missing tRANSLATIONS in the unified_inventory.

* [ ]  Can any missing translations be copied from the `minetest-mods` PR?

This PR fixes only the translations for MT5+. Smaller issues are fixed.

I think that more TODOs should be added to #104

@S-S-X
Copy link
Member

S-S-X commented Dec 16, 2021

This PR fixes only the translations for MT5+. Smaller issues are fixed.

I think this is good, missing translations can be added through another PR and better that way than trying to do everything through single PR.
Also makes it more clear in history: this would not change actual delivered content, just refactor / modernize it.
No manual rebasing/squashing commits for this PR if whole thing can be just squashed into single commit.

IMO better to not include new translations / text updates and so on but make another PR for those after this one is merged.

@S-S-X
Copy link
Member

S-S-X commented Dec 16, 2021

But should contents be checked against old translations (with actual mt engine) to verify that there's no (accidental/unintentional) changes in actual translated/base content?

@nixnoxus
Copy link
Contributor Author

nixnoxus commented Dec 16, 2021

But should contents be checked against old translations (with actual mt engine) to verify that there's no (accidental/unintentional) changes in actual translated/base content?

I do not fully understand the question, sorry. But try to answer it anyway:

  • the old translations were only converted. (spaces before = removed,%d, %f, %s replaced by @1 ..@9)
  • I was able to add some German translations

@S-S-X
Copy link
Member

S-S-X commented Dec 16, 2021

What I mean is simply semi automatic testing for end results before and after changes (loop through all languages):

  1. Translate everything using current master branch and throw it into set of flat files (or just single file).
  2. Translate everything using this upgrade branch and throw it into set of flat files (or just single file).
  3. Sort if needed, take diff and see if anything changed. Decide if changes are appropriate for this PR.

This can simply used to verify that all translations works similar way (using actual minetest engine and lua implementation) how those worked before this PR.
This assumes that previous translation system was not completely broken.

@nixnoxus
Copy link
Contributor Author

With the master branch the translation doesn't work for me (minetest-5.4.1) at all. Not even with the current `intllib 'mod.

@nixnoxus
Copy link
Contributor Author

master in ~/minetest.git/mods/.technic.mt-mods

~/minetest.git/mods/.technic.mt-mods$ git status -v
On branch master
Your branch is up to date with 'origin/master'.

nothing to commit, working tree clean
~/minetest.git/mods/.technic.mt-mods$ git remote -v
origin	https://github.com/mt-mods/technic (fetch)
origin	https://github.com/mt-mods/technic (push)

mt5_translation in ~/minetest.git/mods/.technic.nixnoxus

~/minetest.git/mods/.technic.nixnoxus$ git status -v
On branch mt5_translation
Your branch is up to date with 'origin/mt5_translation'.

nothing to commit, working tree clean
~/minetest.git/mods/.technic.nixnoxus$ git remote -v
origin	git@github.com:nixnoxus/technic.git (fetch)
origin	git@github.com:nixnoxus/technic.git (push)

diff:

~/minetest.git/mods$ for dst in .technic.nixnoxus/*/locale/*.??{,_??}.tr;do src="$(echo "$dst"|sed 's@^[^/]\+\(/[^/]\+/locale/\)[^\.]\+\.\([^\.]\+\)\.tr@.technic.mt-mods/\1\2.txt@')"; echo " $src vs. $dst"; diff -w -U0 <(sed 's/\(%[dfs]\|@[1-9]\)/XX/g' "$src"|grep -av '=$') <(sed 's/@[1-9]/XX/g' "$dst"|grep -av '=$');done
 .technic.mt-mods//concrete/locale/de.txt vs. .technic.nixnoxus/concrete/locale/concrete.de.tr
--- /dev/fd/63	2021-12-16 19:37:23.121165278 +0100
+++ /dev/fd/62	2021-12-16 19:37:23.121165278 +0100
@@ -0,0 +1,2 @@
+# textdomain: concrete
+
 .technic.mt-mods//concrete/locale/es.txt vs. .technic.nixnoxus/concrete/locale/concrete.es.tr
--- /dev/fd/63	2021-12-16 19:37:23.133165007 +0100
+++ /dev/fd/62	2021-12-16 19:37:23.133165007 +0100
@@ -0,0 +1,2 @@
+# textdomain: concrete
+
 .technic.mt-mods//concrete/locale/fr.txt vs. .technic.nixnoxus/concrete/locale/concrete.fr.tr
--- /dev/fd/63	2021-12-16 19:37:23.145164736 +0100
+++ /dev/fd/62	2021-12-16 19:37:23.145164736 +0100
@@ -0,0 +1,2 @@
+# textdomain: concrete
+
 .technic.mt-mods//concrete/locale/pl.txt vs. .technic.nixnoxus/concrete/locale/concrete.pl.tr
--- /dev/fd/63	2021-12-16 19:37:23.157164466 +0100
+++ /dev/fd/62	2021-12-16 19:37:23.157164466 +0100
@@ -0,0 +1,2 @@
+# textdomain: concrete
+
 .technic.mt-mods//concrete/locale/tr.txt vs. .technic.nixnoxus/concrete/locale/concrete.tr.tr
--- /dev/fd/63	2021-12-16 19:37:23.169164195 +0100
+++ /dev/fd/62	2021-12-16 19:37:23.173164105 +0100
@@ -0,0 +1,2 @@
+# textdomain: concrete
+
 .technic.mt-mods//extranodes/locale/de.txt vs. .technic.nixnoxus/extranodes/locale/extranodes.de.tr
--- /dev/fd/63	2021-12-16 19:37:23.185163835 +0100
+++ /dev/fd/62	2021-12-16 19:37:23.185163835 +0100
@@ -0,0 +1,2 @@
+# textdomain: extranodes
+
 .technic.mt-mods//extranodes/locale/es.txt vs. .technic.nixnoxus/extranodes/locale/extranodes.es.tr
--- /dev/fd/63	2021-12-16 19:37:23.201163473 +0100
+++ /dev/fd/62	2021-12-16 19:37:23.201163473 +0100
@@ -0,0 +1,2 @@
+# textdomain: extranodes
+
 .technic.mt-mods//extranodes/locale/fr.txt vs. .technic.nixnoxus/extranodes/locale/extranodes.fr.tr
--- /dev/fd/63	2021-12-16 19:37:23.213163203 +0100
+++ /dev/fd/62	2021-12-16 19:37:23.213163203 +0100
@@ -0,0 +1,2 @@
+# textdomain: extranodes
+
 .technic.mt-mods//extranodes/locale/pl.txt vs. .technic.nixnoxus/extranodes/locale/extranodes.pl.tr
--- /dev/fd/63	2021-12-16 19:37:23.225162932 +0100
+++ /dev/fd/62	2021-12-16 19:37:23.225162932 +0100
@@ -0,0 +1,2 @@
+# textdomain: extranodes
+
 .technic.mt-mods//extranodes/locale/tr.txt vs. .technic.nixnoxus/extranodes/locale/extranodes.tr.tr
--- /dev/fd/63	2021-12-16 19:37:23.237162662 +0100
+++ /dev/fd/62	2021-12-16 19:37:23.237162662 +0100
@@ -0,0 +1,2 @@
+# textdomain: extranodes
+
 .technic.mt-mods//technic_chests/locale/de.txt vs. .technic.nixnoxus/technic_chests/locale/technic_chests.de.tr
--- /dev/fd/63	2021-12-16 19:37:23.249162392 +0100
+++ /dev/fd/62	2021-12-16 19:37:23.249162392 +0100
@@ -0,0 +1,2 @@
+# textdomain: technic_chests
+
 .technic.mt-mods//technic_chests/locale/es.txt vs. .technic.nixnoxus/technic_chests/locale/technic_chests.es.tr
--- /dev/fd/63	2021-12-16 19:37:23.261162121 +0100
+++ /dev/fd/62	2021-12-16 19:37:23.261162121 +0100
@@ -0,0 +1,2 @@
+# textdomain: technic_chests
+
 .technic.mt-mods//technic_chests/locale/fr.txt vs. .technic.nixnoxus/technic_chests/locale/technic_chests.fr.tr
--- /dev/fd/63	2021-12-16 19:37:23.273161851 +0100
+++ /dev/fd/62	2021-12-16 19:37:23.277161760 +0100
@@ -0,0 +1,2 @@
+# textdomain: technic_chests
+
 .technic.mt-mods//technic_chests/locale/pl.txt vs. .technic.nixnoxus/technic_chests/locale/technic_chests.pl.tr
--- /dev/fd/63	2021-12-16 19:37:23.289161489 +0100
+++ /dev/fd/62	2021-12-16 19:37:23.289161489 +0100
@@ -0,0 +1,2 @@
+# textdomain: technic_chests
+
 .technic.mt-mods//technic_chests/locale/tr.txt vs. .technic.nixnoxus/technic_chests/locale/technic_chests.tr.tr
--- /dev/fd/63	2021-12-16 19:37:23.297161309 +0100
+++ /dev/fd/62	2021-12-16 19:37:23.301161219 +0100
@@ -0,0 +1,2 @@
+# textdomain: technic_chests
+
 .technic.mt-mods//technic_cnc/locale/de.txt vs. .technic.nixnoxus/technic_cnc/locale/technic_cnc.de.tr
--- /dev/fd/63	2021-12-16 19:37:23.309161039 +0100
+++ /dev/fd/62	2021-12-16 19:37:23.309161039 +0100
@@ -0,0 +1,2 @@
+# textdomain: technic_cnc
+
 .technic.mt-mods//technic_cnc/locale/es.txt vs. .technic.nixnoxus/technic_cnc/locale/technic_cnc.es.tr
--- /dev/fd/63	2021-12-16 19:37:23.321160768 +0100
+++ /dev/fd/62	2021-12-16 19:37:23.321160768 +0100
@@ -0,0 +1,2 @@
+# textdomain: technic_cnc
+
 .technic.mt-mods//technic_cnc/locale/it.txt vs. .technic.nixnoxus/technic_cnc/locale/technic_cnc.it.tr
--- /dev/fd/63	2021-12-16 19:37:23.333160497 +0100
+++ /dev/fd/62	2021-12-16 19:37:23.333160497 +0100
@@ -0,0 +1,2 @@
+# textdomain: technic_cnc
+
 .technic.mt-mods//technic_cnc/locale/pl.txt vs. .technic.nixnoxus/technic_cnc/locale/technic_cnc.pl.tr
--- /dev/fd/63	2021-12-16 19:37:23.349160137 +0100
+++ /dev/fd/62	2021-12-16 19:37:23.349160137 +0100
@@ -0,0 +1,2 @@
+# textdomain: technic_cnc
+
 .technic.mt-mods//technic/locale/de.txt vs. .technic.nixnoxus/technic/locale/technic.de.tr
--- /dev/fd/63	2021-12-16 19:37:23.361159867 +0100
+++ /dev/fd/62	2021-12-16 19:37:23.361159867 +0100
@@ -0,0 +1,2 @@
+# textdomain: technic
+
@@ -39,0 +42 @@
+XX Enabled=XX ist eingechaltet
@@ -102 +105 @@
-Production at XX%% = Produktion bei XX%%
+Production at XX%=Produktion bei XX%
@@ -147,0 +151,20 @@
+Power Monitor=Leistungsmonitor
+Power Monitor. Supply: XX Demand: XX=Leistungsmonitor. Versorgung: XX Bedarf: XX
+Power Monitor Has No Network=Leistungsmonitor hat kein Netzwerk
+Restart=Neustart
+Purging cache=Cache leeren
+XX purging cache=XX Cache leeren
+Sphere=Kugel
+Cube=Würfel
+XX Forcefield=XX Kraftfeld
+Multimeter=Multimeter
+Prospector=Prospektor
+Vacuum Cleaner=Staubsauger
+XX. Supply: XX Demand: XX=XX. Versorgung: XX Bedarf: XX
+
+Fine Gold Wire=feiner Golddraht
+Fine Silver Wire=feiner Silberdraht
+Lead=Blei
+Rubber Tree=Gummibaum
+Stone=Stein
+Sulfur=Schwefel
 .technic.mt-mods//technic/locale/es.txt vs. .technic.nixnoxus/technic/locale/technic.es.tr
--- /dev/fd/63	2021-12-16 19:37:23.377159505 +0100
+++ /dev/fd/62	2021-12-16 19:37:23.377159505 +0100
@@ -0,0 +1,2 @@
+# textdomain: technic
+
@@ -88 +90 @@
-Production at XX%% = Produccion en XX%%
+Production at XX%=Produccion en XX%
@@ -129,0 +132 @@
+
 .technic.mt-mods//technic/locale/fr.txt vs. .technic.nixnoxus/technic/locale/technic.fr.tr
--- /dev/fd/63	2021-12-16 19:37:23.393159145 +0100
+++ /dev/fd/62	2021-12-16 19:37:23.393159145 +0100
@@ -0,0 +1,2 @@
+# textdomain: technic
+
@@ -33,2 +35,2 @@
-%.1f%%-Fissile Uranium Ingot                            = Lingot d'uranium fissile (%.1f%%)
-%.1f%%-Fissile Uranium Block                            = Bloc d'uranium fissile (%.1f%%)
+XX%-Fissile Uranium Ingot=Lingot d'uranium fissile (XX%)
+XX%-Fissile Uranium Block=Bloc d'uranium fissile (XX%)
@@ -118 +120 @@
-Production at XX%%                                      = Production à XX%%
+Production at XX%=Production à XX%
@@ -174 +176 @@
-%.1f%%-Fissile Uranium                                  = Uranium fissile (%.1f%%)
+XX%-Fissile Uranium=Uranium fissile (XX%)
@@ -194,0 +197 @@
+
 .technic.mt-mods//technic/locale/it.txt vs. .technic.nixnoxus/technic/locale/technic.it.tr
--- /dev/fd/63	2021-12-16 19:37:23.405158874 +0100
+++ /dev/fd/62	2021-12-16 19:37:23.405158874 +0100
@@ -0,0 +1,2 @@
+# textdomain: technic
+
@@ -29,2 +31,2 @@
-%.1f%%-Fissile Uranium Ingot = %.1f%%-Lingotto di uranio fissile
-%.1f%%-Fissile Uranium Block = %.1f%%-Blocco di uranio fissile
+XX%-Fissile Uranium Ingot=XX%-Lingotto di uranio fissile
+XX%-Fissile Uranium Block=XX%-Blocco di uranio fissile
@@ -109 +111 @@
-Production at XX%% = Produzione a XX%%
+Production at XX%=Produzione a XX%
@@ -141 +143 @@
-%.1f%%-Fissile Uranium = %.1f%%-Uranio fissile
+XX%-Fissile Uranium=XX%-Uranio fissile
@@ -165,0 +168 @@
+
 .technic.mt-mods//technic/locale/pl.txt vs. .technic.nixnoxus/technic/locale/technic.pl.tr
--- /dev/fd/63	2021-12-16 19:37:23.417158603 +0100
+++ /dev/fd/62	2021-12-16 19:37:23.421158513 +0100
@@ -0,0 +1,2 @@
+# textdomain: technic
+
@@ -32,2 +34,2 @@
-%.1f%%-Fissile Uranium Ingot = %.1f%% Sztabka uranu
-%.1f%%-Fissile Uranium Block = %.1f%% Blok uranu
+XX%-Fissile Uranium Ingot=XX% Sztabka uranu
+XX%-Fissile Uranium Block=XX% Blok uranu
@@ -116 +118 @@
-Production at XX%% = Produkowanie w XX%%
+Production at XX%=Produkowanie w XX%
@@ -148 +150 @@
-%.1f%%-Fissile Uranium = %.1f%% Uranu
+XX%-Fissile Uranium=XX% Uranu
@@ -173,0 +176 @@
+
 .technic.mt-mods//technic_worldgen/locale/de.txt vs. .technic.nixnoxus/technic_worldgen/locale/technic_worldgen.de.tr
--- /dev/fd/63	2021-12-16 19:37:23.433158243 +0100
+++ /dev/fd/62	2021-12-16 19:37:23.433158243 +0100
@@ -0,0 +1,2 @@
+# textdomain: technic_worldgen
+
@@ -39,0 +42,9 @@
+Lead Lump=Bleiklumpen
+Lead Ingot=Bleibarren
+Sulfur Lump=Schwefelklumpen
+Rubber Tree Leaves=Gummibaumblätter
+Lead Ore=Bleierz
+Sulfur Ore=Schwefelerz
+Granite Bricks=Granitblock
+Lead Block=Bleibblock
+Sulfur Block=Schwefelblock
 .technic.mt-mods//technic_worldgen/locale/es.txt vs. .technic.nixnoxus/technic_worldgen/locale/technic_worldgen.es.tr
--- /dev/fd/63	2021-12-16 19:37:23.445157972 +0100
+++ /dev/fd/62	2021-12-16 19:37:23.445157972 +0100
@@ -0,0 +1,2 @@
+# textdomain: technic_worldgen
+
 .technic.mt-mods//technic_worldgen/locale/fr.txt vs. .technic.nixnoxus/technic_worldgen/locale/technic_worldgen.fr.tr
--- /dev/fd/63	2021-12-16 19:37:23.457157702 +0100
+++ /dev/fd/62	2021-12-16 19:37:23.457157702 +0100
@@ -0,0 +1,2 @@
+# textdomain: technic_worldgen
+
 .technic.mt-mods//technic_worldgen/locale/pl.txt vs. .technic.nixnoxus/technic_worldgen/locale/technic_worldgen.pl.tr
--- /dev/fd/63	2021-12-16 19:37:23.473157341 +0100
+++ /dev/fd/62	2021-12-16 19:37:23.473157341 +0100
@@ -0,0 +1,2 @@
+# textdomain: technic_worldgen
+
 .technic.mt-mods//technic_worldgen/locale/tr.txt vs. .technic.nixnoxus/technic_worldgen/locale/technic_worldgen.tr.tr
--- /dev/fd/63	2021-12-16 19:37:23.485157070 +0100
+++ /dev/fd/62	2021-12-16 19:37:23.489156981 +0100
@@ -0,0 +1,2 @@
+# textdomain: technic_worldgen
+
 .technic.mt-mods//wrench/locale/de.txt vs. .technic.nixnoxus/wrench/locale/wrench.de.tr
--- /dev/fd/63	2021-12-16 19:37:23.501156710 +0100
+++ /dev/fd/62	2021-12-16 19:37:23.501156710 +0100
@@ -0,0 +1,2 @@
+# textdomain: wrench
+
 .technic.mt-mods//wrench/locale/es.txt vs. .technic.nixnoxus/wrench/locale/wrench.es.tr
--- /dev/fd/63	2021-12-16 19:37:23.517156349 +0100
+++ /dev/fd/62	2021-12-16 19:37:23.517156349 +0100
@@ -0,0 +1,2 @@
+# textdomain: wrench
+
 .technic.mt-mods//wrench/locale/fr.txt vs. .technic.nixnoxus/wrench/locale/wrench.fr.tr
--- /dev/fd/63	2021-12-16 19:37:23.529156078 +0100
+++ /dev/fd/62	2021-12-16 19:37:23.529156078 +0100
@@ -0,0 +1,2 @@
+# textdomain: wrench
+
 .technic.mt-mods//wrench/locale/pl.txt vs. .technic.nixnoxus/wrench/locale/wrench.pl.tr
--- /dev/fd/63	2021-12-16 19:37:23.541155807 +0100
+++ /dev/fd/62	2021-12-16 19:37:23.541155807 +0100
@@ -0,0 +1,2 @@
+# textdomain: wrench
+
 .technic.mt-mods//wrench/locale/tr.txt vs. .technic.nixnoxus/wrench/locale/wrench.tr.tr
--- /dev/fd/63	2021-12-16 19:37:23.553155538 +0100
+++ /dev/fd/62	2021-12-16 19:37:23.553155538 +0100
@@ -0,0 +1,2 @@
+# textdomain: wrench
+
 .technic.mt-mods//concrete/locale/pt_BR.txt vs. .technic.nixnoxus/concrete/locale/concrete.pt_BR.tr
--- /dev/fd/63	2021-12-16 19:37:23.565155267 +0100
+++ /dev/fd/62	2021-12-16 19:37:23.565155267 +0100
@@ -0,0 +1,2 @@
+# textdomain: concrete
+
 .technic.mt-mods//concrete/locale/zh_CN.txt vs. .technic.nixnoxus/concrete/locale/concrete.zh_CN.tr
--- /dev/fd/63	2021-12-16 19:37:23.581154906 +0100
+++ /dev/fd/62	2021-12-16 19:37:23.581154906 +0100
@@ -0,0 +1,2 @@
+# textdomain: concrete
+
 .technic.mt-mods//extranodes/locale/pt_BR.txt vs. .technic.nixnoxus/extranodes/locale/extranodes.pt_BR.tr
--- /dev/fd/63	2021-12-16 19:37:23.593154635 +0100
+++ /dev/fd/62	2021-12-16 19:37:23.593154635 +0100
@@ -0,0 +1,2 @@
+# textdomain: extranodes
+
 .technic.mt-mods//extranodes/locale/zh_CN.txt vs. .technic.nixnoxus/extranodes/locale/extranodes.zh_CN.tr
--- /dev/fd/63	2021-12-16 19:37:23.605154365 +0100
+++ /dev/fd/62	2021-12-16 19:37:23.605154365 +0100
@@ -0,0 +1,2 @@
+# textdomain: extranodes
+
 .technic.mt-mods//technic_chests/locale/pt_BR.txt vs. .technic.nixnoxus/technic_chests/locale/technic_chests.pt_BR.tr
--- /dev/fd/63	2021-12-16 19:37:23.617154094 +0100
+++ /dev/fd/62	2021-12-16 19:37:23.621154004 +0100
@@ -0,0 +1,2 @@
+# textdomain: technic_chests
+
 .technic.mt-mods//technic_chests/locale/zh_CN.txt vs. .technic.nixnoxus/technic_chests/locale/technic_chests.zh_CN.tr
--- /dev/fd/63	2021-12-16 19:37:23.633153733 +0100
+++ /dev/fd/62	2021-12-16 19:37:23.633153733 +0100
@@ -1,4 +1,6 @@
-XX Chest =XX����
-XX Locked Chest =������XX����
-XX Locked Chest (owned by XX) =������XX�����ӣ���XX���У�
-Color Filter: XX =��ɫɸѡ����XX
+# textdomain: technic_chests
+
+XX Chest=%s����
+XX Locked Chest=������%s����
+XX Locked Chest (owned by XX)=������%s�����ӣ���%s���У�
+Color Filter: XX=��ɫɸѡ����%s
@@ -29 +31 @@
-Auto-sort is XX =�Զ�����ΪXX
+Auto-sort is XX=�Զ�����Ϊ%s
 .technic.mt-mods//technic_cnc/locale/zh_CN.txt vs. .technic.nixnoxus/technic_cnc/locale/technic_cnc.zh_CN.tr
--- /dev/fd/63	2021-12-16 19:37:23.649153373 +0100
+++ /dev/fd/62	2021-12-16 19:37:23.645153463 +0100
@@ -0,0 +1,2 @@
+# textdomain: technic_cnc
+
@@ -2 +4 @@
-XX CNC Machine =XX���ػ���
+XX CNC Machine=%s���ػ���
 .technic.mt-mods//technic/locale/pt_BR.txt vs. .technic.nixnoxus/technic/locale/technic.pt_BR.tr
--- /dev/fd/63	2021-12-16 19:37:23.657153192 +0100
+++ /dev/fd/62	2021-12-16 19:37:23.657153192 +0100
@@ -0,0 +1,2 @@
+# textdomain: technic
+
@@ -32,2 +34,2 @@
-%.1f%%-Fissile Uranium Ingot = Lingote de Urânio %.1f%%-Físsil
-%.1f%%-Fissile Uranium Block = Bloco de Urânio %.1f%%-Físsil
+XX%-Fissile Uranium Ingot=Lingote de Urânio XX%-Físsil
+XX%-Fissile Uranium Block=Bloco de Urânio XX%-Físsil
@@ -118 +120 @@
-Production at XX%% = Produção em XX%%
+Production at XX%=Produção em XX%
@@ -186 +188 @@
-%.1f%%-Fissile Uranium = Urânio %.1f%%-Físsil
+XX%-Fissile Uranium=Urânio XX%-Físsil
@@ -211,0 +214 @@
+
 .technic.mt-mods//technic/locale/zh_CN.txt vs. .technic.nixnoxus/technic/locale/technic.zh_CN.tr
--- /dev/fd/63	2021-12-16 19:37:23.673152832 +0100
+++ /dev/fd/62	2021-12-16 19:37:23.669152922 +0100
@@ -0,0 +1,2 @@
+# textdomain: technic
+
@@ -27,2 +29,2 @@
-%.1f%%-Fissile Uranium Ingot = %.1f%%-裂变铀锭
-%.1f%%-Fissile Uranium Block = %.1f%%-裂变铀块
+XX%-Fissile Uranium Ingot=XX%-裂变铀锭
+XX%-Fissile Uranium Block=XX%-裂变铀块
@@ -96 +98 @@
-Production at XX%% =生产 XX%%
+Production at XX%=生产 XX%
@@ -125 +127 @@
-%.1f%%-Fissile Uranium =%.1f%%-裂变铀
+XX%-Fissile Uranium=XX%-裂变铀
@@ -145,0 +148 @@
+
 .technic.mt-mods//technic_worldgen/locale/pt_BR.txt vs. .technic.nixnoxus/technic_worldgen/locale/technic_worldgen.pt_BR.tr
--- /dev/fd/63	2021-12-16 19:37:23.681152651 +0100
+++ /dev/fd/62	2021-12-16 19:37:23.681152651 +0100
@@ -0,0 +1,2 @@
+# textdomain: technic_worldgen
+
 .technic.mt-mods//technic_worldgen/locale/zh_CN.txt vs. .technic.nixnoxus/technic_worldgen/locale/technic_worldgen.zh_CN.tr
--- /dev/fd/63	2021-12-16 19:37:23.693152380 +0100
+++ /dev/fd/62	2021-12-16 19:37:23.693152380 +0100
@@ -0,0 +1,2 @@
+# textdomain: technic_worldgen
+
 .technic.mt-mods//wrench/locale/pt_BR.txt vs. .technic.nixnoxus/wrench/locale/wrench.pt_BR.tr
--- /dev/fd/63	2021-12-16 19:37:23.705152110 +0100
+++ /dev/fd/62	2021-12-16 19:37:23.705152110 +0100
@@ -0,0 +1,2 @@
+# textdomain: wrench
+
 .technic.mt-mods//wrench/locale/zh_CN.txt vs. .technic.nixnoxus/wrench/locale/wrench.zh_CN.tr
--- /dev/fd/63	2021-12-16 19:37:23.717151840 +0100
+++ /dev/fd/62	2021-12-16 19:37:23.717151840 +0100
@@ -0,0 +1,2 @@
+# textdomain: wrench
+
@@ -2 +4 @@
-XX with items =XX����Ʒ
+XX with items=%s����Ʒ

With | grep -av '= $' I filter out new text without translations.
If you leave that out, the diff gets bigger.

@nixnoxus
Copy link
Contributor Author

diff zh_CN. again after last commit:

~/minetest.git/mods$ for dst in .technic.nixnoxus/*/locale/*.zh_CN.tr;do src="$(echo "$dst"|sed 's@^[^/]\+\(/[^/]\+/locale/\)[^\.]\+\.\([^\.]\+\)\.tr@.technic.mt-mods/\1\2.txt@')"; echo " $src vs. $dst"; diff -w -U0 <(sed 's/\(%[dfs]\|@[1-9]\)/XX/g' "$src"|grep -av '=$') <(sed 's/@[1-9]/XX/g' "$dst"|grep -av '=$');done
 .technic.mt-mods//concrete/locale/zh_CN.txt vs. .technic.nixnoxus/concrete/locale/concrete.zh_CN.tr
--- /dev/fd/63	2021-12-16 19:54:22.338289625 +0100
+++ /dev/fd/62	2021-12-16 19:54:22.338289625 +0100
@@ -0,0 +1,2 @@
+# textdomain: concrete
+
 .technic.mt-mods//extranodes/locale/zh_CN.txt vs. .technic.nixnoxus/extranodes/locale/extranodes.zh_CN.tr
--- /dev/fd/63	2021-12-16 19:54:22.350289357 +0100
+++ /dev/fd/62	2021-12-16 19:54:22.354289268 +0100
@@ -0,0 +1,2 @@
+# textdomain: extranodes
+
 .technic.mt-mods//technic_chests/locale/zh_CN.txt vs. .technic.nixnoxus/technic_chests/locale/technic_chests.zh_CN.tr
--- /dev/fd/63	2021-12-16 19:54:22.366289000 +0100
+++ /dev/fd/62	2021-12-16 19:54:22.366289000 +0100
@@ -0,0 +1,2 @@
+# textdomain: technic_chests
+
 .technic.mt-mods//technic_cnc/locale/zh_CN.txt vs. .technic.nixnoxus/technic_cnc/locale/technic_cnc.zh_CN.tr
--- /dev/fd/63	2021-12-16 19:54:22.382288644 +0100
+++ /dev/fd/62	2021-12-16 19:54:22.382288644 +0100
@@ -0,0 +1,2 @@
+# textdomain: technic_cnc
+
 .technic.mt-mods//technic/locale/zh_CN.txt vs. .technic.nixnoxus/technic/locale/technic.zh_CN.tr
--- /dev/fd/63	2021-12-16 19:54:22.398288287 +0100
+++ /dev/fd/62	2021-12-16 19:54:22.398288287 +0100
@@ -0,0 +1,2 @@
+# textdomain: technic
+
@@ -27,2 +29,2 @@
-%.1f%%-Fissile Uranium Ingot = %.1f%%-裂变铀锭
-%.1f%%-Fissile Uranium Block = %.1f%%-裂变铀块
+XX%-Fissile Uranium Ingot=XX%-裂变铀锭
+XX%-Fissile Uranium Block=XX%-裂变铀块
@@ -96 +98 @@
-Production at XX%% =生产 XX%%
+Production at XX%=生产 XX%
@@ -125 +127 @@
-%.1f%%-Fissile Uranium =%.1f%%-裂变铀
+XX%-Fissile Uranium=XX%-裂变铀
@@ -145,0 +148 @@
+
 .technic.mt-mods//technic_worldgen/locale/zh_CN.txt vs. .technic.nixnoxus/technic_worldgen/locale/technic_worldgen.zh_CN.tr
--- /dev/fd/63	2021-12-16 19:54:22.414287930 +0100
+++ /dev/fd/62	2021-12-16 19:54:22.414287930 +0100
@@ -0,0 +1,2 @@
+# textdomain: technic_worldgen
+
 .technic.mt-mods//wrench/locale/zh_CN.txt vs. .technic.nixnoxus/wrench/locale/wrench.zh_CN.tr
--- /dev/fd/63	2021-12-16 19:54:22.430287574 +0100
+++ /dev/fd/62	2021-12-16 19:54:22.430287574 +0100
@@ -0,0 +1,2 @@
+# textdomain: wrench
+

@BuckarooBanzay
Copy link
Member

uh, somehow i can't change the language in my client anymore :/ i tried the LANG, LC_ALL and LANGUAGE env vars according to https://www.gnu.org/software/gettext/manual/gettext.html#Locale-Environment-Variables, even tried the ingame language setting, i always end up with the english default...

How does this work again? 😋

@S-S-X
Copy link
Member

S-S-X commented Dec 24, 2021

How does this work again? 😋

language = en ore something like that in config file

Not sure how it works when both server and client has configured but I guess it will use client first if configured and possibly fallback to server side config. Or server side config is just for server side translations when done with empty locale string. (or server will override client config but that would be stupid....)

@nixnoxus
Copy link
Contributor Author

nixnoxus commented Dec 24, 2021

How does this work again? yum

user@lint:~>grep ^ /etc/lsb-release
DISTRIB_ID=LinuxMint
DISTRIB_RELEASE=19.3
DISTRIB_CODENAME=tricia
DISTRIB_DESCRIPTION="Linux Mint 19.3 Tricia"

user@lint:~>LANGUAGE=de minetest

language = de in .minetest/minetest.conf seems to have no effect on the client

addendum: the language code must be supported by minetest itself. for example:

user@lint:~>minetest --version
Minetest 5.4.1 (Linux)
Using Irrlicht 1.8.4
Using LuaJIT 2.1.0-beta3
BUILD_TYPE=Release
RUN_IN_PLACE=0
USE_CURL=1
USE_GETTEXT=1
USE_SOUND=1
USE_FREETYPE=1
STATIC_SHAREDIR="/usr/share/minetest"
STATIC_LOCALEDIR="/usr/share/locale"
user@lint:~>minetest --version |grep ^STATIC_LOCALEDIR=
STATIC_LOCALEDIR="/usr/share/locale"
user@lint:~>eval $(minetest --version |grep ^STATIC_LOCALEDIR=);for dir in $STATIC_LOCALEDIR/*;do test -f "$dir/LC_MESSAGES/minetest.mo" && echo -n " $(basename "$dir")";done;echo
 be bg ca cs da de dv el eo es et eu fi fr gd gl hi hu id it ja jbo kk kn ko lt lv ms nb nl nn pl pt pt_BR ro ru sk sl sr_Cyrl sr_Latn sv sw tr uk vi zh_CN zh_TW

when i call

user@lint:~>LANGUAGE=de_DE minetest

i doesn't work. and

user@lint:~>LANGUAGE=en minetest 

does NOT use mod/testmod/locale/en.tr as expected.

@BuckarooBanzay
Copy link
Member

thanks for the help: i forgot to enable gettext 🤦

LGTM 👍

@nixnoxus
Copy link
Contributor Author

nixnoxus commented Jan 3, 2022

@S-S-X: i tried with the diffs (i hope understandably) to show that there are no significant changes in the translations.

A wrong placeholder was noticed and already fixed.

I am satisfied with this PR. They also? 😉

Copy link
Contributor

@OgelGames OgelGames left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think this is good enough to be merged 👍 I've added the other TODOs to #104.

@OgelGames OgelGames changed the title convert to minetest.get_translator Move to MT 5.0.0+ translation system Jan 4, 2022
@OgelGames OgelGames added Cleanup Cleanup of bad code or other redundant/unnecessary stuff Enhancement New feature or request labels Jan 4, 2022
@BuckarooBanzay BuckarooBanzay merged commit a39a454 into mt-mods:master Jan 7, 2022
@OgelGames OgelGames added Translations Aims to improve translations. and removed Enhancement New feature or request labels Nov 14, 2022
@Athozus Athozus added this to the 2.0.0 milestone Apr 14, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Cleanup Cleanup of bad code or other redundant/unnecessary stuff Translations Aims to improve translations.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants