april_json_translator 0.1.0
april_json_translator: ^0.1.0 copied to clipboard
A tool that can translate json files from one language to another.
Getting started #
Run flutter pub global activate april_json_translator in project Terminal for activate this tool.
Usage #
- Add this in your project pubspec.yaml with top level.
april_json_translator:
source_code: 'en'
target_codes: 'zh'
source_file_path: 'lib/l10n/intl_en.arb'
file_prefix: 'intl_'
file_suffix: '.arb'
- Run
flutter pub global run april_json_translator:generatein project Terminal for translate your json file with this tool.
In the above example, en and zh are both the code of the language to be translated and the
mid-segment name of the file.After you have finished translating, the file name will be "intl_zh.arb".
You can set like target_codes: 'he:iw' when language code is not the same as your mid-segment name
of file.Then the file name will be "intl_he.arb", and iw will be used for translate.
If you need to translate into multiple languages, you can set like
this target_codes: 'zh:zh-CN,ja,ko' just separate the language codes with ,