tl;dr: Please, remove unnecessary code leading to exceptions
Currently I’m working on a game localization using Unity Localization package, and I’ve encountered quite strange behaviour of a plural formatter.
Chinese language doesn’t have different words for plural form. So, I expect following phrases to be handled the same
Make combo {0:plural:1 time|{} times}
完成 次组合 {0:plural:{} 次}
However, plural formatter breaks and throws exceptions. To be more specific it breaks due to a following check in the PluralLocalizationFormatter
public override bool TryEvaluateFormat(IFormattingInfo formattingInfo)
{
//...
This extension requires at least two plural words:
if (pluralWords.Count == 1) return false;
//...
}
I understand, that using plural formatter when there is actually no plurals in the language might appear like a nonsensable behaviour, but I believe keeping the consistency here is better.
Besides UnityEngine.Localization.SmartFormat.Utilities.PluralRules actually contains logic for handling Singular plural forms.
So, is that possible to remove that line on your side?