Learn how to deal with a large number of keys and technical restrictions in complex translation projects.
Managing keys is one of the most relevant tasks when dealing with localization files and translations. Phrase provides useful tools and mechanisms to deal with a large number of keys and technical restrictions in complex translation projects.
Phrase allows you to blacklist keys. Blacklisted Keys will be ignored when:
- pushing / uploading translations
- pulling / downloading translations
- working within the Phrase In-Context Editor
While blacklisting prevents whole keys from being managed in Phrase, you also can exclude individual keys from being translated into certain languages. Please refer to the section Excluding translations below.
The blacklist is a powerful tool to handle issues with keys that should be managed manually rather than editable by everyone. Examples for blacklisted keys are:
- date and time format strings
- keys that include configuration
- keys that cause issues when being managed with the phrase gem
A best practice would be to add those keys to your blacklist and manage them in a separate language file in your application that is not processed or maintained by Phrase.
Because we know that there are some keys that cause issues when used with Phrase (especially in setups with Ruby on Rails), we add several keys to the blacklist when creating a new project, e.g
If you only want to exclude keys from being picked up by the In-Context-Editor but still manage them with Phrase, you should consider the ignored keys setting.
In some cases you might want to exclude keys only in certain languages. For this Phrase allows you to mark certain translations as excluded. A excluded translation will:
- be excluded from export of the related language.
- be excluded from the related language reports (Even if the content is empty it is not counted as untranslated).
- be visible but not editable in the translation editor.
While excluding individual keys prevents them from being translated into certain languages, blacklisting prevents whole keys from being managed in Phrase. Please refer to the Blacklisting keys section above.
You have two options to exclude translations for a key:
- exclude a single translation in a language within the translation editor.
- exclude multiple translations in a language within the translation editor.
- exclude multiple translations by selecting the languages when creating or editing the key.
Phrase lets you set the number of characters a translation can contain. The character limit can be set under the “Advanced” tab when editing a key. When a maximum number of characters is defined, the character count will be displayed when editing translations for that key.
Deleting unused keys
If you have made a lot of changes in your localization file or removed whole features from your application and want to delete keys only attached to these features, you probably want to remove these “orphaned” keys from the list of keys in Phrase as well. You can identify keys that no longer occur in your (main) localization file by uploading the file again to Translation Center via the browser.
After uploading the file you should see an indicator of how many keys are no longer mentioned in the main file in the “Keys unmentioned” column. Click on the “Delete unmentioned keys” button to get an overview of the keys that you might want to delete. Click the delete button to remove all of them in one step.
How can I delete all keys from my project?
You can access the Keys section of your project and delete keys from there. You will find an option to delete all keys there (in sets of 1000 keys at once). Alternatively, you can use an API request as well. Please follow the link to our API documentation: Delete a collection of keys
How can I delete a collection of keys based on their tag?
You can select multiple keys and delete your selection. Filter your search after the specific tag and select all those keys. You can now select the delete checkbox. You can also use our API, using the tag as a parameter for the query. Please follow the link to our API documentation: Delete a collection of keys
How can we search for specific keys when reviewing the translations?
To search keys when reviewing translations, you can either use jobs to assign the reviewer only certain keys or you can use the search bar in the translation center, where you can filter your search.