Reputation: 1067
code:
Strings.arb
"priceSign": "S$",
i18n.dart
String priceSign(String ) => "S$";//Expected an identifier error
How can i add localization for such a string in flutter.I can't able to create such a String in arb file and generate i18n.
ANyone help me resolve this issue.
Upvotes: 1
Views: 1292
Reputation: 447
In your ARB files you don't need to escape $
, but in your dart getter code you should.
Strings.arb:
"priceSign": "S$",
i18n.dart:
String priceSign(String ) => "S\$";
If you use intl_translation tool, it will map it properly between those two formats.
Upvotes: 0
Reputation: 2182
You can define as below.
"price_sign" : "\$"
Its show red under line but you can ignore it and run application. It will work.
Upvotes: 2