nexthink-campaign-translator
Nexthink Campaign Translations
Use this skill when a user asks to translate a Nexthink campaign export or add languages to an existing export.
Read references/schema.md before editing an export. Use scripts/add_translations.py for structural changes and validation; let the model produce localized text, then pass that text to the script.
Allowed languages come from references/languages.json. It is the single configurable allowlist. Add or disable entries there, or pass an alternate file with --language-config; keep export codes and aliases in that registry rather than hardcoding them in the workflow.
Workflow
-
Locate the campaign export JSON. Process
.jsonfiles only; ignore sidecars such as:Zone.Identifier. If the request names multiple input files, process each independently. For an explicit request, read one base language and one or more target languages. Normalize names through the configured allowlist (Frenchbecomesfr) and reject disabled or unknown languages. Deduplicate targets while preserving request order. Skip the base language and report it.For a bare request such as
translate this campaign, infer base language frommultiLanguageInfo.baseLanguageand targets frommultiLanguageInfo.additionalLanguages, followed by languages present incampaign.translations. Deduplicate, remove the base language, and use--from-export-languages. This uses only languages declared in the export. If both sources contain no target language, report that explicitly and do not guess. -
Compare the requested base language with
campaign.multiLanguageInfo.baseLanguage. If the export has a different base language, stop and ask which source to use. KeepdefaultLanguageunchanged; it may differ frombaseLanguagein existing exports. -
Translate every base question's visible text and every base choice's visible text. Preserve rich HTML tags, attributes, inline styles,
hrefvalues, whitespace that affects rendering, and HTML entities. Translate text nodes and choice labels only. Keep sender metadata, question metadata, choice behavior, links, and embedded images unchanged. -
Protect every exact token matching
{{...}}or{...}before translating. Put the exact token back in the same semantic location. This includes{user}and parameters inside HTML attributes such ashttps://{{announcement_link}}. Never translate, rename, or reformat protected tokens.