A tool to convert excel to l10n files.
dart pub add dev:excel2l10n
-
Create a file named
excel2l10n.yaml
in your project root like this:platform: # Currently only supports feishu name: feishu # Get it on https://open.feishu.cn/ app_id: cli_xxxxxxxxxxxxxxxx # Get it on https://open.feishu.cn/ app_secret: xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx # It's your spreadsheet's token, usually in your spreadsheet url, # like https://xxxxxxxxxx.feishu.cn/sheets/:spreadsheet_token spreadsheet_token: xxxxxxxxxxxxxxxxxxxxxxxxxxx # Currently supports getx and arb target: arb # The output directory output_dir: output
If your target has additional settings, you can add them in the
target
section like this:target: name: arb # Other settings
-
Details for target arb:
genL10nYaml: true
: Whether to generatel10n.yaml
file.
-
Details for target localizations:
- No need to generate
.arb
file, directly generate.dart
file. - Generate
TextSpan
forplaceholders
. It means you can useText.rich
to display the value.
- No need to generate
-
-
Your table should look like this:
key description en zh ... hello Greeting in home page Hello! 你好! ... The front two columns are required, and the rest are languages you want to support.
Do not have empty columns in the middle.
-
Run the following command in your terminal:
dart run excel2l10n