Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/mergehez/dart_resx_to_json
RESX to JSON converter. Xamarin to Flutter migration
https://github.com/mergehez/dart_resx_to_json
dart flutter json localization migration resx translation xamarin
Last synced: about 1 month ago
JSON representation
RESX to JSON converter. Xamarin to Flutter migration
- Host: GitHub
- URL: https://github.com/mergehez/dart_resx_to_json
- Owner: mergehez
- Created: 2022-03-23T15:14:25.000Z (almost 3 years ago)
- Default Branch: master
- Last Pushed: 2023-05-26T06:39:32.000Z (over 1 year ago)
- Last Synced: 2024-03-21T04:20:33.108Z (10 months ago)
- Topics: dart, flutter, json, localization, migration, resx, translation, xamarin
- Language: Dart
- Homepage:
- Size: 13.7 KB
- Stars: 0
- Watchers: 2
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
RESX to JSON converter. [![Pub Package](https://img.shields.io/pub/v/resx_to_json.svg)](https://pub.dev/packages/resx_to_json)
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 `extension` option in your `pubspec.yaml` file. See [Usage](#usage)
## Installation
You don't have to add any dependency to your project. Just activate `resx_to_json` globally:```shell
pub global activate resx_to_json
```## Usage
1. Add a new section `resx_to_json` to your `pubspec.yaml` file.
An example with all options:
```yaml
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# The file where all keys in resx files are written as static properties. (Optional, default: 'lib/helpers/json_keys.dart')
json_keys_path: lib/utils/json_keys.dart# Regex patterns for renaming resx files. (Optional)
# Notice that the search is case-sensitive
# =>
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
```2. Run this command inside your flutter project root.
```shell
pub global run resx_to_json
```