wesnoth / wesnoth

An open source, turn-based strategy game with a high fantasy theme.
https://www.wesnoth.org/
GNU General Public License v2.0
5.42k stars 996 forks source link

Tutorial S02: i18n and dialogs with unit types as titles #6033

Open stevecotton opened 3 years ago

stevecotton commented 3 years ago

The tutorial has dialogs that appear when the first Shaman or Archer is recruited, which use the unit type. The msgids are simply Elvish Shaman and Elvish Archer in the wesnoth-tutorial textdomain, notably the msgid for the archer's dialog doesn't reflect the newly recruited unit's gender despite being next to the newly-recruited unit's portrait photo.

In the German translation, @sevu worked around this by translating Elvish Archer as $unit.language_name, but this seems messy. We should probably do that in en_US too, or change the msgid to something that's more reasonable to translate to that. Rewriting the title to refer to the unit type in the plural might also be the way to go.

I'm working on a tool which noticed that $unit is used in the translated text despite not being in the msgid. https://github.com/wesnoth/wesnoth/issues/4436#issuecomment-900544578

CelticMinstrel commented 3 years ago

I think $unit.language_name works when used as a title, but I don't think it even needs to be a translatable string in that case. After all, language_name is itself the translatable string, so just set caption=$unit.language_name. (Or if this is internal to the [message] tag, whatever the equivalent is in Lua.)