[Mod] Localisation [v06] [ ]

User avatar
sfan5
Member
 
Posts: 3636
Joined: Wed Aug 24, 2011 09:44
GitHub: sfan5
IRC: sfan5

[Mod] Localisation [v06] [ ]

by sfan5 » Tue May 14, 2013 19:54

Localisation Mod

This Mod adds Localisation to Lua Mods and the default Game.
This is only useful when you play in Singleplayer or when you run e.g. a Spanish Minetest Server
Code License: CC-BY-SA 2.0
Mod dependencies: none


Download: https://dl.dropboxusercontent.com/u/30267315/Minetest/localisationmod-mt-dropin.zip
How to install:
  • Drop the contents into your main minetest folder (where the folder builtin is)
  • Note: You need to overwrite builtin/builtin.lua for this to work
Configuring:
Setting the Language
To set the language open builtin/localisation.lua in an editor and change:
L.lang = "en"
to
L.lang = "<the_language_you_want>"
List of available Translations:
Installing translations: Just drop the contents of the .zip File into your Minetest folder, also don't forget to set your language


If you want me to add your Translations to the list, they must be a .zip file that looks as follows:
- something.zip
-- games
--- common
---- mods
----- bucket
------ po
------- <language>.po
----- ...
API:
-> string L.get(string)
Returns translated string, if not available returns original string.
Last edited by sfan5 on Tue May 21, 2013 14:23, edited 1 time in total.
Mods: Mesecons | WorldEdit | Nuke
Minetest builds for Windows (32-bit & 64-bit)
 

User avatar
aracnus
Member
 
Posts: 57
Joined: Wed May 15, 2013 01:09
GitHub: aracnus
IRC: aracnus
In-game: aracnus

by aracnus » Wed May 15, 2013 10:15

Hi sfan5, we talked yesterday about translation and this mod.

Well, as I told you, I tried it and the po's were generated, but when I left the world and enter again I get a bunch of error messages like this:

ERROR[main]: Syntax Error in /home/fred/projetos/minetest/source/minetest/bin/../games/common/mods/bucket/po/pt_BR.po


for all po files (besides "bucket", I have all others directories under games/common/mods), followed by a message that po file was read and another that no match was found. Each error repeats a number of times. Here are the lines corresponding to doors and bucket:

-snip-
no match found: 'bucket'.'pt_BR'.'Water Bucket'
06:54:01: ERROR[main]: Syntax Error in /home/fred/projetos/minetest/source/minetest/bin/../games/common/mods/bucket/po/pt_BR.po
06:54:01: ERROR[main]: Syntax Error in /home/fred/projetos/minetest/source/minetest/bin/../games/common/mods/bucket/po/pt_BR.po
06:54:01: ERROR[main]: Syntax Error in /home/fred/projetos/minetest/source/minetest/bin/../games/common/mods/bucket/po/pt_BR.po
BR.po for bucket read
no match found: 'bucket'.'pt_BR'.'Lava Bucket'


Initially I thought that was a problem with the language code (pt_BR), because of the "BR.po for bucket read" message (the "pt_" part is missing), so I changed the name to only "pt", but the problem persists.

Another information is that even Minetest is translated to pt_BR (I have "minetest.po" file under po/pt_BR and it was pulled from git) my interface is still in English. It may have anything to do with the localisation problem?

Thanks for any help.
Last edited by sfan5 on Wed May 15, 2013 17:53, edited 1 time in total.
 

User avatar
sfan5
Member
 
Posts: 3636
Joined: Wed Aug 24, 2011 09:44
GitHub: sfan5
IRC: sfan5

by sfan5 » Wed May 15, 2013 11:58

Could you paste the .po file?
Mods: Mesecons | WorldEdit | Nuke
Minetest builds for Windows (32-bit & 64-bit)
 

User avatar
aracnus
Member
 
Posts: 57
Joined: Wed May 15, 2013 01:09
GitHub: aracnus
IRC: aracnus
In-game: aracnus

by aracnus » Wed May 15, 2013 13:47

sfan5 wrote:Could you paste the .po file?


Here goes pt_BR.po from bucket:

#pt_BR Translation for bucket
msgid "Empty Bucket"
msgstr "Empty Bucket"

msgid "Water Bucket"
msgstr "Water Bucket"

msgid "Lava Bucket"
msgstr "Lava Bucket"


