Translation Editor
Save time on handling localization files and translation strings.
Try SimpleLocalize
Share article

What is a translation key?

What is a translation key?

When using SimpleLocalize's documentation, pricing page, or simply when using the software, you'll inevitably encounter the term 'translation key'. In this blog post, we will explain what a translation key is, how to create them and how to calculate translation keys in your project. Let's get started!

What is a translation key?

A translation key is a unique identifier for translations within your project files. It simplifies the process of creating and managing translations in software development.

To put it simply, visually, each translation key corresponds to a single text element on your app or website. The content within can range from a single word to longer text blocks, enclosed within the translation key.

Now, note that one translation key can be translated into multiple languages, meaning the texts inside that key can vary depending on the chosen language.

Translation keys and translations

Translation key for developers

Developers can easily identify or create translation keys as they originate from the source code of the website or application.

The formatting of translation keys varies based on the library utilized and the internal guidelines for managing translation keys. Here are some examples:

  • TRANSLATION_KEY
  • TRANSLATION.KEY
  • tranlsationKey
  • tranlsation_key

If your project supports only one language, and you add texts directly into the code of your website or app, the translation key refers to the entire text element. For example, the header or paragraph below:

HTML texts

When using multiple languages, in the translation files in your project, you will find the translation key as a source to identify the translation. For example, below you can see translation keys with translations in English in a JSON file:

JSON file with translation keys and translations

Translation keys in SimpleLocalize

At SimpleLocalize, we love to make things easier, so instead of calculating words or characters to determine your project volume or scope, we check the number of your translation keys.

As illustrated below, it's quite straightforward. In the translation editor, all translations assigned to specific translation keys are visible. While they may consist of multiple languages and various lengths, the translation key remains unique.

Translation keys in SimpleLocalize's translation editor

Thanks to that, regardless of the length of your translations or the number of languages you use, the quantity of translation keys remains the same. Naturally, this changes if you create additional translation keys, such as when incorporating new features and texts that necessitate translations.

To determine the SimpleLocalize plan suitable for your project, simply check how many translation keys your project currently holds. Opt for the best-fitting plan, and as you add more translation keys, simply add a pack of extra keys to expand your current plan. Check out our pricing page for more details.

Get started with simple translation management and import your translation keys with existing translations to SimpleLocalize.

How to create translation keys?

For optimal clarity and simplicity in translation management, there are some general rules for creating translation keys. While not mandatory, they significantly enhance the ease of use for both developers and translators.

General rules for creating translation keys:

  • Descriptive and contextual. Translation keys should be self-explanatory and describe the content clearly. For example, GUEST_DETAILS.BIRTHDATE_LABEL. By looking at it, you should know what translation is inside.
  • Consistent. Maintain consistency in naming conventions and structure of your translation keys. For example, button.next, button.cancel. Keeping the same structure will make it easier to find translation keys and edit translations.
  • Readable. They should be easy to read and comprehensive for everyone. Use dots, camel case, or underscore to make it easier to visually read the translation key.
  • Scalable. Design keys to accommodate future additions and modifications to the content. Instead of mirroring the original text 1:1, craft unique yet descriptive keys. For example, instead of welcome.search.enter-your-name-or-booking-id-here, create a simple key welcome.search.label.

Additionally, there are also some other rules applied directly by the translation libraries. For instance, i18next can additionally use namespaces added to translation keys, and translation keys elements must be separated by dots.

Our recommendations for creating translation keys

Besides the general rules, we wanted to share with you some of our 'dos and don'ts' about creating translation keys that can be helpful for getting started:

  • Don't use spaces. They will make the key harder to read and can be confused with translations.
  • Don't use special characters.
  • Create actual translation keys instead of just using existing text from the original language.
  • Don't use abbreviations - they may be clear for you but not for the translator or another developer.
  • For buttons or elements that repeat in multiple places, use one general translation key instead of multiple ones that duplicate them.
  • Don't use unreadable keys, like s0xD2_#.
  • Avoid creating too long keys - remember that they must be easy to read.

Whether opting for lowercase, uppercase, dots, or underscores, keep in mind the general rules and our tips for creating translation keys for effective translation management and simpler workflows for your team.

For more about translation management, visit our other blog posts or contact us if you have any questions!

Relevant posts

Check out our latest blog posts and stay up to date with SimpleLocalize

How to auto-translate JSON files

Kinga Wojciechowskaby5 min readMarch 26, 2024

Simplify your localization process by learning how to auto-translate JSON files with SimpleLocalize's translation editor and auto-translation feature.

Continue reading

Translation Editor Explained

Kinga Wojciechowskaby6 min readJuly 04, 2022

Explore features and functionalities of SimpleLocalize translation editor, learn how to use them and get started with translation management for your project.

Continue reading