-
Notifications
You must be signed in to change notification settings - Fork 129
Adding and Deleting Translation Keys
When creating a pull request that introduces new translation keys, it is important that the new keys will eventually be added to the corresponding LocaleApp project of the repository.
-
Provide translations of all new keys for all supported locales (at the moment
enandde) by placing files in theconfig/locales/newdirectory:# config/locales/new/my_feature.en.yml en: pageflow: my_new_key: "A Translation" # config/locales/new/my_feature.de.yml de: pageflow: my_new_key: "Eine Übersetzung" -
Use the decomposed gem name as a key prefix, i.e. if you are adding a translation key for the
pageflow-external-linksgem, add keys of the formpageflow.external_links.some_key. -
If a formerly used key is no longer needed, add entries of the following form to both translation files:
# config/locales/new/my_feature.en.yml en: pageflow: some_key: "DELETED"That way they are easy to spot on LocaleApp after import.
After your pull request has been merged, keys from your yaml file will eventually be imported into the LocaleApp project by one of the maintainers. Once translation files have been updated, the new directory will be removed.
If the translation is visible inside published entries, the key has to be added to the pageflow-public-i18n gem. The pull request then has to include an update of the gemspec file to depend on a minor version of the pageflow-public-i18n gem that includes translations for the required key.