Avoid clashes between gender selection code and thousand variant flags

Fixes #1420 also Set max_digits to 32 for russian since it's safe to do now.
This commit is contained in:
A11CF0
2022-10-16 22:12:23 +03:00
committed by Alexander Epaneshnikov
parent 941bd2a176
commit c5de4ff6c2
2 changed files with 3 additions and 3 deletions
+2 -2
View File
@@ -1316,7 +1316,7 @@ static int LookupNum3(Translator *tr, int value, char *ph_out, bool suppress_nul
if (LookupThousands(tr, hundreds / 10, tplex, exact | ordinal, ph_10T) == 0) {
x = 0;
if (tr->langopts.numbers2 & (1 << tplex))
if (tr->langopts.numbers2 & (1 << tplex) && tplex <= 3)
x = 8; // use variant (feminine) for before thousands and millions
if (tr->translator_name == L('m', 'l'))
x = 0x208;
@@ -1419,7 +1419,7 @@ static int LookupNum3(Translator *tr, int value, char *ph_out, bool suppress_nul
x |= 4; // tens and units only, no higher digits
if (ordinal & 0x20)
x |= 0x20; // variant form of ordinal number
} else if (tr->langopts.numbers2 & (1 << thousandplex))
} else if (tr->langopts.numbers2 & (1 << thousandplex) && thousandplex <= 3)
x = 8; // use variant (feminine) for before thousands and millions
if ((tr->translator_name == L('m', 'l')) && (thousandplex == 1))
+1 -1
View File
@@ -1656,5 +1656,5 @@ static void Translator_Russian(Translator *tr)
tr->langopts.numbers = NUM_DECIMAL_COMMA | NUM_OMIT_1_HUNDRED;
tr->langopts.numbers2 = NUM2_THOUSANDPLEX_VAR_THOUSANDS | NUM2_THOUSANDS_VAR1; // variant numbers before thousands
tr->langopts.max_digits = 18;
tr->langopts.max_digits = 32;
}