Page 1 of 5

[Mod] Internationalization Library [intllib]

Posted: Thu Feb 28, 2013 11:52
by kaeza
English | Español | Português

DEPRECATED - Use Minetest's new translation API instead!

You should not use this mod when writing new mods, and you should update mods to no longer depend on this mod.

Minetest 5.0 has builtin support for client-side translation, accessed by minetest.get_translator()

Internationalization Lib for Minetest

This mod is an attempt at providing internationalization support for mods (something Minetest currently lacks).

This is good for both players and developers alike.
As a player, you will be able to see textual content (like messages, infotexts, and item names) from mods supporting this library in your native language.
As a mod developer, you can potentially get more users, as it makes the items easily readable by non-english-speakers.

This enhances the minetest interface overall, as the entire interface is in a single language.

NOTE: Even though the last edited date at the bottom of this post says it was edited long ago, this mod is still active (commit log).

License: Unlicense

Dependencies: none

Download:
How do I use it?

Please see the README for instructions.

Random bits
  • Glory! (thanks!) has made a nice image (WTFPL) to show support for intllib:

    Image

    If you want to add it to your mod's topic, you can use this piece of BBcode to add an image linking back to this topic:

    Code: Select all

    [url=https://forum.minetest.net/viewtopic.php?f=11&t=4929][img]http://i.imgur.com/1bjbxmD.png[/img][/url]
    
  • Emon and several other users (thanks!) are compiling a list of mods that support this library.
Thanks for reading up to this point.
--
Yours Truly,
Kaeza

Posted: Thu Feb 28, 2013 12:05
by Calinou
This is a good start; however, I think a "definite" way to do this should be available in the default game directly, so that we have a simple, unified and bug-free way to translate mods. Also it should be made easier to translate mods (should not require editing files, just creating new ones).

Posted: Thu Feb 28, 2013 12:25
by kaeza
Thanks Calinou. If this gets enough interest (an caters to all needs) I may try to make a pull request for this on minetest_game.
As for an easier eay to translate the mods, I don't quite follow.

Posted: Thu Feb 28, 2013 12:39
by Calinou
By adding files for translations instead of editing existing files, this makes sharing new translations much easier (no patching needed, just drop in the file in the mod's directory). A directory named "locale" containing files like "es.txt" could be used for that.

Posted: Thu Feb 28, 2013 14:33
by kaeza
This is exactly what the mod does.
The `template.txt' file is just so translators don't have to scourge the Lua files in order to find what needs to be translated.
You just copy template.txt to, for example, fr.txt, and translate the strings, possibly telling the mod developer to merge the changes to his repo so it's available to everyone.
Edit: I have Spanish translations ready for several mods (used by modified versions of the mods I have locally): moreores, gloopores, beds, bones, homedecor, armor, plus some of my own mods.

Posted: Sun Mar 03, 2013 16:53
by kaeza
*BUMP*

I'd like to read more comments on this.

Is it useful? (from the end user's perspective)
Is something not clear?
Any ideas for additions?

I'd really appreciate more feedback on this, so maybe we can see mods in our native languages in the near future.

Posted: Tue Mar 05, 2013 21:13
by kaeza
Well, this thing is starting to get supported by other mods.
Thanks to Calinou for providing support into his mods moreblocks, moreores, maptools, and stairsplus.
Thanks to VanessaE for allowing me to mess with her code to add support for it in homedecor.
I also provided Spanish translations for all of those mods.

Posted: Wed Mar 06, 2013 09:02
by Calinou
kaeza wrote:admintools
maptools, not admintools.

Posted: Wed Mar 06, 2013 10:55
by kaeza
Sorry :P
Post edited.
EDIT: Also, some bug fixes.

Posted: Wed Mar 06, 2013 12:46
by Mito551
if it's japanese, is it ja or jp?

Posted: Wed Mar 06, 2013 14:55
by kaeza
Mito551 wrote:if it's japanese, is it ja or jp?
According to the List of ISO 639-1 codes (aka Two-Letter Language Codes) article in Wikipedia, it should be 'ja'.

Posted: Wed Mar 06, 2013 16:13
by Mito551
kaeza wrote:
Mito551 wrote:if it's japanese, is it ja or jp?
According to the List of ISO 639-1 codes (aka Two-Letter Language Codes) article in Wikipedia, it should be 'ja'.
thanks. (iso-codes, wow)

Posted: Wed Mar 06, 2013 18:53
by kaeza
Mito551 wrote:
kaeza wrote:
Mito551 wrote:if it's japanese, is it ja or jp?
According to the List of ISO 639-1 codes (aka Two-Letter Language Codes) article in Wikipedia, it should be 'ja'.
thanks. (iso-codes, wow)
Yes. The thing is that I use the LANG environment variable to detect the user's language. This works ok on Linux because that variable is always defined. Unfortunately, you have to add it yourself under Windows.

In case you don't know how (and so other Windows users know it in case they decide to install this mod), this is done like this:
  • Open the Start Menu, and select Settings -> Control Panel.
  • Start the "System" applet.
  • Select "Advanced" tab, and click the "Environment Variables" button.
  • Under the "User" section, add a variable named 'LANG' with the ISO Language Code of your choice.
  • Keep clicking OK until all dialogs are closed.
Edit:
Of course, you can also add a `language=<code>' setting to your `minetest.conf'. This will override system language.

Posted: Wed Mar 06, 2013 19:17
by Mito551
kaeza wrote:
Mito551 wrote:
kaeza wrote: According to the List of ISO 639-1 codes (aka Two-Letter Language Codes) article in Wikipedia, it should be 'ja'.
thanks. (iso-codes, wow)
Yes. The thing is that I use the LANG environment variable to detect the user's language. This works ok on Linux because that variable is always defined. Unfortunately, you have to add it yourself under Windows.

In case you don't know how (and so other Windows users know it in case they decide to install this mod), this is done like this:
  • Open the Start Menu, and select Settings -> Control Panel.
  • Start the "System" applet.
  • Select "Advanced" tab, and click the "Environment Variables" button.
  • Under the "User" section, add a variable named 'LANG' with the ISO Language Code of your choice.
  • Keep clicking OK until all dialogs are closed.
Edit:
Of course, you can also add a `language=<code>' setting to your `minetest.conf'. This will override system language.
hey, that's great! but ubfortunately, i can't test it. i don't know how to make japanese fonts work in minetest :(
do you know? can you tell me?

Posted: Wed Mar 06, 2013 23:11
by kaeza
Minetest supports TTF fonts. Just use a font that contains jap characters. Dunno if the current font supports it.

Edit:
The default font does not support those characters.
xyz on IRC suggested using this font: http://detours.googlecode.com/files/uming.ttf

Posted: Thu Mar 07, 2013 03:58
by Mito551
kaeza wrote:Minetest supports TTF fonts. Just use a font that contains jap characters. Dunno if the current font supports it.

Edit:
The default font does not support those characters.
xyz on IRC suggested using this font: http://detours.googlecode.com/files/uming.ttf
i mean, what do i do with it? i already asked xyz, but he didn't give proper answer. can you? sorry for bothering...

Posted: Thu Mar 07, 2013 07:33
by kaeza
Ah sorry.
Put it in any folder that is easily accessible, and change your minetest.conf, adding the following line:

Code: Select all

font_path = path/to/uming.ttf
And no need to be sorry; you are not bothering at all :)
If anybodyshould be sorry, it should be me for bugging you to do this.
So... sowwy :)

