make timer default format translatable

This commit is contained in:
Dirk Sohler 2019-02-22 16:00:18 +01:00
parent 27fef2760f
commit 0c04bb9f50
No known key found for this signature in database
GPG Key ID: B9751241BD7D4E1A
2 changed files with 15 additions and 6 deletions

@ -1,9 +1,10 @@
local modpath = minetest.get_modpath('mtimer')..DIR_DELIM local modpath = minetest.get_modpath('mtimer')..DIR_DELIM
local syspath = modpath..'system'..DIR_DELIM local syspath = modpath..'system'..DIR_DELIM
local S = minetest.get_translator('mtimer')
mtimer = { mtimer = {
translator = minetest.get_translator('mtimer'), translator = S,
show_formspec = {}, show_formspec = {},
meta = { meta = {
visible = { key = 'mtimer:visible', default = 'true' }, visible = { key = 'mtimer:visible', default = 'true' },
@ -28,11 +29,13 @@ mtimer = {
}, },
timer_format = { timer_format = {
key = 'mtimer:timer_format', key = 'mtimer:timer_format',
default = 'Current Date: {rd}\n'.. default = table.concat({
'Ingame Time: {it}\n'.. S('Current Date: @1', '{rd}'),
'Session Start: {st}\n'.. S('Ingame Time: @1', '{it}'),
'Session Duration: {sd}' S('Session Start: @1', '{st}'),
}, S('Session Duration: @1', '{sd}')
}, '\n')
}
} }
} }

@ -53,6 +53,12 @@ In-Game Time=Spielzeit
Session Start Time=Sitzungs-Startzeit Session Start Time=Sitzungs-Startzeit
Session Duration=Sitzungsdauer Session Duration=Sitzungsdauer
# Timer default format
Current Date: @1=Aktuelles Datum: @1
Ingame Time: @1=Spielzeit: @1
Session Start: @1=Sitzungsstart: @1
Session Duration: @1=Sitzungsdauer: @1
# Generic Formspec Strings # Generic Formspec Strings
Default=Standard Default=Standard
Exit=Verlassen Exit=Verlassen