fheroes2
fheroes2 copied to clipboard
Battle journal, waiting and skipping routine should be added for single creature
Preliminary checks
- [X] I've checked that there aren't other open issues on the same topic.
Describe the problem requiring a solution
For a single creature we still have "their" written in battle journal.
Describe the possible solution
An additional string for single creature should be added into battle journal action list: skips his turn, waits.
Additional info
No response
Hi @Branikolog.
Writing "Their" in this case is perfectly fine. In this case it works with singular too actually, because "they" can be used to refer to a single thing in English. Also using His/her/its is too problematic to implement and it also would be very weird in my opinion because "its" feels like it's a soulless being. Ex. The house had all its windows closed.
I would however like to add a "The" before the creature name here, but this should be put in a larger issue regarding typos and grammar stuff of the game's English.
Hi @zenseii In some other languages it is better to divide single form of this phrase from plural one. So, may be, this phrase could be separated into:
- "%{name} skips aturn." for single creatures,
- "%{name} skip their turn." for many creatures. This phrases are located in "battle_interface.cpp" file:
if ( attacker.Modes( TR_HARDSKIP ) ) {
msg = _( "%{name} skip their turn." );
}
else {
msg = _( "%{name} wait their turn." );
}
This code can be changed like this:
if ( attacker.Modes( TR_HARDSKIP ) ) {
msg = _n( "%{name} skips aturn.", "%{name} skip their turn.", attacker.GetInitialCount() );
}
else {
msg = _n( "%{name} waits a turn.", "%{name} wait their turn.", attacker.GetInitialCount() );
}
But this task is not so easy as it appears. In different languages there are different plural forms for concrete numeric value. But here we have only plural form without numeric value. For example: 1 Fenix, 2 Fenixes , 3 Fenixes and so on, and without a number (many Fenixes or alone Fenix) it will be the same. But, for example, in Russian: "1 Феникс", "2 Феникса", ..., "20 Феникосов", "21 Феникс",... They are 21, but "Феникс". And if we remove the numeric value, for ammount of 21 Fenixes it will be: "Фениксы пропускает ход": "Фениксы" - because there are many of them and "пропускает", because 21. The same for Ukrainian and Belarusian languages. So there are two different issues:
- adda a plurar form for these messages in English (this issue)
- change translation mechanism to give different plural forms for names with numeric values and without.
A temporary solution might be:
if ( attacker.Modes( TR_HARDSKIP ) ) {
msg = _n( "%{name} skips a turn.", "%{name} skip their turn.", attacker.GetInitialCount() > 1 ? 2 : 1 );
}
else {
msg = _n( "%{name} waits a turn.", "%{name} wait their turn.", attacker.GetInitialCount() > 1 ? 2 : 1 );
}
Here all creature counts more than 1 are equal to 2, so fo 21 or 31 Fenixes in Russian it will be "Фениксы пропускают ход."

Hi @Districh-ru
A temporary solution might be:
ngettext()/_n() is aware of this (if used properly), it is able to support multiple plural forms depending on language and there is no need in all these additional quirks:
But:
BTW the wrong form for Peasants here is due to the following code with "quirks":
const char * Monster::GetPluralName( uint32_t count ) const
{
const fheroes2::MonsterGeneralStats & generalStats = fheroes2::getMonsterData( id ).generalStats;
return count == 1 ? _( generalStats.name ) : _( generalStats.pluralName );
}
instead of using _n( ... ) which is aware of language plural rules. Not to mention the fact that the current system has no idea about the word cases :)
Hi @oleg-derevenetz
Introducing the word cases to system is also a complicated task :)
As we can see Monster::GetPluralName gives 'generalStats.name' for 1 creature, oterwise it gives 'generalStats.pluralName'
This is not suitable for all cases and can be fixed using return _n( generalStats.name, generalStats.pluralName, count );
This fix will require major changes to the translation files(
But also I want to mention that we have 2 types of phrases:
- phrases with numerical values that use _n(...) rules, for example: '21 крестьянин погиб',
- phrases without numerical values,, for which it is necessary to use a rule like in "Monster::GetPluralName", for example: 'Крестьяне погибли'. In English languge these two rules are the same.
Hi @Districh-ru
This is not suitable for all cases and can be fixed using
return _n( generalStats.name, generalStats.pluralName, count );
This cannot be fixed this way, because xgettext tool will not be able to parse this properly and add the information to the POT that there are plurals needed - it expects strings as its arguments, not names of variables.
But also I want to mention that we have 2 types of phrases:
- phrases with numerical values that use _n(...) rules, for example: '21 крестьянин погиб',
- phrases without numerical values,, for which it is necessary to use a rule like in "Monster::GetPluralName", for example: 'Крестьяне погибли'. In English languge these two rules are the same.
Yes, that's exactly that problem with word cases which I had in mind.