[Mod] Internationalization Library [intllib]

User avatar
kaeza
Member
 
Posts: 2141
Joined: Thu Oct 18, 2012 05:00
GitHub: kaeza
IRC: kaeza diemartin blaaaaargh
In-game: kaeza

[Mod] Internationalization Library [intllib]

by kaeza » Thu Feb 28, 2013 11:52

English | Español | Português

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:

    Your phone or window isn't wide enough to display the code box. If it's a phone, try rotating it to landscape mode.
    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 | BTC: 1DFZAa5VtNG7Levux4oP6BuUzr1e83pJK2
 

User avatar
Calinou
Member
 
Posts: 3124
Joined: Mon Aug 01, 2011 14:26
GitHub: Calinou
IRC: Calinou
In-game: Calinou

by Calinou » Thu Feb 28, 2013 12:05

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
Member
 
Posts: 2141
Joined: Thu Oct 18, 2012 05:00
GitHub: kaeza
IRC: kaeza diemartin blaaaaargh
In-game: kaeza

by kaeza » Thu Feb 28, 2013 12:25

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 | BTC: 1DFZAa5VtNG7Levux4oP6BuUzr1e83pJK2
 

User avatar
Calinou
Member
 
Posts: 3124
Joined: Mon Aug 01, 2011 14:26
GitHub: Calinou
IRC: Calinou
In-game: Calinou

by Calinou » Thu Feb 28, 2013 12:39

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
Member
 
Posts: 2141
Joined: Thu Oct 18, 2012 05:00
GitHub: kaeza
IRC: kaeza diemartin blaaaaargh
In-game: kaeza

by kaeza » Thu Feb 28, 2013 14:33

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 | BTC: 1DFZAa5VtNG7Levux4oP6BuUzr1e83pJK2
 

User avatar
kaeza
Member
 
Posts: 2141
Joined: Thu Oct 18, 2012 05:00
GitHub: kaeza
IRC: kaeza diemartin blaaaaargh
In-game: kaeza

by kaeza » Sun Mar 03, 2013 16:53

*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 | BTC: 1DFZAa5VtNG7Levux4oP6BuUzr1e83pJK2
 

User avatar
kaeza
Member
 
Posts: 2141
Joined: Thu Oct 18, 2012 05:00
GitHub: kaeza
IRC: kaeza diemartin blaaaaargh
In-game: kaeza

by kaeza » Tue Mar 05, 2013 21:13

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 | BTC: 1DFZAa5VtNG7Levux4oP6BuUzr1e83pJK2
 

User avatar
Calinou
Member
 
Posts: 3124
Joined: Mon Aug 01, 2011 14:26
GitHub: Calinou
IRC: Calinou
In-game: Calinou

by Calinou » Wed Mar 06, 2013 09:02

kaeza wrote:admintools


maptools, not admintools.
 

User avatar
kaeza
Member
 
Posts: 2141
Joined: Thu Oct 18, 2012 05:00
GitHub: kaeza
IRC: kaeza diemartin blaaaaargh
In-game: kaeza

by kaeza » Wed Mar 06, 2013 10:55

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 | BTC: 1DFZAa5VtNG7Levux4oP6BuUzr1e83pJK2
 

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

by Mito551 » Wed Mar 06, 2013 12:46

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

User avatar
kaeza
Member
 
Posts: 2141
Joined: Thu Oct 18, 2012 05:00
GitHub: kaeza
IRC: kaeza diemartin blaaaaargh
In-game: kaeza

by kaeza » Wed Mar 06, 2013 14:55

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 | BTC: 1DFZAa5VtNG7Levux4oP6BuUzr1e83pJK2
 

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

by Mito551 » Wed Mar 06, 2013 16:13

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
Member
 
Posts: 2141
Joined: Thu Oct 18, 2012 05:00
GitHub: kaeza
IRC: kaeza diemartin blaaaaargh
In-game: kaeza

by kaeza » Wed Mar 06, 2013 18:53

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 | BTC: 1DFZAa5VtNG7Levux4oP6BuUzr1e83pJK2
 

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

by Mito551 » Wed Mar 06, 2013 19:17

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
Member
 
Posts: 2141
Joined: Thu Oct 18, 2012 05:00
GitHub: kaeza
IRC: kaeza diemartin blaaaaargh
In-game: kaeza

by kaeza » Wed Mar 06, 2013 23:11

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 | BTC: 1DFZAa5VtNG7Levux4oP6BuUzr1e83pJK2
 

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

by Mito551 » Thu Mar 07, 2013 03:58

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
Member
 
Posts: 2141
Joined: Thu Oct 18, 2012 05:00
GitHub: kaeza
IRC: kaeza diemartin blaaaaargh
In-game: kaeza

by kaeza » Thu Mar 07, 2013 07:33

Ah sorry.
Put it in any folder that is easily accessible, and change your minetest.conf, adding the following line:
Your phone or window isn't wide enough to display the code box. If it's a phone, try rotating it to landscape mode.
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 | BTC: 1DFZAa5VtNG7Levux4oP6BuUzr1e83pJK2
 

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

by Mito551 » Thu Mar 07, 2013 13:36

kaeza wrote:Ah sorry.
Put it in any folder that is easily accessible, and change your minetest.conf, adding the following line:
Your phone or window isn't wide enough to display the code box. If it's a phone, try rotating it to landscape mode.
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=fdff5dd2026eb8ac7ba2b17a42e5978b.jpg
or (with this parameter) so:
http://screenshot.su/show.php?img=eb2ddac8dd0fb8989332484a422b6ef6.jpg
Last edited by Mito551 on Thu Mar 07, 2013 13:47, edited 1 time in total.
 

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

by xyz » Thu Mar 07, 2013 16:14

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

