mirror of
https://github.com/luanti-org/luanti.git
synced 2025-09-30 19:22:14 +00:00
Add multilang test to testtranslations
This commit is contained in:
parent
e8370769a9
commit
d669b0a3bd
3 changed files with 22 additions and 1 deletions
|
@ -5,12 +5,18 @@ local function send_compare(name, text)
|
||||||
core.get_translated_string("", text), text, core.get_translated_string("fr", text)))
|
core.get_translated_string("", text), text, core.get_translated_string("fr", text)))
|
||||||
end
|
end
|
||||||
|
|
||||||
|
local function send_multilang_compare(name, text)
|
||||||
|
core.chat_send_player(name, ("%s | %s | %s | %s"):format(
|
||||||
|
core.get_translated_string("", text), text,
|
||||||
|
core.get_translated_string("fr_CH:fr", text), core.get_translated_string("fr:fr_CH", text)))
|
||||||
|
end
|
||||||
|
|
||||||
core.register_chatcommand("testtranslations", {
|
core.register_chatcommand("testtranslations", {
|
||||||
params = "",
|
params = "",
|
||||||
description = "Test translations",
|
description = "Test translations",
|
||||||
privs = {},
|
privs = {},
|
||||||
func = function(name, param)
|
func = function(name, param)
|
||||||
core.chat_send_player(name, "Please ensure your locale is set to \"fr\"")
|
core.chat_send_player(name, "Please ensure your locale is set to \"fr_CH\"")
|
||||||
core.chat_send_player(name, "Untranslated | Client-side translation | Server-side translation (fr)")
|
core.chat_send_player(name, "Untranslated | Client-side translation | Server-side translation (fr)")
|
||||||
send_compare(name, S("Testing .tr files: untranslated"))
|
send_compare(name, S("Testing .tr files: untranslated"))
|
||||||
send_compare(name, S("Testing .po files: untranslated"))
|
send_compare(name, S("Testing .po files: untranslated"))
|
||||||
|
@ -22,5 +28,9 @@ core.register_chatcommand("testtranslations", {
|
||||||
send_compare(name, NS("@1: .po singular", "@1: .po plural", i, tostring(i)))
|
send_compare(name, NS("@1: .po singular", "@1: .po plural", i, tostring(i)))
|
||||||
send_compare(name, NS("@1: .mo singular", "@1: .mo plural", i, tostring(i)))
|
send_compare(name, NS("@1: .mo singular", "@1: .mo plural", i, tostring(i)))
|
||||||
end
|
end
|
||||||
|
core.chat_send_player(name, "Untranslated | Client-side translations" ..
|
||||||
|
" | Server-side translation (fr_CH:fr) | Server-side translation (fr:fr_CH)")
|
||||||
|
send_multilang_compare(name, S("Testing translation with multiple languages"))
|
||||||
|
send_multilang_compare(name, S("Testing French-only translation: untranslated"))
|
||||||
end
|
end
|
||||||
})
|
})
|
||||||
|
|
|
@ -20,3 +20,11 @@ msgstr "Testing fuzzy .po entry: translated (wrong)"
|
||||||
|
|
||||||
msgid "Testing .po without context: untranslated"
|
msgid "Testing .po without context: untranslated"
|
||||||
msgstr "Testing .po without context: translated"
|
msgstr "Testing .po without context: translated"
|
||||||
|
|
||||||
|
msgctxt "testtranslations"
|
||||||
|
msgid "Testing translation with multiple languages"
|
||||||
|
msgstr" Testing translation: translated in standard French"
|
||||||
|
|
||||||
|
msgctxt "testtranslations"
|
||||||
|
msgid "Testing French-only translation: untranslated"
|
||||||
|
msgstr "Testing French-only translation: translated"
|
||||||
|
|
|
@ -0,0 +1,3 @@
|
||||||
|
msgctxt "testtranslations"
|
||||||
|
msgid "Testing translation with multiple languages"
|
||||||
|
msgstr "Testing translation: translated in Swiss French"
|
Loading…
Add table
Add a link
Reference in a new issue