Tolgee icon

Tolgee

Interact with Tolgee API for translation management

Translation → Create Key

AI-generated

Summary

Creates a new translation key with associated translations for specified languages in a Tolgee project.

Inputs

  • projectId (required) — The ID of the Tolgee project.
  • key (required) — The name of the translation key to create.
  • translations (required) — The translations for different languages, each including a language code and the corresponding text.
  • options — Additional options for the translation creation, such as languages to return and namespace.

Output shape

a JSON object representing the created key and its translations

Returns the created translation key details; may include a success message or an error object if the operation fails.

Examples

Example 1: Creating a new translation key for the project with ID '123' and ensuring it has translations in English and Spanish.

Set projectId to '123', key to 'welcome_message', translations to include English and Spanish texts.

Example 2: Adding a new key to a specific namespace and requesting translations for specific languages.

Set projectId, key, and specify a namespace along with which languages to return.

Discussion