You are reading the documentation of OpenCTI 7.260811 LTS · 7.260811.0-lts.1, supported until 2027-09.Latest is 7.261119.0 →
How-to guide

Add or change a translation in OpenCTI or OpenAEV

Wrap a new text of the OpenCTI or OpenAEV interface for translation, add its English key, fill the other eight languages with DeepL, and pass the checks of the CI.

OpenCTIOpenAEVFor developers

The interfaces of OpenCTI and OpenAEV are translated into nine languages: English, German, Spanish, French, Italian, Japanese, Korean, Russian and Chinese. A text on screen is a key, the English text itself, looked up in one JSON file per language. This page takes a new text from your component to every language file, and through the checks the continuous integration (CI) runs on your pull request. Set up the repository first: see Build and run from source.

YOUR CHANGETRANSLATION FILESCHECKSComponentt('...') or t_i18n('...')en.jsonThe referenceEight languagesde, es, fr, it, ja, ko, ru, zhCI jobKeys, placeholders, terms
  1. Component → en.json: extract-translation
  2. en.json → Eight languages: auto-translation:all
  3. Component → CI job: pull request
  4. Eight languages → CI job: checked
A text wrapped in the translation function becomes a key of en.json, DeepL fills the other languages, and the CI checks every file

How translation works

OpenCTIOpenAEV
Translation functiont_i18n('Add tags')t('Add tags')
Interface textsopencti-platform/opencti-front/lang/front/<language>.jsonopenaev-front/src/utils/lang/<language>.json
Other textslang/back/<language>.json: the labels of attributes and relationships the back end declares, as label: '...' in opencti-graphql/srcThe messages the back end returns with a 400 or 409, which the interface passes to t(): they must match a key of en.json exactly
Languagesde, en, es, fr, it, ja, ko, ru, zhde, en, es, fr, it, ja, ko, ru, zh
Scripts run fromopencti-platform/opencti-frontopenaev-front

The key is the English text: en.json maps "Add tags" to "Add tags", and fr.json maps it to its French. A text built by concatenation, such as 'Unknown scenario: ' + id, cannot be translated: use a placeholder, t('Unknown scenario: {id}', { id }).

Before you start

  • A clone of the repository with its dependencies installed (yarn install).
  • A DeepL API Free key, to translate the new keys into the eight other languages. The scripts read it from SUBSCRIPTION_KEY and stop without it.

Add a text

  1. Wrap the text in the translation function of the module: t_i18n('Replay on the front desks') in OpenCTI, t('Replay on the front desks') in OpenAEV.

  2. Add the new keys to en.json:

    yarn extract-translation
    

    The script appends the keys it finds and never removes one. What it finds differs:

    OpenCTIOpenAEV
    Files read.jsx and .tsx of the front end, and the label: '...' of the back end.js, .jsx and .tsx of the front end
    Calls foundt_i18n('...') and t_i18n("..."), with or without optionst('...') with single quotes and no other argument

    Add the others to en.json by hand: in OpenAEV, a call with placeholder values, double quotes, an escaped quote, or in a .ts file; in both modules, a text passed as a property that a component translates later, such as label: 'Seen'.

  3. Translate the new keys into the other languages, with your DeepL key in SUBSCRIPTION_KEY:

    SUBSCRIPTION_KEY="$DEEPL_API_KEY" yarn auto-translation:all
    

    The script translates the keys missing from each language file, then sorts the files. OpenCTI translates the front and back files; OpenAEV also brings the first letter of each new translation to the case of the English source.

  4. Read the diff of every language file. DeepL can translate a word out of context, translate a field name or add quotes. Fix them by hand, as Translation rules says.

  5. Run the check of the CI:

    yarn verify-translation   # OpenCTI
    yarn i18n-checker         # OpenAEV
    

To change an existing translation, edit its value in the language file and run the check. To change an English text, change the call in the component and add the new key: the old key stays in the files until someone removes it.

The checks the CI runs

A pull request fails when its check fails.

ModuleJob and commandFails when
OpenCTIFrontend verify translation, yarn verify-translationA t_i18n('...') of the front end, or a label: '...' of the back end, has no key in the matching en.json
OpenAEVFrontend Quality & Unit Tests, yarn i18n-checkerSee the table below

OpenAEV checks every language file:

CheckFails when
Missing keyA t() call uses a key absent from a language file, placeholders, double quotes and escaped quotes included
Missing or untranslated valueA key of en.json is absent from another language file, or its value is the English one, unless it only holds protected terms or is a listed loanword
PlaceholdersA translation does not keep the placeholders ({x}, {{x}}, ${x}) and tags of the English value, or contains a literal undefined
Protected termsA term of the glossary present in the English value is missing from the translation

Two files of openaev-front/scripts/ configure it: i18n-glossary.json lists in globalTerms the brand names, acronyms and standards never translated, such as ATT&CK; i18n-loanwords.json lists the values that are rightly the same as in English, under all or under one language.

Translation rules

RuleRightWrong
The first letter keeps the case of the English source, in every languagebreached → compromisCompromis
Protected terms stay as they areKubernetes 클러스터쿠버네티스 클러스터
Field names, enumeration values and code identifiers stay in EnglishAu moins un élément parmi exercise ou scenarioAu moins un élément parmi exercice ou scénario
No quotes the source does not haveaction_execution_arch ist erforderlich„action_execution_arch“ ist erforderlich
Placeholders and tags unchanged{count} injects{nombre} injects

When a value is rightly the same as in English, such as Dashboard in German, add it to i18n-loanwords.json under its language in OpenAEV, rather than changing the translation.

ExampleA new button in the OpenAEV scenario screen

A developer at Example CERT adds a button to replay a scenario on the front-desk workstations of Grand Meridian Hotels. In the component, the label is t('Replay on the front desks'). From openaev-front, with the team's DeepL key in the secret store variable DEEPL_API_KEY:

yarn extract-translation
SUBSCRIPTION_KEY="$DEEPL_API_KEY" yarn auto-translation:all
git diff --stat src/utils/lang/
yarn i18n-checker

en.json gains "Replay on the front desks", and each of the eight other files gains its translation. The French reads Rejouer sur les postes d'accueil; the developer checks the German and Japanese values with colleagues, and yarn i18n-checker exits without an error before the pull request.

What's next

NextContribute to the docs
Develop
Integrations, APIs, MCP and contributing.

Published

Overview