0

我正在尝试使用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 })`;

我该如何解决这个问题?

4

1 回答 1

0

几个错误逗号之前不应该存在othersothers应该存在other。我们也可以更改{one other}为,{# other}因为这是更优化的。

`t9n("{count, plural, one {# other} other {# others}}", { count: userIds.length - 1 });`
于 2020-03-09T10:49:42.950 回答