diff --git a/docs/translating.md b/docs/translating.md index 82a6486..7eebd89 100644 --- a/docs/translating.md +++ b/docs/translating.md @@ -14,7 +14,7 @@ php ./vendor/bin/fbt generate-translations --src=./path/to/.source_strings.json ### Options: | name | default | description | |-------------------------|--------------------------|-------------------------------------------------------------------------------------------------------| -| --src | ./.source_strings.json | Path to colleccted source strings file | +| --src | ./.source_strings.json | Path to collected source strings file | | --translation-input | ./translation_input.json | Path to translation input file | | --translations=`[path]` | *none* | The translation files containing translations.
E.g. `--translations=./path/to/translations/*.json` | @@ -33,6 +33,8 @@ php ./vendor/bin/fbt translate --path=/path/to/storage --translations=/path/to/t | --translations=`[path]` | *none* | The translation files containing translations.
E.g. `--translations=/path/to/translations/*.json` | | --stdin < translation_input.json | *none* | Instead of reading translation files and source file separately, read monolithic JSON file from STDIN | +## JSON schema: + In addition to the below example, the `translation_input.json` provided in our [tests](https://github.com/richardDobron/fbt/blob/main/tests/translations/stdin-data/translation_input.json) is a good reference on the "schema" used for the translations. diff --git a/src/fbt/Services/TranslationsGeneratorService.php b/src/fbt/Services/TranslationsGeneratorService.php index 442bf08..09ab030 100644 --- a/src/fbt/Services/TranslationsGeneratorService.php +++ b/src/fbt/Services/TranslationsGeneratorService.php @@ -178,10 +178,10 @@ public function generateTranslations(string $source, $translationsPath, $inputPa [ 'translation' => '', 'variations' => [], - 'tokens' => [], - 'types' => [], ], ], + 'tokens' => [], + 'types' => [], ]; } }