Repository navigation
[tool_crash] _CastError: (#0 LocalizationsGenerator._generateMethod.generateHelperMethods (package:flutter_tools/src/localizations/gen_l10n.dart:1214:54)) #116459
Description
Activity
Here is my l10n.yaml:
arb-dir: lib/l10n template-arb-file: lw_en.arb output-localization-file: lw_localizations.dart output-class: LWLocalizations nullable-getter: false
- addedin triagePresently being triaged by the triage teamPresently being triaged by the triage team
on Dec 5, 2022 I am unable to replicate the issue based on details provided. Keeping it open and labeling for team's attention.
- addedc: crashStack traces logged to the consoleStack traces logged to the consoletoolAffects the "flutter" command-line tool. See also t: labels.Affects the "flutter" command-line tool. See also t: labels.a: internationalizationSupporting other languages or locales. (aka i18n)Supporting other languages or locales. (aka i18n)and removedin triagePresently being triaged by the triage teamPresently being triaged by the triage team
on Dec 5, 2022 After some debugging it seems removing these lines from my arb is fixing the crash:
"profileType": "{level, plural, =0{Novice} =1{Not bad} =2{TODO} =3{Gamer} other{True gamer}}", "@profileType": { "placeholders": { "level": { "description": "The level. Starts from 0", "format": "decimalPattern", "type": "num" } } },
- addedP2Important issues not at the top of the work listImportant issues not at the top of the work list
on Dec 6, 2022 @thkim1011 it seems like this no longer affects the master channel with the new parser, is that correct?
I think this may be a bug. Technically, the
=3orthreecase is not valid syntax, but I forgot to handle this case. I'll make a PR with a fix.@rares45 you might want to consider using a select case instead as follows:
"profileType": "{level, select, level0{Novice} level1{Not bad} level2{TODO} level3{Gamer} other{True gamer}}", "@profileType": { "placeholders": { "level": { "description": "The level. Starts from 0", "format": "decimalPattern", "type": "String" } } },and use the string with
LWLocalizations.of(context).profileType('level$level').Currently, it will throw a syntax error if numbers are used for select cases instead of alphanumeric strings, but I'm working on a fix for this as well.
Reacted by Rares Vanca and Albert Mañosa- addedr: fixedIssue is closed as already fixed in a newer versionIssue is closed as already fixed in a newer version
on Dec 9, 2022 This thread has been automatically locked since there has not been any recent activity after it was closed. If you are still experiencing a similar issue, please open a new bug, including the output of
flutter doctor -vand a minimal reproduction of the issue.- locked as resolved and limited conversation to collaborators
on Mar 5, 2023
Command
Steps to Reproduce
flutter gen-l10n --verboseLogs
_CastError: (#0 LocalizationsGenerator._generateMethod.generateHelperMethods (package:flutter_tools/src/localizations/gen_l10n.dart:1214:54))
Flutter Application Metadata
Type: app
Version: 0.0.1+1
Material: true
Android X: false
Module: false
Plugin: false
Android package: null
iOS bundle identifier: null
Creation channel: beta
Creation framework version: d6260f1
Plugins
dynamic_color-1.5.4
flutter_native_splash-2.2.16
mobile_scanner-2.1.0
package_info_plus-3.0.2