Posted: Thu Mar 07, 2013 13:36
by Mito551
kaeza wrote:Ah sorry.
Put it in any folder that is easily accessible, and change your minetest.conf, adding the following line:

Code: Select all

font_path = path/to/uming.ttf
And no need to be sorry; you are not bothering at all :)
If anybodyshould be sorry, it should be me for bugging you to do this.
So... sowwy :)
thank you very much :)
it doesn't work. probably because of the font itself, so i'll be fixing this.
UPD: no, tried other fonts, doesn't work. the font just becomes very small and unusable
it is either so(no font_path in conf):
http://screenshot.su/show.php?img=fdff5 ... e5978b.jpg
or (with this parameter) so:
http://screenshot.su/show.php?img=eb2dd ... 2b6ef6.jpg

Posted: Thu Mar 07, 2013 16:14
by xyz
Check your paths, it works fine for me.
Image
UPD on Windows you probably want to use \ instead of /

Posted: Thu Mar 07, 2013 16:18
by Likwid H-Craft
Hey xyz can I use halo font?

Posted: Thu Mar 07, 2013 16:51
by Mito551
xyz wrote:Check your paths, it works fine for me.
Image
UPD on Windows you probably want to use \ instead of /
is it linux? i tried \ and / both. doesn't work.

Posted: Thu Mar 07, 2013 18:11
by xyz
Mito551 wrote:is it linux? i tried \ and / both. doesn't work.
Try to revert all changes in minetest.conf and then replace fonts/liberationsans.ttf with uming.ttc (or some other font)

Posted: Thu Mar 07, 2013 21:27
by Mito551
xyz wrote:
Mito551 wrote:is it linux? i tried \ and / both. doesn't work.
Try to revert all changes in minetest.conf and then replace fonts/liberationsans.ttf with uming.ttc (or some other font)
that worked. at least something now :D. thank you very much

Posted: Fri Mar 08, 2013 01:36
by prestidigitator
kaeza wrote:The thing is that I use the LANG environment variable to detect the user's language. This works ok on Linux because that variable is always defined. Unfortunately, you have to add it yourself under Windows.
There's a tiny, tiny bit of locale support built into the Lua standard libraries. I'm not SURE it will help, but it might be worth a try. You can get and set a locale for a category of formats, and I believe the string formatting and regex-like patterns make use of them. I'm not sure whether they are intended for full i18n or just formatting, and I don't know if they do any kind of automatic querying of the environment or if the APIs are just there so you can call them and explicitly set locales yourself.

Posted: Fri Mar 08, 2013 16:01
by PilzAdam
The mod/library uses the locale of the server and not the one of the client.