Add support for string cases in strings.xml (gendered Rescued/Missing)

I wanted to not complicate the system with different string cases (like
cgettext) if possible, and I have been able to keep the main strings a
simple English=Translation mapping thus far, but apparently strings
like "Rescued!" (which are one string in English), have to be
translated for the correct gender in some languages. So this was a good
time to add support for string cases anyway.

It's a number that can be given to a string to specify the specific
case it's used, to disambiguate identical English keys. In the case of
"Rescued!" and "Missing...", male versions of the string are case 1,
female versions are case 2, and Viridian being missing is case 3. Of
course, if a language doesn't need to use different variants, it can
simply fill in the same string for the different cases.

If any other string needs to switch to different cases: distinguish
them in the English strings.xml with the case="N" attribute (N=1 and
higher), sync language files from the translator menu (existing
translations for the uncased string will simply be copied to all cases)
and change loc::gettext("...") to loc::gettext_case("...", 1),
loc::gettext_case("...", 2), etc.
This commit is contained in:
Dav999-v
2022-12-01 01:27:30 +01:00
committed by Misa Elizabeth Kai
parent d147206c54
commit 795bdf886b
11 changed files with 137 additions and 34 deletions

View File

@@ -445,8 +445,11 @@
<string english="[ GRAVITRON ]" translation="" explanation="in-game menu" max="40"/>
<string english="NO SIGNAL" translation="" explanation="map screen. So like a TV/computer monitor" max="29"/>
<string english="Press ACTION to warp to the ship." translation="" explanation="spaceship. Warp = teleport" max="38*7"/>
<string english="Missing..." translation="" explanation="this crew member is missing" max="15"/>
<string english="Rescued!" translation="" explanation="this crew member is not missing anymore" max="15"/>
<string english="Missing..." translation="" case="1" explanation="this male crew member is missing" max="15"/>
<string english="Missing..." translation="" case="2" explanation="this female crew member is missing" max="15"/>
<string english="Missing..." translation="" case="3" explanation="Viridian is missing (final level). You could even fill in something like `Uh-oh...` here if you really have to specify gender otherwise - everyone else is rescued, but the player is missing" max="15"/>
<string english="Rescued!" translation="" case="1" explanation="this male crew member is not missing anymore" max="15"/>
<string english="Rescued!" translation="" case="2" explanation="this female crew member is not missing anymore" max="15"/>
<string english="(that&apos;s you!)" translation="" explanation="this crew member is you (Viridian)" max="15"/>
<string english="Cannot Save in Level Replay" translation="" explanation="in-game menu" max="38*7"/>
<string english="Cannot Save in No Death Mode" translation="" explanation="in-game menu" max="38*7"/>