[Mod] Translate Item Definitions [vortoj]
- Casimir
- Member
- Posts: 1207
- Joined: Fri Aug 03, 2012 16:59
- GitHub: CasimirKaPazi
[Mod] Translate Item Definitions [vortoj]
EDIT: Since MT now comes with translation this mod is obsolete and will no longer be maintained.
A Mod that translates the item description into the language defined in the settings.
Translated:
DE (German)
FR (French)
IT (Italian)
JA (Japanese)
TP (Toki Pona)
TR (Turkish)
git: https://github.com/CasimirKaPazi/vortoj
download:
.zip
.tar.gz
license of code: GPLv3 or later
depends: nothing
(Softdepends on all supported mods so it gets loaded after them.)
I started with the German translation, but then it became boring, so I decided that you do the rest.
A Mod that translates the item description into the language defined in the settings.
Translated:
DE (German)
FR (French)
IT (Italian)
JA (Japanese)
TP (Toki Pona)
TR (Turkish)
git: https://github.com/CasimirKaPazi/vortoj
download:
.zip
.tar.gz
license of code: GPLv3 or later
depends: nothing
(Softdepends on all supported mods so it gets loaded after them.)
I started with the German translation, but then it became boring, so I decided that you do the rest.
Last edited by Casimir on Sun Oct 25, 2020 11:50, edited 4 times in total.
- Casimir
- Member
- Posts: 1207
- Joined: Fri Aug 03, 2012 16:59
- GitHub: CasimirKaPazi
- Casimir
- Member
- Posts: 1207
- Joined: Fri Aug 03, 2012 16:59
- GitHub: CasimirKaPazi
- Casimir
- Member
- Posts: 1207
- Joined: Fri Aug 03, 2012 16:59
- GitHub: CasimirKaPazi
- ShadowNinja
- Developer
- Posts: 200
- Joined: Tue Jan 22, 2013 22:35
- GitHub: ShadowNinja
- IRC: ShadowNinja
- In-game: ShadowNinja
You might find that the intllib mod is helpfull for this. ( viewtopic.php?id=4929 )
I rewrote your mod using it:
( http://pastebin.ubuntu.com/6922568/ )
Just put translation files in locale/ with the name of the language with a .txt suffix, eg, ES.lua becomes locale/es.txt.
The translation files use a minetest.conf-like syntax. (See https://github.com/minetest-technic/tec ... ale/es.txt )
You'll also have to add intllib to depends.txt of course.
I rewrote your mod using it:
Code: Select all
for name, translation in pairs(intllib.get_strings() or {}) do
if minetest.registered_items[name] and translation ~= "" then
minetest.override_item(name, {description = translation})
end
end
Just put translation files in locale/ with the name of the language with a .txt suffix, eg, ES.lua becomes locale/es.txt.
The translation files use a minetest.conf-like syntax. (See https://github.com/minetest-technic/tec ... ale/es.txt )
You'll also have to add intllib to depends.txt of course.
Hi Casimir,
If I understand your mod, it´s exactly what I was looking for. Translating the description one time and than no need to touch the files when I have to reinstall or update the mods, if there is no change made with the description. Is this correct? (my english and computer knowledge is poor)
But I can´t get your mod working. I installed minetest 0.4.9 (for windows, where it has still a bug whith closing the game), put the modfolder in the usual moddirectory, checked the mod in modlist, but there is no translation in the game. And when I write "language = de" in the minetest.config I get an error message.
What do I wrong?
If I understand your mod, it´s exactly what I was looking for. Translating the description one time and than no need to touch the files when I have to reinstall or update the mods, if there is no change made with the description. Is this correct? (my english and computer knowledge is poor)
But I can´t get your mod working. I installed minetest 0.4.9 (for windows, where it has still a bug whith closing the game), put the modfolder in the usual moddirectory, checked the mod in modlist, but there is no translation in the game. And when I write "language = de" in the minetest.config I get an error message.
What do I wrong?
- Casimir
- Member
- Posts: 1207
- Joined: Fri Aug 03, 2012 16:59
- GitHub: CasimirKaPazi
You need a minetest version newer than "stable" 0.4.9. In General Discussion you will find several builds for windows.
The mod does not change any file on you system. Also the descriptions only get translated when the mod is enabled. If that is what you wanted to know.
So you see how great Minetest is?
Dein Minetest sollte neuer sein als die sogenannte "stabile" Version 0.4.9. In General Discussion gibt es mehrere Builds für Windows.
Die Mod verändert keine Dateien, das ist alles nur temporär so lange sie eingeschaltet ist. Wenn es das ist was du wissen wolltest.
Das heißt der offizielle Download von Minetest funktioniert praktisch nicht?
The mod does not change any file on you system. Also the descriptions only get translated when the mod is enabled. If that is what you wanted to know.
So you see how great Minetest is?
Dein Minetest sollte neuer sein als die sogenannte "stabile" Version 0.4.9. In General Discussion gibt es mehrere Builds für Windows.
Die Mod verändert keine Dateien, das ist alles nur temporär so lange sie eingeschaltet ist. Wenn es das ist was du wissen wolltest.
Das heißt der offizielle Download von Minetest funktioniert praktisch nicht?
Last edited by Casimir on Mon Mar 10, 2014 22:25, edited 1 time in total.
xyz has fixed this issue although it wasn't merged with upstream. Currently you may want to play with codepagesand mod files coding. See herefor any details.Casimir wrote:If it does not work, try to edit minetest.conf. It should have a line "language = SK".
Sadly Minetest can not display most of the words. It just displays <invalid multibyte sting>.
PS: w/o knowing of this mod I did my own with only Russian. Any volunteer may use some translated strings from it.
- Casimir
- Member
- Posts: 1207
- Joined: Fri Aug 03, 2012 16:59
- GitHub: CasimirKaPazi
Re: [Mod] Translate Item Definitions [vortoj]
I started with a toki pona translation. It is very hard to express things like "bucket of lava" in toki pona but it is fun to find a solution: "poki telo li jo e telo kiwen seli" This is actually a sentence "container liquid has liquid stone fire".
- Wuzzy
- Member
- Posts: 4803
- Joined: Mon Sep 24, 2012 15:01
- GitHub: Wuzzy2
- IRC: Wuzzy
- In-game: Wuzzy
- Contact:
Re: [Mod] Translate Item Definitions [vortoj]
I have updated the German translation for Minetest Game 0.4.13, grab it here:
http://lpaste.net/raw/139584
Also, the depends.txt file should be updated for Minetest Game 0.4.13 (boats, xpanes, tnt, …).
http://lpaste.net/raw/139584
Also, the depends.txt file should be updated for Minetest Game 0.4.13 (boats, xpanes, tnt, …).
- Desour
- Member
- Posts: 1472
- Joined: Thu Jun 19, 2014 19:49
- GitHub: Desour
- IRC: Desour
- In-game: DS
- Location: I'm scared that if this is too exact, I will be unable to use my keyboard.
Re: [Mod] Translate Item Definitions [vortoj]
you made some translating mistakes:Wuzzy wrote:I have updated the German translation for Minetest Game 0.4.13, grab it here:
http://lpaste.net/raw/139584
Also, the depends.txt file should be updated for Minetest Game 0.4.13 (boats, xpanes, tnt, …).
pine means "Kiefer" in german and screwdriver means "Schraubenzieher" in german
he/him; Codeberg; GitHub; ContentDB; public personal TODO list; "DS" is preferred (but often too short)
- Wuzzy
- Member
- Posts: 4803
- Joined: Mon Sep 24, 2012 15:01
- GitHub: Wuzzy2
- IRC: Wuzzy
- In-game: Wuzzy
- Contact:
Re: [Mod] Translate Item Definitions [vortoj]
Fixed the pine stuff.
http://lpaste.net/raw/139584
About “screwdriver”: Both “Schraubenzieher” and “Schraubendreher” are correct and mean the same thing in German.
http://www.dict.cc/?s=screwdriver
https://de.wikipedia.org/wiki/Schraubendreher
http://lpaste.net/raw/139584
About “screwdriver”: Both “Schraubenzieher” and “Schraubendreher” are correct and mean the same thing in German.
http://www.dict.cc/?s=screwdriver
https://de.wikipedia.org/wiki/Schraubendreher
Re: [Mod] Translate Item Definitions [vortoj]
This mod is awesome.
Although I have a little problem. I made a hungarian translation, and it works fine with 0.4.12 version of the game, even the accented characters are displayed (e.g.: á é í ó ö ő ú ü ű - I don't know if any other "special" characters from other languages are working or not). But in the 0.4.13 version, accented characters are missing from item definitions (there are spaces instead of these characters)
Is that a mod problem, or something with the game itself?
Although I have a little problem. I made a hungarian translation, and it works fine with 0.4.12 version of the game, even the accented characters are displayed (e.g.: á é í ó ö ő ú ü ű - I don't know if any other "special" characters from other languages are working or not). But in the 0.4.13 version, accented characters are missing from item definitions (there are spaces instead of these characters)
Is that a mod problem, or something with the game itself?
- Casimir
- Member
- Posts: 1207
- Joined: Fri Aug 03, 2012 16:59
- GitHub: CasimirKaPazi
Re: [Mod] Translate Item Definitions [vortoj]
@ Wuzzy
Thank you. I added it.
@ Martno
This seems to be a problem of Minetest itself. Sometimes it works for some languages, sometimes it does not. I don't know how to fix it. But currently people are working on adding full utf-8 support to the engine. I hope that we will then be able to support all languages well.
Thank you. I added it.
@ Martno
This seems to be a problem of Minetest itself. Sometimes it works for some languages, sometimes it does not. I don't know how to fix it. But currently people are working on adding full utf-8 support to the engine. I hope that we will then be able to support all languages well.
Re: [Mod] Translate Item Definitions [vortoj]
Ok, thanks for the answer. I hope that too.Casimir wrote: I hope that we will then be able to support all languages well.
Re: [Mod] Translate Item Definitions [vortoj]
Ignore this reply, I deleted
Re: [Mod] Translate Item Definitions [vortoj]
I'm making a sample_language.lua file for this mod, to support Minetest 0.4.13 and LOTS of Mods. So people can translate mods too.
This work is a lot of copying and pasting, I don't have any coding/modding skills. Because of this, I ran into some difficulties.
1. Stairs, slabs, panels... etc
2. Mods which override default items descriptions
1. Some mods registers the stairs (and stuff) with different item strings if Stairsplus (from Moreblocks) is enabled or disabled. Something like this:
Stairsplus: modname:stair_blockname, modname:slab_blockname ... etc
Stairs: stairs:stair_blockname, stairs:slab_blockname.
So in these cases I think my sample_language.lua file has to contain every stairs, slabs twice, in both forms, because I want the translation to work with or without stairsplus enabled.
Not very big problem, it's just the work is really time consuming already.
2. Some mods (like Technic) overrides the descriptions of some default items, blocks. The item string remains the same, but the description changes. I'm not able to give a different description in case technic is enabled, so the description remains the same.
It's not a problem to me, but it's possible that some players would rather see iron pickaxe, axe, shovel... etc in the description, instead of the default steel pickaxe, axe, shovel... etc. Or Wooden Chest instead of default Chest, if Technic is enabled.
I don't know if this overriding thing can cause more serious problems in case of other mods (I didn't find any yet).
I hope I explained it clear enough (my English is not the best).
So if there is any possible solution or workaround, that would be great.
This work is a lot of copying and pasting, I don't have any coding/modding skills. Because of this, I ran into some difficulties.
1. Stairs, slabs, panels... etc
2. Mods which override default items descriptions
1. Some mods registers the stairs (and stuff) with different item strings if Stairsplus (from Moreblocks) is enabled or disabled. Something like this:
Stairsplus: modname:stair_blockname, modname:slab_blockname ... etc
Stairs: stairs:stair_blockname, stairs:slab_blockname.
So in these cases I think my sample_language.lua file has to contain every stairs, slabs twice, in both forms, because I want the translation to work with or without stairsplus enabled.
Not very big problem, it's just the work is really time consuming already.
2. Some mods (like Technic) overrides the descriptions of some default items, blocks. The item string remains the same, but the description changes. I'm not able to give a different description in case technic is enabled, so the description remains the same.
It's not a problem to me, but it's possible that some players would rather see iron pickaxe, axe, shovel... etc in the description, instead of the default steel pickaxe, axe, shovel... etc. Or Wooden Chest instead of default Chest, if Technic is enabled.
I don't know if this overriding thing can cause more serious problems in case of other mods (I didn't find any yet).
I hope I explained it clear enough (my English is not the best).
So if there is any possible solution or workaround, that would be great.
- Casimir
- Member
- Posts: 1207
- Joined: Fri Aug 03, 2012 16:59
- GitHub: CasimirKaPazi
Re: [Mod] Translate Item Definitions [vortoj]
1. A nice solution would be to have a piece of code that handles aliases and similar nodes. For collecting the node names one could write a small mod or other program to do this. Such a program could also print out generic translations. I previously wrote a small mod to print out all item strings. That might be a starting point.
2. Changing steel to iron is a strange thing to do. If someone wants to add iron then the best thing would be to make a new item for it. If mods do things that I think should not be done in a mod, I tend to not support them. It saves a lot of work.
2. Changing steel to iron is a strange thing to do. If someone wants to add iron then the best thing would be to make a new item for it. If mods do things that I think should not be done in a mod, I tend to not support them. It saves a lot of work.
Who is online
Users browsing this forum: Google [Bot] and 22 guests