[Mod] Internationalization Library [intllib]

User avatar
kaeza
Moderator
Posts: 2162
Joined: Thu Oct 18, 2012 05:00
GitHub: kaeza
IRC: kaeza diemartin blaaaaargh
In-game: kaeza
Location: Montevideo, Uruguay
Contact:

[Mod] Internationalization Library [intllib]

by kaeza » Post

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
Last edited by kaeza on Fri Mar 29, 2013 01:56, edited 1 time in total.
Your signature is not the place for a blog post. Please keep it as concise as possible. Thank you!

Check out my stuff! | Donations greatly appreciated! PayPal

User avatar
Calinou
Moderator
Posts: 3169
Joined: Mon Aug 01, 2011 14:26
GitHub: Calinou
IRC: Calinou
In-game: Calinou
Location: Troyes, France
Contact:

by Calinou » Post

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).
Last edited by Calinou on Thu Feb 28, 2013 12:05, edited 1 time in total.

User avatar
kaeza
Moderator
Posts: 2162
Joined: Thu Oct 18, 2012 05:00
GitHub: kaeza
IRC: kaeza diemartin blaaaaargh
In-game: kaeza
Location: Montevideo, Uruguay
Contact:

by kaeza » Post

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.
Your signature is not the place for a blog post. Please keep it as concise as possible. Thank you!

Check out my stuff! | Donations greatly appreciated! PayPal

User avatar
Calinou
Moderator
Posts: 3169
Joined: Mon Aug 01, 2011 14:26
GitHub: Calinou
IRC: Calinou
In-game: Calinou
Location: Troyes, France
Contact:

by Calinou » Post

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.

User avatar
kaeza
Moderator
Posts: 2162
Joined: Thu Oct 18, 2012 05:00
GitHub: kaeza
IRC: kaeza diemartin blaaaaargh
In-game: kaeza
Location: Montevideo, Uruguay
Contact:

by kaeza » Post

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.
Last edited by kaeza on Thu Feb 28, 2013 16:00, edited 1 time in total.
Your signature is not the place for a blog post. Please keep it as concise as possible. Thank you!

Check out my stuff! | Donations greatly appreciated! PayPal

User avatar
kaeza
Moderator
Posts: 2162
Joined: Thu Oct 18, 2012 05:00
GitHub: kaeza
IRC: kaeza diemartin blaaaaargh
In-game: kaeza
Location: Montevideo, Uruguay
Contact:

by kaeza » Post

*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.
Your signature is not the place for a blog post. Please keep it as concise as possible. Thank you!

Check out my stuff! | Donations greatly appreciated! PayPal

User avatar
kaeza
Moderator
Posts: 2162
Joined: Thu Oct 18, 2012 05:00
GitHub: kaeza
IRC: kaeza diemartin blaaaaargh
In-game: kaeza
Location: Montevideo, Uruguay
Contact:

by kaeza » Post

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.
Last edited by kaeza on Wed Mar 06, 2013 10:05, edited 1 time in total.
Your signature is not the place for a blog post. Please keep it as concise as possible. Thank you!

Check out my stuff! | Donations greatly appreciated! PayPal

User avatar
Calinou
Moderator
Posts: 3169
Joined: Mon Aug 01, 2011 14:26
GitHub: Calinou
IRC: Calinou
In-game: Calinou
Location: Troyes, France
Contact:

by Calinou » Post

kaeza wrote:admintools
maptools, not admintools.

User avatar
kaeza
Moderator
Posts: 2162
Joined: Thu Oct 18, 2012 05:00
GitHub: kaeza
IRC: kaeza diemartin blaaaaargh
In-game: kaeza
Location: Montevideo, Uruguay
Contact:

by kaeza » Post

Sorry :P
Post edited.
EDIT: Also, some bug fixes.
Last edited by kaeza on Wed Mar 06, 2013 10:58, edited 1 time in total.
Your signature is not the place for a blog post. Please keep it as concise as possible. Thank you!

Check out my stuff! | Donations greatly appreciated! PayPal

User avatar
Mito551
Member
Posts: 1271
Joined: Sat Jun 16, 2012 15:03

by Mito551 » Post

if it's japanese, is it ja or jp?

