Skip to content

[gen_l10n] Why doesn't isCustomDateFormat accept an actual boolean? #153420

@kzrnm

Description

@kzrnm

Steps to reproduce

  1. Create a project as follows
  2. flutter gen-l10n
<root>
├── pubspec.yaml
└── lib
    └── l10n
        └── app_en.arb

pubspec.yaml

name: gen_l10n
publish_to: "none"
version: 1.0.0+1
environment:
  sdk: ^3.5.0
dependencies:
  flutter:
    sdk: flutter
  flutter_localizations:
    sdk: flutter

dev_dependencies:
  flutter_test:
    sdk: flutter
flutter:
  generate: true

app_en.arb

{
  "@@locale": "en",
  "springBegins": "Spring begins on {springStartDate}",
  "@springBegins": {
    "description": "The first day of spring",
    "placeholders": {
      "springStartDate": {
        "type": "DateTime",
        "format": "asdf",
        "isCustomDateFormat": true
      }
    }
  }
}

Or running the following shell script.

# Set up
# In empty directory

# Init
flutter create . --platforms=web
mkdir -p lib/l10n

# Setup Localization
echo 'name: gen_l10n
publish_to: "none"
version: 1.0.0+1
environment:
  sdk: ^3.5.0
dependencies:
  flutter:
    sdk: flutter
  flutter_localizations:
    sdk: flutter

dev_dependencies:
  flutter_test:
    sdk: flutter
flutter:
  generate: true
' >  pubspec.yaml

echo '{
  "@@locale": "en",
  "springBegins": "Spring begins on {springStartDate}",
  "@springBegins": {
    "description": "The first day of spring",
    "placeholders": {
      "springStartDate": {
        "type": "DateTime",
        "format": "asdf",
        "isCustomDateFormat": true
      }
    }
  }
}' > lib/l10n/app_en.arb

flutter pub get

# gen-l10n
flutter gen-l10n

Expected results

AppLocalizations is generated.

Actual results

The "isCustomDateFormat" value of the "springStartDate" placeholder in message springBegins must be a boolean value.

Code sample

Code sample
[Paste your code here]

Screenshots or Video

No response

Logs

No response

Flutter Doctor output

Doctor output
[Paste your output here]

Metadata

Metadata

Assignees

No one assigned

    Labels

    a: internationalizationSupporting other languages or locales. (aka i18n)found in release: 3.24Found to occur in 3.24frameworkflutter/packages/flutter repository. See also f: labels.has reproducible stepsThe issue has been confirmed reproducible and is ready to work onr: fixedIssue is closed as already fixed in a newer versionteam-toolOwned by Flutter Tool teamtoolAffects 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