Translation Management

Keys (Strings)

Keys are used to identify translatable strings within software code. This allows the key to be referenced once instead of each time the string requires translation to another language. The function is similar to that of the primary key in relational databases with translations being an attribute of the key. Keys are stored in resource files and are used to identify source and target languages.

The use of keys allows localization management platforms to present translatable text to translators without having to present code.

Keys do not normally need to be added to a project as they are ideally created when a resource file is uploaded.

To prevent keys from being picked up by the editor, use the blocking key functionality. To display keys in the editor but prevent them from being translated, use the exclude keys functionality.

Key Naming

Keys names must be unique within one project.

There are a multiple strategies for naming keys:

  • Descriptive

    The original text is identified by function. This may make it harder to identify the text when reading code, but will remain a constant.

    Example:

    Key

    German

    English

    fem_char

    die Frau

    woman

    male_char

    der Mann

    man

  • Source strings (not recommended)

    The original text itself is used as the key which making it easy to identify the use of the text. This is problematic as if the original text changes, it breaks the relationship with the translations.

    Example:

    Key

    German

    French

    Dog

    Hund

    Chien

    Cat

    Katze

    Chat

Creating Keys

If keys are not uploaded, they can be created manually.

To create a key, follow these steps:

  1. From the Keys tab, click Add key.

    The Add key window opens.

  2. From the General tab, provide a Name, Description , any available Tags and a Default translation.

  3. Enable plural forms from the Plural forms tab if required.

  4. Select excluded languages from the Excluded tab if required.

  5. Provide technical details in the Advanced tab if required.

  6. Click Save.

    The key is added to the project and can be viewed on the Keys tab.

Blocked Keys

Blocking prevents whole keys from being added to a project; if the name of a blocked key appears in an uploaded file, that key is omitted and not added to the project.

Blocking is used to omit keys that from a project so they are not managed at all.

Typically blocked keys:

  • Date and time format strings.

  • Keys including configurations.

  • Keys causing issues when managed with the Phrase gem.

Manage blocked keys in a separate language file that is not processed or maintained.

Problematic keys

These keys can cause problems and if used should be blocked when a project is created.

  • activemodel.errors*

  • number.format*

  • number.currency*

  • number.percentage*

  • datetime.prompts*

Blocking a Key

To block a key, follow these steps:

  1. From a project page, select the Blocked keys tab.

  2. Click Add key to the blocked keys list.

    The Add key to the blocked keys list window opens.

  3. Provide a name for the key and click Save.

    The key is added to the list.

Keys can be later modified by clicking Phrase_Gear.png or deleted Phrase_Bin.png.

Exclusions

Some keys may need to be excluded from certain languages and can be marked as being excluded. These keys are uploaded and exist within a project, but are ignored.

Excluded translations are:

  • Excluded from export of the related language.

  • Excluded from the related language reports.

    If the content is empty it is not counted as untranslated.

  • Visible but not editable in the translation editor.

Exclusion options:

  • 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.

Excluding keys

To exclude a key, follow these steps:

  1. From the keys page, click Phrase_Gear.png for the key requiring exclusion.

    The Edit key window opens.

  2. Select the Excluded tab.

  3. Select languages for exclusion.

  4. Click Save.

    The selection is excluded in the specified key.

Was this article helpful?

Sorry about that! In what way was it not helpful?

The article didn’t address my problem.
I couldn’t understand the article.
The feature doesn’t do what I need.
Other reason.

Note that feedback is provided anonymously so we aren't able to reply to questions.
If you'd like to ask a question, submit a request to our Support team.
Thank you for your feedback.