Search code examples
flutterunicodelocalizationarb

Non-breaking space in Flutter arb file


I am trying to add the non-breaking space in my arb file in Flutter app, however, I can't find any way to put the Unicode characters to the arb file.

I need something like:

{
  "@@locale": "en",
  "helloWorld": "Hello world!",
}

Is it possible to add custom characters other than \n etc to arb files?


Solution

  • You should be able to use \u00A0 in arb:

      "forceUpgradeButtonText": "Hello\u00A0world",
    

    Then in Dart app_localizations_en.dart:

      @override
      String get forceUpgradeButtonText => 'Hello world';
    

    the character between is NO-BREAK SPACE according to this page