当我使用它的"复数"属性时,如何解决这个"t9n"翻译错误



我正试图使用t9n库翻译一些文本,但我收到了这个错误

Compiling...
Error compiling ICU message for locale en-US: SyntaxError: Expected "=", "}", or identifier but "," found.
To debug this set DEBUG_ICU to 'true'

当我在React JS 中使用这段代码时

`t9n("{count, plural, one {one other}, others {# others}}", { count: userIds.length - 1 })`;

我该如何解决此问题?

othersothers应为other之前不应存在逗号。此外,我们可以将{one other}更改为{# other},因为这更为优化。

`t9n("{count, plural, one {# other} other {# others}}", { count: userIds.length - 1 });`

相关内容

最新更新