What Are Translation Keys

Learn how translation keys streamline localization, enhance UX content, and improve developer handoff with best practices, real-world code examples, and smart collaboration tools like Frontitude.

5 min read

In today’s global product environment, UX writers play a crucial role in delivering content that resonates across languages. One often overlooked piece of the localization puzzle is the humble translation key. This technical component serves as a bridge between UX content, the localization process, and the developer handoff, ensuring that what you write gets accurately translated and implemented in the final product.

What Are Translation Keys?

Translation keys are unique identifiers (usually short strings) that represent pieces of text in an app or website. Instead of hard-coding the actual text in the software (for example, writing “Submit” directly in code), a developer will use a key like “button.submit”. This key corresponds to the user-facing text via a translation file or database. Essentially, the application looks up the key in a localization file to get the correct text for the user’s language.

For example, imagine you have a greeting message in your app. You might define a translation key “welcome.message”. In an English localization file, “welcome.message” maps to “Welcome”, while in a French file the same key maps to “Bienvenue”. The code simply uses “welcome.message” and the system displays the appropriate text based on the user’s selected language. This setup makes it easy to support multiple languages and update copy without changing any code.

Example (JSON Translation File):

{
  "welcome": {
    "message": "Welcome"
  },
  "button": {
    "submit": "Submit",
    "cancel": "Cancel"
  },
  "error": {
    "invalid_password": "The password is incorrect."
  }
}

Example (JavaScript Code):

const i18n = require('i18next');

i18n.t('welcome.message'); // Outputs: "Welcome"
i18n.t('button.submit');   // Outputs: "Submit"

Why Translation Keys Matter for Localization

Translation keys are essential to an efficient localization workflow. They decouple content from code, meaning you can update or translate text without touching the app’s logic. For a product that needs frequent copy tweaks or supports many languages, this separation is crucial.

When a phrase changes (say “Sign up” becomes “Register”), you update the translation for that key in one place and the new text appears everywhere that key is used. No code change needed. Keys also enable parallel work: developers use the keys in code while translators simultaneously provide the text for each key in different languages. Adding a new language is straightforward. Just supply a new set of translations for the existing keys, and the app is ready for another locale.

Using keys also prevents inconsistencies in translations. Each key maps to a specific piece of content, so the same phrase appearing in multiple places can use one key, translated once, to stay consistent. If a message needs to be phrased differently in different contexts, you assign separate keys to avoid confusion. Translation keys help maintain a single source of truth for all UI text, making it easier to manage and maintain multilingual content.

Translation Keys in the UX Content Workflow

Working with translation keys might feel like stepping into a developer’s world, but it’s becoming standard in the UX content workflow. Incorporating translation keys during the content creation and design phase can save headaches later. Rather than treating localization as an afterthought, plan for it upfront. This means when you’re crafting microcopy or interface text, you’re also considering how that text will be identified in the system.

While designing a login screen, the “Forgot password?” link could be tagged with a key like “login.forgot_password”. Defining it early means everyone from design to engineering knows that this text has a specific identifier. You should ensure the key name is human-readable and clearly tied to its purpose, which helps avoid confusion if the copy is reused or modified later.

Best Practices for Naming Translation Keys

Not all translation keys are created equal. Poorly named keys can confuse team members and complicate localization. Here are some best practices for naming and organizing your translation keys:

  • Use meaningful names: Choose key names that clearly describe the content or function. For example, homepage.welcome_title vs. text1 – it’s obvious which one is helpful.

  • Stay consistent with format: Pick a naming convention and stick to it. Whether you prefer snake_case or dot.notation, consistency makes keys predictable for everyone.

  • Group keys hierarchically: Organize keys logically by screen or feature via namespaces. For instance, prefix login screen keys with login. (e.g. “login.username_label”, “login.password_label”) to group them. Grouping into namespaces makes keys easier to find and helps avoid name collisions.

  • Include context or variants if needed: If a text is generic (like “Next”) or has plural forms, add context in the key. For example, use “dialog.next_button” vs. “form.next_step” for different “Next” buttons, or define “item_count_one” and “item_count_few” for singular vs. plural. i18n libraries usually have a convention to handle plurals automatically. You can learn more on i18next plural support.

  • Avoid special characters or spaces: Use only letters, numbers, underscores, or dots. This ensures keys work smoothly across systems. For example, prefer “error.password_required” over “error.password required!”.

  • Keep keys stable (don’t use the UI text): It may be tempting to use the English text as the key, but that can backfire if the copy changes. Instead of naming a key “SubmitOrder”, use something like button.submit_order. That way you can change the button’s label later without renaming the key everywhere.

Following these practices makes translation keys easier to work with. A good naming scheme means less guesswork for developers, clearer context for translators, and fewer mistakes in your localized content.

Translation Keys and Developer Handoff

When it comes to developer handoff, translation keys can be a UX writer’s best ally. If every text element in your design comes with a translation key and final copy, developers know exactly what to use. They can reference the key in code to pull in the correct text, rather than hard-coding strings. This prevents scenarios where a developer might invent inconsistent key names or leave placeholder text that never gets updated.

With keys defined upfront, any late copy tweaks are also easier. Just update the text for that key in the translations, and the app reflects it instantly without code changes. Having translation keys in place eliminates guesswork and rework at the handoff stage, ensuring the product matches your intended copy.

How Frontitude Helps Teams Manage Translation Keys

Frontitude is a platform that helps teams manage UX content and generate translation keys with AI as part of the design process, so that the entire team can benefit from it:

  • UX writers and designers can generate and assign keys to text directly in their design files using a Figma plugin or Frontitude project, creating a single source of truth for all UX content.
  • Translators can see the copy in context and begin translating as soon as the content is finalized, rather than waiting until after development.
  • Developers benefit too: Frontitude integrates with their workflow, allowing them to pull the latest keys and text without manual copy-paste, even before translators have started their work.

Frontitude keeps writers, designers, developers, and translators on the same page, resulting in a streamlined localization workflow with fewer errors and faster delivery of a consistent, multilingual user experience.

Get the monthly scoop
Stay up to date on new features, industry updates, and the latest trends around UX content and localization.
You’re in!
Watch your inbox for our next update
That email doesn’t look right… Give it another shot.
🍪