I ran msgfmt -v command and it showed me no errors, only an alert for absence of language codification (I add this information to test, but Minetest still show same errors).
 

User avatar
sfan5
Member
 
Posts: 3636
Joined: Wed Aug 24, 2011 09:44
GitHub: sfan5
IRC: sfan5

by sfan5 » Wed May 15, 2013 14:04

I fixed the problem, redownload the latest version
Mods: Mesecons | WorldEdit | Nuke
Minetest builds for Windows (32-bit & 64-bit)
 

User avatar
sfan5
Member
 
Posts: 3636
Joined: Wed Aug 24, 2011 09:44
GitHub: sfan5
IRC: sfan5

by sfan5 » Wed May 15, 2013 14:36

German translation added.
Mods: Mesecons | WorldEdit | Nuke
Minetest builds for Windows (32-bit & 64-bit)
 

User avatar
sfan5
Member
 
Posts: 3636
Joined: Wed Aug 24, 2011 09:44
GitHub: sfan5
IRC: sfan5

by sfan5 » Wed May 15, 2013 16:50

French translation by Calinou added
Mods: Mesecons | WorldEdit | Nuke
Minetest builds for Windows (32-bit & 64-bit)
 

User avatar
Pavel_S
Member
 
Posts: 131
Joined: Sat Apr 06, 2013 11:43

by Pavel_S » Wed May 15, 2013 16:59

Russian translation, but it won`t work =(
 

User avatar
sfan5
Member
 
Posts: 3636
Joined: Wed Aug 24, 2011 09:44
GitHub: sfan5
IRC: sfan5

by sfan5 » Wed May 15, 2013 17:00

What do you mean by won't work?
Syntax Error messages? Nothing happens?
Mods: Mesecons | WorldEdit | Nuke
Minetest builds for Windows (32-bit & 64-bit)
 

User avatar
Pavel_S
Member
 
Posts: 131
Joined: Sat Apr 06, 2013 11:43

by Pavel_S » Wed May 15, 2013 17:04

Game says "ModError: Failed to load and run ... \builtin.lua"
 

User avatar
sfan5
Member
 
Posts: 3636
Joined: Wed Aug 24, 2011 09:44
GitHub: sfan5
IRC: sfan5

by sfan5 » Wed May 15, 2013 17:05

Paste the complete error, otherwise I won't be able to fix it
Mods: Mesecons | WorldEdit | Nuke
Minetest builds for Windows (32-bit & 64-bit)
 

User avatar
Pavel_S
Member
 
Posts: 131
Joined: Sat Apr 06, 2013 11:43

by Pavel_S » Wed May 15, 2013 17:17

So, I deleted
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
dofile(minetest.get_modpath("__builtin").."/features.lua")
this string from builtin.lua . And now it`s working, but there is problem with encoding.
 

User avatar
sfan5
Member
 
Posts: 3636
Joined: Wed Aug 24, 2011 09:44
GitHub: sfan5
IRC: sfan5

by sfan5 » Wed May 15, 2013 17:21

Could you make a .zip file for the translation, I can add it to the list then
Mods: Mesecons | WorldEdit | Nuke
Minetest builds for Windows (32-bit & 64-bit)
 

User avatar
BlockMen
Member
 
Posts: 768
Joined: Fri Mar 01, 2013 17:24
GitHub: BlockMen

by BlockMen » Wed May 15, 2013 17:45

Awesome! Very nice mod.

PS: plz change "Dreck" to "Erde" in german translation ;)
 

User avatar
sfan5
Member
 
Posts: 3636
Joined: Wed Aug 24, 2011 09:44
GitHub: sfan5
IRC: sfan5

by sfan5 » Wed May 15, 2013 17:48

BlockMen wrote:Awesome! Very nice mod.

Thanks!
BlockMen wrote:PS: plz change "Dreck" to "Erde" in german translation ;)

done.
Mods: Mesecons | WorldEdit | Nuke
Minetest builds for Windows (32-bit & 64-bit)
 

User avatar
aracnus
Member
 
Posts: 57
Joined: Wed May 15, 2013 01:09
GitHub: aracnus
IRC: aracnus
In-game: aracnus

by aracnus » Wed May 15, 2013 18:13

Everything is ok now sfan5, thank you. And I have just one more question. On localisation.lua there is a comment that L.lang must be 2 characters. So, there is another way to produce a pt_BR translation instead of just pt? Brazilian Portuguese and Portugal Portuguese have many differences between some words translations.
 

