Translations ************* Translator-UX: one source of truth ================================== The Translator-ux integration streamlines the process of managing and using translation keys dynamically in our views, whether they be in twig or vue components. The goal is to have one source of truth for all translations and avoid having to add translation keys in the YAML files as well as in i18ns files. To add new translation keys, you can define them in your translation YAML files. Running `symfony console cache:clear` will subsequently update the compiled translation keys which can then also be imported and used within any vue component. For use within a twig template they can be leveraged by using the |trans function. Within vue components you will have to import the translation keys you require and then they can be used in the template with the trans() function. It is advisable, before adding a translation key to do a search on the existing translation keys of the translation you require. An IDE will allow you to do so easily. However to avoid the creation of duplicate translation keys a command also exists to detect them. We also strongly advise you to use this command as explained below. Detect duplicates command ========================= The DetectTranslationDuplicatesCommand `chill:detect-duplicate-translations` is a Symfony console command designed to identify duplicate translations across YAML files in a project. It checks for repeated translation values linked to different keys within a specified locale. The command accepts two main options: 1. `--locale`: to specify the language locale to check (defaulting to 'en') 2. `--exclude-namespaces`: to list namespaces to ignore during the check. 3. [optional] `--verify-hash`: can be used to ensure that the hash of current duplicates matches a given expected value, aiding in maintaining translation integrity. When duplicates are detected, they are displayed in a table format, listing the repeated translations alongside the keys where they are found. If a mismatch occurs between the computed and expected hash values, an error message is displayed to signal a potential issue in translation consistency. This command is useful for maintaining clean and consistent translations, avoiding redundancy in your YAML files.