FS#1104 - Neglecting genders of industry names

Attached to Project: OpenTTD
Opened by Meush (Meush) - Sunday, 05 August 2007, 11:30 GMT
Type Bug
Category Interface
Status Closed
Assigned To No-one
Operating System All
Severity Low
Priority Normal
Reported Version 0.5.2
Due in Version Undecided
Due Date Undecided
Percent Complete 100%
Votes 0
Private No


Hello, I found the bug some time ago (a year?) and reported it on IRC, but its case was dropped because it is very rare - it concerns creating new industries, which doesn't happen frequently in-game.

Now, when prospecting an industry is possible, I'd like to remind you, developers about a bug in a code, which, I think, exists.

The problem is that gender of industry is not taken under account when preparing string STR_482D_NEW_UNDER_CONSTRUCTION or STR_482E_NEW_BEING_PLANTED_NEAR.
Here is how do the strings look like:

{BLACK}{BIGFONT}New {STRING} under construction near {TOWN}!
{BLACK}{BIGFONT}Rozpoczęto budowę nowe{G go j go} {STRING.d} blisko {TOWN}!
{BLACK}{BIGFONT}New {STRING} being planted near {TOWN}!
{BLACK}{BIGFONT}Now{G y a e} {STRING} został{G "" a o} posadzon{G y a e} blisko {TOWN}!

Industry name gets changed to a proper case (.d), however, the gender is always set to male - first.
So there is always nowego/nowy/posadzony instead of nowej/nowa/posadzona or nowego/nowe/nowe

Here are strings that contain industry names:

{BLACK}{TINYFONT}{G=f}Kopalnia węgla
{BLACK}{G=f}Kopalnia Węgla
{G=f}Kopalnia Węgla

As you see, all strings contain proper gender setting (in this case it's female - the second gender), but the output string is created with male gender.

More info about genders:

This bug report may be clumsy and ambiguous, so please feel free to leave comments, to which I'll reply
This task depends upon

Closed by  Remko Bijker (Rubidium)
Sunday, 05 August 2007, 14:09 GMT
Reason for closing:  Fixed
Additional comments about closing:  In r10792. At least the code changes, the langfile changes (adding two 0s) are still to be done via WT2.
Comment by Remko Bijker (Rubidium) - Sunday, 05 August 2007, 11:36 GMT
Looking at the strings it gives me the following "feeling"; I've not tested it nor looked at the code:
Looks like it always looks at the gender of the string in front of it and because there isn't a string in front of it, the gender is the first one (i.e. male). Though that does not give a reason why the posadzon* one fails, though getting the gender once might reset it too.
Comment by Meush (Meush) - Sunday, 05 August 2007, 11:45 GMT
I always had impression that industry related strings are awkward, beginning from industry name (like "{TOWN} {INDUSTRY}") in industry window and subsidies. But that's different topic.
Rubidium, would you like me to rearrange curly brackets to trace the problem? How to rearrange them?
Comment by Remko Bijker (Rubidium) - Sunday, 05 August 2007, 13:49 GMT
It's caused by the cases; the cases push the gender information further into the string and places a "string with cases" marker at the beginning of the string, where the gender determination algorithm expects the gender information to be.
Comment by Meush (Meush) - Sunday, 05 August 2007, 13:56 GMT
That's great you found it, may we expect a fix soon? :)

Just for clearness, my strings have gender information also in cases:
{BLACK}{TINYFONT}{G=f}Kopalni węgla
Comment by Remko Bijker (Rubidium) - Sunday, 05 August 2007, 14:01 GMT
Ok, I think I've solved it. It was a combination of my first hunch and the cases issue. Genders are always retrieve of the next string unless you override that by defining the string (index) to override. As you can see in the next line, I've added the two 0s, so they take the gender of {STRING} instead of town.
For the sake of this test I've given forest (Las) a sexchange, so it is female in this example.

STR_482E_NEW_BEING_PLANTED_NEAR :{BLACK}{BIGFONT}Now{G y a e} {STRING} został{G 0 "" a o} posadzon{G 0 y a e} blisko {TOWN}!
now gives me "Nowa Las została posadzona blisko {TOWN}!". Is that correct (Las is female in this case).
Comment by Meush (Meush) - Sunday, 05 August 2007, 14:04 GMT
Yes, that's right :)
I will edit these strings soon.

Is change in code required, or editing strings alone will do the job?
Comment by Remko Bijker (Rubidium) - Sunday, 05 August 2007, 14:07 GMT
Code changes are also required, but they'll most likely get to trunk before your changed strings do.