Skip to content

[gen_l10n.dart] .arbdescriptions get mistaken as code #115295

@hanneskoksch

Description

@hanneskoksch

Descriptions of Strings in .arb files including line breaks (\n) get mistaken as code.

The file translations_en.arb

{
    "welcome": "Welcome to the app",
    "@welcome": {
        "description": "This message gets displayed on the first page.\nUse it in caps.",
        "type": "text"
    },
}

...results in app_localizations.dart

  /// This message gets displayed on the first page.
Use it in caps.
  ///
  /// In en, this message translates to:
  /// **'Welcome to the app'**
  String get welcome;

Instead, I would expect this result:

  /// This message gets displayed on the first page.\nUse it in caps.
  ///
  /// In en, this message translates to:
  /// **'Welcome to the app'**
  String get welcome;

or

  /// This message gets displayed on the first page.
  /// Use it in caps.
  ///
  /// In en, this message translates to:
  /// **'Welcome to the app'**
  String get welcome;

I can see, that the error occurs here:

final String comment = message.description ?? 'No description provided for @${message.resourceId}.';

Metadata

Metadata

Assignees

Labels

P2Important issues not at the top of the work lista: buildBuilding flutter applications with the toola: internationalizationSupporting other languages or locales. (aka i18n)c: crashStack traces logged to the consolefound in release: 3.3Found to occur in 3.3found in release: 3.6Found to occur in 3.6has reproducible stepsThe issue has been confirmed reproducible and is ready to work onr: fixedIssue is closed as already fixed in a newer versiontoolAffects the "flutter" command-line tool. See also t: labels.

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions