• Tae Hyung Kim's avatar
    Refactor "gen-l10n" command to use same code path when "l10n.yaml" is present... · 5c44b1df
    Tae Hyung Kim authored
    Refactor "gen-l10n" command to use same code path when "l10n.yaml" is present or not present (#125429)
    
    I think this is a long needed change to the `gen-l10n` command.
    Essentially, the arguments to `flutter gen-l10n` can be provided by two
    different methods: via command line arguments or via the `l10n.yaml`
    file. The existence of a `l10n.yaml` file causes the latter approach to
    take precedence.
    
    However, currently, there's several differences in how the two
    approaches are handled, and most of the default arguments are all over
    the place, causing unexpected issues such as #120457 or #120023.
    
    This PR refactors the command so that
    * `LocalizationOptions` are more consistent with the actual argument
    names/yaml options.
    * All default values are determined in `LocalizationOptions`'s
    constructor (or in `argParser.addOption(...)` in the case a boolean
    value needs to be explicitly true).
    * New `parseLocalizationsOptionsFromCommand` function to parse
    arguments.
    * Parse `LocalizationOptions` at the beginning of `runCommand()` and
    pass it to `generateLocalizations`.
    
    Fixes #120023.
    5c44b1df
Name
Last commit
Last update
.github Loading commit data...
.vscode Loading commit data...
bin Loading commit data...
dev Loading commit data...
examples Loading commit data...
packages Loading commit data...
.ci.yaml Loading commit data...
.cirrus.yml Loading commit data...
.gitattributes Loading commit data...
.gitignore Loading commit data...
AUTHORS Loading commit data...
CODEOWNERS Loading commit data...
CODE_OF_CONDUCT.md Loading commit data...
CONTRIBUTING.md Loading commit data...
LICENSE Loading commit data...
PATENT_GRANT Loading commit data...
README.md Loading commit data...
TESTOWNERS Loading commit data...
analysis_options.yaml Loading commit data...
dartdoc_options.yaml Loading commit data...
flutter_console.bat Loading commit data...