RESX to JSON converter.
While migration from Xamarin Forms to Flutter, you'd probably want to convert your localization files to json. This package is the perfect tool for it.
Note: For different extensions (like .arb) change the
extensionoption in your
pubspec.yamlfile. See Usage
You don't have to add any dependency to your project. Just activate
pub global activate resx_to_json
- Add a new section
An example with all options:
resx_to_json: # The directory containing resx files. The path can be relative or absolute. source: C:\Users\Mazlum\source\repos\_MergeSoft\AsoGotin\AsoGotin\Properties # The directory where the generated json files will be saved in. The path can be relative or absolute. destination: assets/localization/ # Indicates whether the keys in json files should be sorted alphabetically. (Optional, default: true) sort: true # The extension for the generated json files. For example `arb`. (Optional, default: 'json') extension: json # Regex patterns for renaming resx files. (Optional) # Notice that the search is case-sensitive # <regex_pattern> => <replacement> replacements: - Resources\.resx => en.json - Resources\.([a-z]+)\.resx => $1.json # $1 is the 1. match group. e.g. Resources.de.resx is renamed to de.json
- Run this command inside your flutter project root.
pub global run resx_to_json