Page 1 of 1

Internationalization for mods

PostPosted: Sat Aug 30, 2014 14:30
by Wuzzy
Yeah, this is one big thing which is missing in Minetest: Internationalization (I18N) for mods. Mods are now such an essential part of Minetest that if those are not translatable, a huge chunk of Minetest (including the default subgame, Minetest Game) is de facto only available in English.

There were a few attempts to implement I18N for mods by using mods but I think this not a good solution in my opinion for serveral reasons:
  • Because they are mods, it depends on the server wheather translations are provided at all
  • Because they are mods, there is no clean standard way to translate mods
  • The mods are more or less a bit obscure and not everyone even knows about them
Also, as far I can tell, none of the translation mods supports even basic format strings. So it is not even possible to insert variable strings. The mods only allow for fixed strings, which makes only the most basic translation tasks possible. But even if one of the translation mods fixed that problem, there would be still the inherent problems of mods.

What would be really needed is translation support directly from the core. Some support from the Lua API would be great. So that modders don’t have to worry about dependencies, they can simply use the Lua API to mark strings as translatable. And server operators don’t have to explicitly enable I18N support by providing a mod.

Now I am not exactly sure how to implement something like that. I would be in favor of a gettext-based solution, because Minetest already uses gettext. But I wouldn’t oppose other solutions if they work.

Any further ideas or comments on this?

Re: Internationalization for mods

PostPosted: Sat Aug 30, 2014 14:41
by sfan5
Translations done server-side?
No.

Re: Internationalization for mods

PostPosted: Sat Aug 30, 2014 18:54
by Wuzzy
Mods are on the server side. As well as the relevant strings, of course. Therefore, it is not far-fetched to do it on the server side, at least partly. If the translations or the original strings would be on the client, the client would have to have somehow obtained prior knowledge of the mod, which would make mods not purely server-side anymore.

I do not understand the reason behind your position. And since you do not provide any rationale for your position, I can simply dismiss it.

Re: Internationalization for mods

PostPosted: Sat Aug 30, 2014 19:20
by sfan5
So you want everyone to use Greek because the server owner decided he wanted Greek?

Re: Internationalization for mods

PostPosted: Sat Aug 30, 2014 19:23
by Krock
Languages are client stuff, translations like

default:stick Stick
default:wood Planks

would be much better than using the translation mod.

Re: Internationalization for mods

PostPosted: Sun Aug 31, 2014 05:09
by Wuzzy
sfan5 wrote:So you want everyone to use Greek because the server owner decided he wanted Greek?

No, of course not!
What I want is that each client gets the strings in the language it wants.

Maybe I should provide a rough concept:
Mods have to provide the translation files (if any) by themselves. So translation files reside in the mod folder.
Now here’s how I think the client can get the translated strings: On connection, the client tells the server the desired language, probably as early as possible. After that, when the server needs to transmit a string from a mod, the server first translates it to the language of the client (if a translation is available, this would be a simple look-up operation, if not, the default string is chosen), then sends the translated string.
So the idea is that the server sends the strings in the language of the respective clients, not in the server’s language.
This would require a small protocol change, but the only change would be the client telling the server the language, so I hope this is not too dramatic.

Well, that’s my basic idea. I hope it makes more sense now. I am not so sure about the details.
I wonder if this would be even a workable solution at all, because I am not really sure.


@Krock: You are missing the point here. If it were just about translating node descriptions, the existing mods would kinda suffice. It would still be not the prettiest solution but it would work. But mods can have strings everywhere, not only in the node descriptions. Formspecs are another big thing (for example). And besides, your solution would again require clients to have prior knowledge of the server’s mods. The client would have to magically know the translation of strings from mods the client does not even know yet, because it all comes from mods. It just doesn’t make much sense to me.

Re: Internationalization for mods

PostPosted: Sun Aug 31, 2014 08:25
by sfan5
Wuzzy wrote:
sfan5 wrote:So you want everyone to use Greek because the server owner decided he wanted Greek?

No, of course not!
What I want is that each client gets the strings in the language it wants.
[...]

That sounds like a viable option.

Re: Internationalization for mods

PostPosted: Sun Aug 31, 2014 18:01
by Minetestforfun
@Wuzzy
Very interresting idea, for now, i manually trad english mods to french in my server, my english isn't very good, so i often make mistakes... :/

Re: Internationalization for mods

PostPosted: Sun Aug 31, 2014 20:24
by kaeza
One way would be to broadcast the .mo/.po files as "media", and then let the client handle translation.

Also, this bit has been discussed before: translating item names or is no problem; you just take "Stick" and translate to whatever you want. The issue is how to translate (and send) things like server messages, formspec strings, and the like.

Re: Internationalization for mods

PostPosted: Sun Aug 31, 2014 20:55
by rubenwardy
All my food mods use kaeza's intlib. My mods supply a locale/de.txt files, etc. The duggested method would be much better than forcing all players to use the same language. And very little effort for me to then support.

Re: Internationalization for mods

PostPosted: Mon Feb 09, 2015 03:04
by Wuzzy
I have just opened an issue about this:
https://github.com/minetest/minetest/issues/2270

Re: Internationalization for mods

PostPosted: Wed Apr 13, 2016 20:34
by afflatus
Good thread.
Let's try to get clear about what needs to happen in the engine, server-side and client-side.
I'd love to make my sub-game properly translatable.