User avatar
sfan5
Member
 
Posts: 3636
Joined: Wed Aug 24, 2011 09:44
GitHub: sfan5
IRC: sfan5

by sfan5 » Wed May 15, 2013 18:28

Just use pt, unfortanely I need to set a fixed length
Mods: Mesecons | WorldEdit | Nuke
Minetest builds for Windows (32-bit & 64-bit)
 

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 May 16, 2013 05:18

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
sfan5
Member
 
Posts: 3636
Joined: Wed Aug 24, 2011 09:44
GitHub: sfan5
IRC: sfan5

by sfan5 » Thu May 16, 2013 05:25

Added!
Mods: Mesecons | WorldEdit | Nuke
Minetest builds for Windows (32-bit & 64-bit)
 

User avatar
sfan5
Member
 
Posts: 3636
Joined: Wed Aug 24, 2011 09:44
GitHub: sfan5
IRC: sfan5

by sfan5 » Sun May 19, 2013 17:21

Update!
Changelog:
  • Support for multiline Strings
  • Added L.get function
Mods: Mesecons | WorldEdit | Nuke
Minetest builds for Windows (32-bit & 64-bit)
 

User avatar
guilleelcapoextra
Member
 
Posts: 70
Joined: Sat Oct 13, 2012 23:49

by guilleelcapoextra » Mon May 20, 2013 18:31

cool mod sfan
 

User avatar
sfan5
Member
 
Posts: 3636
Joined: Wed Aug 24, 2011 09:44
GitHub: sfan5
IRC: sfan5

by sfan5 » Mon May 20, 2013 18:51

German Translation updated to work with new Minetest versions
Mods: Mesecons | WorldEdit | Nuke
Minetest builds for Windows (32-bit & 64-bit)
 

User avatar
sfan5
Member
 
Posts: 3636
Joined: Wed Aug 24, 2011 09:44
GitHub: sfan5
IRC: sfan5

by sfan5 » Tue May 21, 2013 14:24

Update!
Changelog:
  • Support for language codes like pt_BR (removed language code restriction)
Mods: Mesecons | WorldEdit | Nuke
Minetest builds for Windows (32-bit & 64-bit)
 

User avatar
aracnus
Member
 
Posts: 57
Joined: Wed May 15, 2013 01:09
GitHub: aracnus
IRC: aracnus
In-game: aracnus

by aracnus » Wed May 22, 2013 01:24

Hi sfan5,

The last update didn't work. When I try to use it, even with "L.lang" as "pt" or "pt_BR", I get the following errors:

22:20:48: ERROR[main]: ========== ERROR FROM LUA ===========
22:20:48: ERROR[main]: Failed to load and run script from
22:20:48: ERROR[main]: /home/fred/projetos/minetest/source/minetest/bin/../games/minetest_game/mods/fire/init.lua:
22:20:48: ERROR[main]: ...test/source/minetest/bin/../builtin/localisation.lua:113: attempt to index local 'b' (a nil value)
22:20:48: ERROR[main]: stack traceback:
22:20:48: ERROR[main]: ...test/source/minetest/bin/../builtin/localisation.lua:113: in function 'create_po_entry'
22:20:48: ERROR[main]: ...test/source/minetest/bin/../builtin/localisation.lua:135: in function 'register_node'
22:20:48: ERROR[main]: ...netest/bin/../games/minetest_game/mods/fire/init.lua:3: in main chunk
22:20:48: ERROR[main]: =======END OF ERROR FROM LUA ========
22:20:48: ERROR[main]: Server: Failed to load and run /home/fred/projetos/minetest/source/minetest/bin/../games/minetest_game/mods/fire/init.lua
22:20:48: ERROR[main]: ModError: Failed to load and run /home/fred/projetos/minetest/source/minetest/bin/../games/minetest_game/mods/fire/init.lua
Could not load texture:
Quit message received.


And it doesn't generate any .po.
 

User avatar
sfan5
Member
 
Posts: 3636
Joined: Wed Aug 24, 2011 09:44
GitHub: sfan5
IRC: sfan5

by sfan5 » Wed May 22, 2013 05:33

Redownload the .zip and try again
Mods: Mesecons | WorldEdit | Nuke
Minetest builds for Windows (32-bit & 64-bit)
 


Return to Old Mods

Who is online

Users browsing this forum: No registered users and 6 guests

cron