Skip to content

[gen_l10n] A name that has any dollar sign ($) isn't allowed. #112250

@liplum

Description

@liplum

flutter_localizations(gen_l10n comamnd) doesn't allow a property name to have a dollar sign ($) in any postion.

Steps to Reproduce

  1. Execute flutter gen-l10n involved in any *.arb file which has a key that contains a dollar sign ($).
  2. Loot at the terminal output.

Expected results: Dollar sign can be a part of the property name, so it should succeed.

Actual results: gen-l10n failed.

Code sample

In app_en.arb file:

{
  "$address": "Address:"
}

Logs

Invalid ARB resource name "$address" in LocalFile: '<ProjectFolder>\lib/l10n\app_en.arb'.
Resources names must be valid Dart method names: they have to be camel case, cannot start with a number or
underscore, and cannot contain non-alphanumeric characters.

Metadata

Metadata

Assignees

No one assigned

    Labels

    P2Important issues not at the top of the work lista: internationalizationSupporting other languages or locales. (aka i18n)found in release: 3.3Found to occur in 3.3found in release: 3.4Found to occur in 3.4has reproducible stepsThe issue has been confirmed reproducible and is ready to work ontoolAffects 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