User avatar
kaeza
Moderator
Posts: 2162
Joined: Thu Oct 18, 2012 05:00
GitHub: kaeza
IRC: kaeza diemartin blaaaaargh
In-game: kaeza
Location: Montevideo, Uruguay
Contact:

by kaeza » Post

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'.
Last edited by kaeza on Wed Mar 06, 2013 14:57, edited 1 time in total.
Your signature is not the place for a blog post. Please keep it as concise as possible. Thank you!

Check out my stuff! | Donations greatly appreciated! PayPal

User avatar
Mito551
Member
Posts: 1271
Joined: Sat Jun 16, 2012 15:03

by Mito551 » Post

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)

User avatar
kaeza
Moderator
Posts: 2162
Joined: Thu Oct 18, 2012 05:00
GitHub: kaeza
IRC: kaeza diemartin blaaaaargh
In-game: kaeza
Location: Montevideo, Uruguay
Contact:

by kaeza » Post

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.
Last edited by kaeza on Wed Mar 06, 2013 18:54, edited 1 time in total.
Your signature is not the place for a blog post. Please keep it as concise as possible. Thank you!

Check out my stuff! | Donations greatly appreciated! PayPal

User avatar
Mito551
Member
Posts: 1271
Joined: Sat Jun 16, 2012 15:03

by Mito551 » Post

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?
Last edited by Mito551 on Wed Mar 06, 2013 19:17, edited 1 time in total.

User avatar
kaeza
Moderator
Posts: 2162
Joined: Thu Oct 18, 2012 05:00
GitHub: kaeza
IRC: kaeza diemartin blaaaaargh
In-game: kaeza
Location: Montevideo, Uruguay
Contact:

by kaeza » Post

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
Last edited by kaeza on Wed Mar 06, 2013 23:16, edited 1 time in total.
Your signature is not the place for a blog post. Please keep it as concise as possible. Thank you!

Check out my stuff! | Donations greatly appreciated! PayPal

User avatar
Mito551
Member
Posts: 1271
Joined: Sat Jun 16, 2012 15:03

by Mito551 » Post

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...

User avatar
kaeza
Moderator
Posts: 2162
Joined: Thu Oct 18, 2012 05:00
GitHub: kaeza
IRC: kaeza diemartin blaaaaargh
In-game: kaeza
Location: Montevideo, Uruguay
Contact:

by kaeza » Post

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 :)
Last edited by kaeza on Thu Mar 07, 2013 07:34, edited 1 time in total.
Your signature is not the place for a blog post. Please keep it as concise as possible. Thank you!

Check out my stuff! | Donations greatly appreciated! PayPal

User avatar
Mito551
Member
Posts: 1271
Joined: Sat Jun 16, 2012 15:03

by Mito551 » Post

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
Last edited by Mito551 on Thu Mar 07, 2013 13:47, edited 1 time in total.

User avatar
xyz
Member
Posts: 450
Joined: Thu Nov 10, 2011 14:25

by xyz » Post

Check your paths, it works fine for me.
Image
UPD on Windows you probably want to use \ instead of /

User avatar
Likwid H-Craft
Member
Posts: 1113
Joined: Sun Jan 06, 2013 14:20
Location: Lost in Crypt

by Likwid H-Craft » Post

Hey xyz can I use halo font?
My Domain's/others:
http://likwidtest.hj.cx/ (Not Done)

User avatar
Mito551
Member
Posts: 1271
Joined: Sat Jun 16, 2012 15:03

by Mito551 » Post

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.

User avatar
xyz
Member
Posts: 450
Joined: Thu Nov 10, 2011 14:25

by xyz » Post

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)

User avatar
Mito551
Member
Posts: 1271
Joined: Sat Jun 16, 2012 15:03

by Mito551 » Post

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

prestidigitator
Member
Posts: 647
Joined: Thu Feb 21, 2013 23:54

by prestidigitator » Post

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.
Last edited by prestidigitator on Fri Mar 08, 2013 01:37, edited 1 time in total.

User avatar
PilzAdam
Member
Posts: 4026
Joined: Fri Jul 20, 2012 16:19
GitHub: PilzAdam
IRC: PilzAdam
Location: Germany

by PilzAdam » Post

The mod/library uses the locale of the server and not the one of the client.

Post Reply

Who is online

Users browsing this forum: Google [Bot] and 10 guests