【发布时间】:2022-01-01 04:10:29
【问题描述】:
我正在尝试使用 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"
}
}
}
我知道其他所有设置都已正确设置,因为将占位符更改为字符串可以正常工作:
"increment_message": "You have pushed the button this many times: {times}",
"@increment_message": {
"placeholders": {
"times": {
"type": "String",
"example": "123"
}
}
}
如果你想运行,完整的代码托管在 github 上:
所以我的问题是,如何在 arb 文件上使用整数占位符,这似乎与 NumberFormat 有关,但我不知道如何。
【问题讨论】:
标签: flutter localization integer intl flutter-localizations