Reputation: 1174
Qt QTranslator::translate() documentation declares that
If n is not -1, it is used to choose an appropriate form for the translation (e.g. "%n file found" vs. "%n files found").
It seems that there is no way to translate "%n men answered %n questions" as one string (i.e. I need to perform 2 QTranslator::translate() calls), or am I wrong?
Upvotes: 3
Views: 437
Reputation: 152817
I'd advise against attempting to use multiple numerus forms in a single translatable string.
tr()
.O(n^m)
where n
is the number of numerus forms in language and m
is the number of number forms in your string to be translated string. Case in point: Arabic has six numerus forms and if you have two %n
s in your string, you'll need 36 different translations.So, better to structure your translatable strings so that max one %n
is needed per string.
Upvotes: 5