by Likwid H-Craft » Thu Mar 07, 2013 16:18

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 » Thu Mar 07, 2013 16:51

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: 449
Joined: Thu Nov 10, 2011 14:25

by xyz » Thu Mar 07, 2013 18:11

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 » Thu Mar 07, 2013 21:27

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: 632
Joined: Thu Feb 21, 2013 23:54

by prestidigitator » Fri Mar 08, 2013 01:36

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

by PilzAdam » Fri Mar 08, 2013 16:01

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

Xanthin
Member
 
Posts: 121
Joined: Fri Mar 07, 2014 14:05
GitHub: Xanthin
IRC: Xanthin
In-game: Xanthin

by Xanthin » Wed Apr 09, 2014 23:09

kaeza wrote:*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.


Hi kaeza,

the whole last month I used your mod to translate some mods for my daughter and her friends to play minetest in german language. It works very good and overall it is easy to use, for a noob like me without any experience in programming. There were some difficult situations witch bothered (?) me more than a day when it comes to code like print sth., chat messages, labels, infotext etc. But with a look at the already translated mods and some trying and experimenting (I can´t start the game anymore without a bumping heart fearing the next error message :D) it works. And afterall it was an interesting experience how the game works behind the screen (not meaning I understood much of that). At this point, thank you.

So here is a list of mods wich I know are translated and "supported" (means you can download the mod as usual and there is the locale directory with template.txt and intllib support) and the mods I translated but are not (yet) supported. These mods are available in my github account (translation branch), but could be outdated while the mod owner updated the mod and I didn´t notice it.

[spoiler]
supported mods:
food
gloopblocks
glow
hardenedclay
homedecor_modpack
moreblocks
moreores
moretrees
morestairs
plantlife
streets
technic
unifieddyes

unsupported mods:
minetest_game/mods (from stable branch 0.4.9)
  • bones
    bucket
    creative
    default
    doors
    dye
    farming
    fire
    flowers
    give_initial_stuff
    legacy
    screwdriver
    stairs
    vessels
    wool
animals_modpack
beds
bees
boats
campfire
candle (currently without the textures cause I can only use github in the browser and can´t upload images/sounds)
castle+
random_buildings/cottages
doors
dryplants
farming_plus
firestone
fishing
inbox
gemalde
lavalamp
lrfurn
memorandum
minetest-3d_armor]
mobfcooking
pyramids
stoneage
unified_inventory
u_skins
[/spoiler]

Greetings
Xanthin
Last edited by Xanthin on Tue Apr 15, 2014 22:38, edited 1 time in total.
 

User avatar
mimilus
Member
 
Posts: 75
Joined: Thu Mar 06, 2014 09:08
GitHub: mimilus
IRC: Mimilus

by mimilus » Thu Apr 10, 2014 06:36

Xanthin Let me finish to play with my castle fork and after we look for the translation

All time I make modification in lua files, rename, cut so not already the time for translated it

But that's cool, When i'll finish things a want to do i'll push your translation

After I'll use it for french transltion too
minetest 0.4.9
Ubuntu 12.04
 

4aiman
Member
 
Posts: 1208
Joined: Mon Jul 30, 2012 05:47

by 4aiman » Thu Apr 10, 2014 09:14

Any chance of supporting languages with more that 2 forms of a noun and an adjective?
English uses isolated words. The only "thing" is "s" affix which shows us 3rd person single and " 's " which shows us "possesiveness".
Currently it's impossible to use proper Russian (just an example, any flective language fits here) to translate mods with this mod, because of the structure of the language itself.

Great mod anyway :) Just not for all.
 

Xanthin
Member
 
Posts: 121
Joined: Fri Mar 07, 2014 14:05
GitHub: Xanthin
IRC: Xanthin
In-game: Xanthin

by Xanthin » Thu Apr 10, 2014 11:51

mimilus wrote:Xanthin Let me finish to play with my castle fork and after we look for the translation
All time I make modification in lua files, rename, cut so not already the time for translated it

But that's cool, When i'll finish things a want to do i'll push your translation

After I'll use it for french transltion too


I guessed as much. ;) I try to stay up to date with your work (not difficult, I like to test your new features).

4aiman wrote:Any chance of supporting languages with more that 2 forms of a noun and an adjective?
English uses isolated words. The only "thing" is "s" affix which shows us 3rd person single and " 's " which shows us "possesiveness".
Currently it's impossible to use proper Russian (just an example, any flective language fits here) to translate mods with this mod, because of the structure of the language itself.

Great mod anyway :) Just not for all.


4aiman, please excuse my inquiry, I hardly try to understand what you mean.
As I know you could write every thing behind the "=" like :
Sandras red hair = Sandra has damn red hair because she eats so much carrots. :)

Ah, or do you mean things like that: %s's red hair = %ss red hair? In some cases this is also bad for proper german. Than I tried to give up the ease of this and made a longer column of all possible words like:
Sandra's red hair = Sandras red hair
Alex's red hair = Alex' red hair, (in german it´s only apostrophe)

Did I understand you correctly? Or did you have an example?

The only disadvantage I see is the limitation to latin characters. In german I can help me to rewrite umlauts (ä = ae) but I don´t know how you can make this with russian letters.
 

User avatar
BrunoMine
Member
 
Posts: 902
Joined: Thu Apr 25, 2013 17:29
GitHub: BrunoMine

by BrunoMine » Thu Apr 10, 2014 12:57

I found a very complicated explanation. Explain to me in parts. Please!
My small square universe under construction ... Minemacro
Comunidade Minetest Brasil
www.minetestbrasil.com
 

Next

Return to Mod Releases

Who is online

Users browsing this forum: No registered users and 13 guests

cron