The changelog says that mods can be now translated?
How do you do that?
Translating mods
-
- Member
- Posts: 405
- Joined: Mon Aug 20, 2018 00:44
- GitHub: NOT APPLICABLE
- IRC: MCL
- In-game: singleplayer
- Location: Somewhere in SSWZ
- Contact:
Translating mods
COME SEE MY MINETEST MAP!!! FRANCAIS TRADDUCCIONS COMING SOON! ČESKY PŘEKLAD JIŽ NEDLOUHO!!!
- Linuxdirk
- Member
- Posts: 2713
- Joined: Wed Sep 17, 2014 11:21
- In-game: Linuxdirk
- Location: Germany
- Contact:
Re: Translating mods
You need to change how your strings are set in your mods and you need a new file in a new folder.
File ./locale/modname.de.tr (syntax: textdomain.language.tr, it is advised to simply use the mod name as textdomain to avoid naming conflicts):
You can also use variables named @1 to @9 being positional arguments.
You can't skip a variable. In your translation file it's the same.
See here for full documentation:
https://github.com/minetest/minetest/bl ... 2455-L2549
Since the system ignores empty lines and all lines not being original string=translated string or lines starting with # textdomain: you can also comment and group your translations.
https://gitlab.com/4w/mtimer/raw/4f8009 ... imer.de.tr
Code: Select all
local S = minetest.get_translator('modname')
local foo = S('My translated string')
Code: Select all
# textdomain: modname
My translated string=Meine übersetzte Zeichenkette
Code: Select all
local foo = S('This is important: @1, this too: @2', super_important_variable, second_important_thing)
Code: Select all
# textdomain: modname
My translated string=Meine übersetzte Zeichenkette
This is important: @1, this too: @2=Dies ist wichtig: @1, dies auch: @2
https://github.com/minetest/minetest/bl ... 2455-L2549
Since the system ignores empty lines and all lines not being original string=translated string or lines starting with # textdomain: you can also comment and group your translations.
https://gitlab.com/4w/mtimer/raw/4f8009 ... imer.de.tr
Who is online
Users browsing this forum: No registered users and 2 guests