Add a way to edit ARB files (terms export, files synchronization)
See original GitHub issueIs your feature request related to a problem? Please describe.
With new l10n approach the only thing to worry about is to update .arb files in l10n
directory. It’s not ideal to edit the files manually and keep them in sync between various languages.
Describe the solution you’d like
As a user I would love to be able to:
- have a quick action to export selected string to template arb file
- automatically sync the terms between all present files (e.g. after adding to template, there should be new entries for all the other languages with empty values)
- add new arb file for desired language (e.g. by providing language code in prompt) that would automatically have all the entries present and empty
- notify me about missing translation entries when opening arb files (e.g. as analyzer info messages)
Describe alternatives you’ve considered
Similar feature is possible with Flutter Intl VS Code extension but it’s tightly coupled with their localization system (e.g. generating custom localization delegate, sync with remote server).
Issue Analytics
- State:
- Created 3 years ago
- Reactions:2
- Comments:9 (4 by maintainers)
Top Results From Across the Web
No results found
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Sorry for the long delay with this. I discussed this with someone on the Dart team and agreed the place to do something like this would be in the analysis server, by having it know about these arb files and be able to produce edits to add strings to them.
I’ve raised an issue at https://github.com/dart-lang/sdk/issues/46722 with some details from this issue (feel free to add anything I missed) and will close this one in favour of that. It would be quite difficult to do directly here in the extension as it doesn’t have a good AST of the code (plus any solution here would only work for VS Code and not IntelliJ/Android Studio or any of the other LSP clients). Hope this makes sense!
No, it’s something different. This assumes that there’s a class containing
intl
-based entries like:However, with new l10n approach there’s no longer need to generate these manually, as it’s done by the
flutter_localizations
in the background (these localization files are generated in.dart-tool
directory afterpub get
, and the source files are based on thel10n.yaml
config file andarb
files in specified directory).What I would like to have can be shown in this video:
https://user-images.githubusercontent.com/16854239/106932265-d4fa1500-6717-11eb-8fe8-b88511fa36b7.mp4
This action would result in new entry added in arb file, triggering
flutter_localizations
to regenerate localization classes, and string being replaced by this new key.I started to play around on my own with sample VS Code extension to do it, but it would be awesome to have official support to even further simplify the localization process.