mirror of
https://github.com/luanti-org/luanti.git
synced 2026-01-08 10:15:36 +01:00
Gettext and plural support for client-side translations (#14726)
--------- Co-authored-by: Ekdohibs <nathanael.courant@laposte.net> Co-authored-by: y5nw <y5nw@protonmail.com> Co-authored-by: rubenwardy <rw@rubenwardy.com>
This commit is contained in:
@@ -0,0 +1,9 @@
|
||||
# Dummy entry. This is a test to make sure that a parser error is not thrown
|
||||
# if the following line is msgctxt.
|
||||
msgctxt "testtranslations"
|
||||
msgid "Dummy entry"
|
||||
msgstr "Dummy result"
|
||||
|
||||
# Used for translating the mod title
|
||||
msgid "Test translations"
|
||||
msgstr "Test translations (French)"
|
||||
BIN
games/devtest/mods/testtranslations/locale/translation_mo.fr.mo
Normal file
BIN
games/devtest/mods/testtranslations/locale/translation_mo.fr.mo
Normal file
Binary file not shown.
@@ -0,0 +1,22 @@
|
||||
# Test Plural-Forms parsing
|
||||
msgid ""
|
||||
msgstr ""
|
||||
"Plural-Forms: nplurals=2; plural= (n-1+1)<=1 ? n||1?0:1 : 1?(!!2):2;"
|
||||
|
||||
msgctxt "testtranslations"
|
||||
msgid "Testing .po files: untranslated"
|
||||
msgstr "Testing .po files: translated"
|
||||
|
||||
msgctxt "testtranslations"
|
||||
msgid "@1: .po singular"
|
||||
msgid_plural "@1: .po plural"
|
||||
msgstr[0] "@1: .po 0 and 1 (French singular)"
|
||||
msgstr[1] "@1: .po >1 (French plural)"
|
||||
|
||||
#, foo bar fuzzy
|
||||
msgctxt "testtranslations"
|
||||
msgid "Testing fuzzy .po entry: untranslated (expected)"
|
||||
msgstr "Testing fuzzy .po entry: translated (wrong)"
|
||||
|
||||
msgid "Testing .po without context: untranslated"
|
||||
msgstr "Testing .po without context: translated"
|
||||
@@ -0,0 +1,2 @@
|
||||
# textdomain: testtranslations
|
||||
Testing .tr files: untranslated=Testing .tr files: translated
|
||||
Reference in New Issue
Block a user