我正试图使用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 })`;
我该如何解决此问题?
在others
和others
应为other
之前不应存在逗号。此外,我们可以将{one other}
更改为{# other}
,因为这更为优化。
`t9n("{count, plural, one {# other} other {# others}}", { count: userIds.length - 1 });`