Skip to content

Add tasks/commands for generation of the l10n from the .arb files #3949

Closed

Description

@TiffApps

Is your feature request related to a problem? Please describe.
We always have to manually generate/regenerate the .arb files with a command in the terminal whenever we edit them, or we clone/pull a project.

Describe the solution you'd like
Like the task in pubspec.yaml that auto runs the command flutter pub get when we save it, I'd like to auto run the command flutter gen-l10n every time I save my .arb files. And probably also an icon at the top right of .arb files that does the same, again like the pubspec.yaml. Also, running this command whenever we clone/pull a project (like it does with flutter pub get) would be nice.

Describe alternatives you've considered
Using the command flutter gen-l10n in the terminal everytime we edit .arb files, or clone/pull a project.

Additional context
None.

Activity

  1. added
    is enhancementAn enhancement or improvement that should be listed in release notes but is not a bug fix.
    on May 3, 2022
  2. added this to the v3.42.0 milestone on May 3, 2022
  3. added
    in flutterRelates to running Flutter apps
    in tasksRelates to VS Code tasks, such as those provided by Task Providers
    on May 3, 2022
  4. DanTup commented on May 26, 2022

    @DanTup
    Member

    I've added a new Task and Command (Flutter: Generate Localizations) for this. It'll also show up in the context menu for .arb files (in both explorer and the editor) and in the menu bar when editing a .arb file.

    I haven't yet added support to run it on-save, I've split that into #3993.

  5. changed the title [-]Automatic task for generation of the l10n from the .arb files[/-] [+]Add taskd/commands for generation of the l10n from the .arb files[/+] on May 26, 2022
  6. changed the title [-]Add taskd/commands for generation of the l10n from the .arb files[/-] [+]Add tasks/commands for generation of the l10n from the .arb files[/+] on May 26, 2022
  7. hyungtaecf commented on May 30, 2022

    @hyungtaecf

    I added the Run On Save plugin on VS Code, and then added the following settings to VS Code's settings.json:

    "emeraldwalk.runonsave": {
        "commands": [
          {
            "match": "\\.arb$",
            "cmd": "flutter gen-l10n"
          }
        ]
      },
    

    It works perfectly. 👍

  8. DanTup commented on Jun 22, 2022

    @DanTup
    Member

    In the next release, #3993 adds a new setting that works similar to hot-reload-on-save that will trigger the built-in Flutter: Generate Localizations command:

    Screenshot 2022-06-22 at 18 04 36

  9. added a commit that references this issue on Sep 2, 2025
    a6ce067
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    in flutterRelates to running Flutter appsin tasksRelates to VS Code tasks, such as those provided by Task Providersis enhancementAn enhancement or improvement that should be listed in release notes but is not a bug fix.

    Type

    No type

    Projects

    No projects

      Milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions