Menu

#3299 Tricky to translate nation on unit name display

Current
open
nobody
None
7
2024-06-30
2022-09-06
Wuzzy
No

(This is partially bug report, partially maintenance, partially feature request.)

In the game, the units, when they are actually deployed in the world, they get labelled like this:

<NATION> <UNIT TYPE> [optional suffix like "(50 horses)"]

So usually this is something like "Frensh Free Colonist" or "English Dragoon". This label is all over the game to refer to a specific deployed unit.

For German, this creates trouble because it translates to "Französisch Freier Kolonist" and "Englisch Dragoner" which is incorrect grammar. Correct would be "Französischer freier Kolonist" and "Englischer Dragoner".

I have recently worked hard on the German translation to fix a ton of mistakes and inconsistencies in it. But this is one problem I can't fix. It seem the unit label syntax is hardcoded and I was unable to track down a translatalbe format string.

So I request to make the unit label translatable, if it isn't already. This would also allow for languages to change the order of the variable text because this is sometimes neccessary, too.

Version: 0.13.0+dev

Discussion

  • Mike Pope

    Mike Pope - 2022-09-06

    Have a look at Messages.getUnitLabel(). It is ugly, but there are strings there in comments that might be what you are after. Let us know if you think that would work.

     
  • Wuzzy

    Wuzzy - 2022-09-29

    Yeah, it looks exactly as I suspected. Everything is completely hardcoded, and strings are just concatenated. This is poison for translators, no way to work around that from the translator perspective.

    Ideally, all these string constructions would be using some kind of format strings and then be reported to Gettext.

     
    • Mike Pope

      Mike Pope - 2022-09-29

      Yes, I know. What I am trying to ask is whether the comments in the Messages.getUnitLable would work for your use case if we rewrote the function so that it used translatable strings for each case, initially containing those comments for English.

       
  • Wuzzy

    Wuzzy - 2022-10-01

    Yeah, those comments look reasonable if those would be used as format strings. The idea to turn each case into a separate string sounds the most straight-forward to me.

     
  • Stian Grenborgen

    • Priority: 5 --> 7
     

Log in to post a comment.