+
Spoiler
Download
License: MIT
Dependencies: None
Setting your language:
See minetest.conf.example.
Localizing your mod (for developers and translators):
In your mod directory, create a new directory and name it "locale". For each language added, create a new .lua file and name the file according to it's language code. In the .lua file, return a table of unlocalized keys and localized values. (Example)
If you have too many items and/or nodes to manually make your own .lua file, try i18ngen. In init.lua and depends.txt, replace "default" with the name of your mod. After that, enable i18ngen on a world, load the world, and look in the console.
Lastly, add "i18n?" to your depends.txt and add the following snippet of code to the end of your init.lua file:
To Do:
Not Done:
In Progress:
Done:
Thanks to kaeza for his open-source intllib.
License: MIT
Dependencies: None
Setting your language:
See minetest.conf.example.
Localizing your mod (for developers and translators):
In your mod directory, create a new directory and name it "locale". For each language added, create a new .lua file and name the file according to it's language code. In the .lua file, return a table of unlocalized keys and localized values. (Example)
If you have too many items and/or nodes to manually make your own .lua file, try i18ngen. In init.lua and depends.txt, replace "default" with the name of your mod. After that, enable i18ngen on a world, load the world, and look in the console.
Lastly, add "i18n?" to your depends.txt and add the following snippet of code to the end of your init.lua file:
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
if minetest.get_modpath("i18n") then i18n.localize_mod() end
To Do:
Not Done:
- Registration with automatic localization
In Progress:
- Localization of minetest_game in languages other than English
Done:
- Function allowing mods to replace all descriptions and not depend on i18n
Thanks to kaeza for his open-source intllib.