--- applyTo: "app/i18n/*/*.php" description: Editing FreshRSS translations --- # FreshRSS translations (i18n) * Favour commands over manual edits to add, move, or delete translation keys: * Use the `cli/manipulate.translation.php` script or the corresponding `make` commands. ## Commands ### Add a new translation key To add a new translatable string across all languages: ```sh ./cli/manipulate.translation.php --action add --key 'example.of.key' --value 'Example of text' # or make i18n-add-key key='example.of.key' value='Example of text' ``` This will: 1. Add the key to English (`app/i18n/en/gen.php`) with the provided value 2. Add the key to all other languages marked as `// TODO` for translators You should then: 1. Remove the `// TODO` comment in English `en/` 2. Update to `// IGNORE` comment in US English `en-US/` or adapt the string in case of regional differences ### Delete a translation key To delete a translation key from all languages: ```sh ./cli/manipulate.translation.php --action delete --key 'old.key.path' ``` ### Other commands See all available commands with: ```sh ./cli/manipulate.translation.php -a --help ``` ## Post-fixing After manipulating translation, you should call the following to reformat and ensure consistency: ```sh composer run-script translations # or (targeting more than just translations) make fix-all ```