The changelog says that mods can be now translated?
How do you do that?
Translating mods
- MCL
- Member
- Posts: 654
- Joined: Mon Aug 20, 2018 00:44
- GitHub: MCLx86
- IRC: migdyn
- In-game: singleplayer
- Contact:
Translating mods
2014-02-14 - 2024-02-14 TEN YEARS OF MCL
- Linuxdirk
- Member
- Posts: 3218
- 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: Ahrefs [Bot] and 6 guests