1

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?

Marcin Szałek
  • 4,609
  • 5
  • 30
  • 43

1 Answers1

6

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

Dominik Roszkowski
  • 2,715
  • 1
  • 19
  • 46
  • "countries": "{choice, select, United States {United States} United Kingdom {United Kingdom} other {None}}", How to solve the spacing issue in the option United States or United Kingdom?? – Omar Fayad Sep 02 '23 at 12:42