我正在尝试使用 int 占位符将文本条目添加到“arb”文件,但没有成功,因为我收到以下错误:
Number format null for the times placeholder does not have a corresponding NumberFormat constructor.
Check the intl library's NumberFormat class constructors for allowed number formats.
Generating synthetic localizations package has failed.
条目如下:
"increment_message": "You have pushed the button this many times: {times}",
"@increment_message": {
"placeholders": {
"times": {
"type": "int",
"example": "123"
}
}
}
我知道其他所有内容都已正确设置,因为将占位符更改为 String 可以正常工作:
"increment_message": "You have pushed the button this many times: {times}",
"@increment_message": {
"placeholders": {
"times": {
"type": "String",
"example": "123"
}
}
}
如果要运行,完整的代码托管在 github 上:
所以我的问题是,如何在 arb 文件上使用整数占位符,这似乎与此有关,NumberFormat
但我不知道如何。