Commands and Commandlets

CLIFF has two kinds of entry point: console commands (in-editor / headless) and GatherText steps (scheduled from the ini by the official UGatherTextCommandlet).

Console commands

All of them are registered when the editor module starts up (ECVF_Default) and unregistered when the module unloads.

CommandArgumentsDescription
CliffLocalizationSuite.HelloNoneModule load self-check; the log prints parser, importer and exporter are active (M5 integration).
CliffLocalizationSuite.Import<cliffPath> <targetName>Import a single .cliff file through the official GatherText pipeline
CliffLocalizationSuite.Export<targetName> <outputDirectory>Export that Target through the official GatherText pipeline
CliffLocalizationSuite.AITranslate<targetName> <culture1,culture2,...>Export CLIFF → DeepSeek translation → import CLIFF
CliffLocalizationSuite.AI.TestConnectionNoneValidate the DeepSeek key, network and model

Examples:

CliffLocalizationSuite.Hello
CliffLocalizationSuite.Export Game G:/Translations/cliff
CliffLocalizationSuite.Import G:/Translations/cliff/zh-Hans/cliff-game.cliff Game
CliffLocalizationSuite.AITranslate Game ja,ko
CliffLocalizationSuite.AI.TestConnection

Behaviour notes:

  • The Target name is looked up through the official ILocalizationModule::GetLocalizationTargetByName(name, false); a miss records a warning
  • When arguments are insufficient a usage warning is printed and nothing is executed
  • The API key accepts no command line argument; it is only read from the environment variable or the plugin settings
  • The source language argument of AITranslate is always empty (the Target’s NativeCulture is used)

GatherText steps

All three commandlets are UGatherTextCommandletBase subclasses and are scheduled by the official code through the ini’s CommandletClass (the engine appends the Commandlet suffix to the class name, i.e. CliffImportUCliffImportCommandlet).

ClassCommandletClass valueDeclared phase
UCliffImportCommandletCliffImportImport
UCliffExportCommandletCliffExportExport
UCliffAITranslateCommandletCliffAITranslateImport

Every step must be invoked by the official executor in the form -Config="<ini>" -Section="GatherTextStep{N}"; when either parameter is missing the commandlet reports No config or section specified. and returns -1.

Common keys (CommonSettings)

KeyDescription
SourcePathThe Target’s localization data directory (Content/Localization/<Target>)
ManifestNamee.g. Game.manifest
ArchiveNamee.g. Game.archive
NativeCultureThe native language, e.g. zh-Hans
CulturesToGenerateRepeatable; export / import / AI all process this list
DestinationPathOutput directory (used by the export / AI steps)

CliffImport step keys

KeyRequiredDescription
CliffFilePath✅*Absolute path of a single .cliff, repeatable
CliffDirectory✅*Root directory for batch directory import
CliffImportCultureUsed together with CliffDirectory; when absent CulturesToGenerate is used

* Choose one of the two. In directory mode *.cliff is filtered by the <CliffDirectory>/<culture>/ prefix and sorted, and the log prints the scan result:

Scanned CLIFF directory '<dir>': <N> .cliff file(s), selected <M> for cultures <list>.

CliffExport step keys

KeyRequiredDescription
DestinationPathExport root directory
CliffNamespaceThe namespace written into the CLIFF header
SourceLanguageOverrides the header’s source-language (defaults to NativeCulture)

CliffAITranslate step keys

KeyRequiredDescription
SourcePathRoot directory of the CLIFF to translate
DestinationPathDirectory to write back to (may be the same as SourcePath)
CulturesToGenerateThe cultures to translate this time, repeatable; empty is an error

NOTE

The AI step does not touch the manifest / archive directly: it only modifies .cliff, which the CliffImport step then writes into the official data.

Generated config files

Both the GUI and the CLI generate official-format GatherText configuration under <Project>/Config/Localization/:

FileTriggering actionSteps
<Target>_CliffImport.iniCLIFF importGatherTextStep0 = CliffImport; GatherTextStep1 = GenerateTextLocalizationResource
<Target>_CliffExport.iniCLIFF exportGatherTextStep0 = CliffExport (no compilation step)
<Target>_CliffAITranslateExport.iniAI translation (step 1)CliffExport, output to Saved/CliffAITranslate/<Target>/
<Target>_CliffAITranslate.iniAI translation (step 2)CliffAITranslate
<Target>_CliffAITranslateImport.iniAI translation (step 3)CliffImport (the CliffDirectory form) + GenerateTextLocalizationResource

Example (import, excerpted from an actually generated file):

[CommonSettings]
SourcePath=G:/UE/Projects/MyGame/Content/Localization/Game
ManifestName=Game.manifest
ArchiveName=Game.archive
NativeCulture=zh-Hans
CulturesToGenerate=en
CulturesToGenerate=ja

[GatherTextStep0]
CommandletClass=CliffImport
SourcePath=G:/UE/Projects/MyGame/Content/Localization/Game
ManifestName=Game.manifest
ArchiveName=Game.archive
NativeCulture=zh-Hans
CulturesToGenerate=en
CulturesToGenerate=ja
CliffFilePath=G:/Translations/cliff/en/cliff-game.cliff
CliffFilePath=G:/Translations/cliff/ja/cliff-game.cliff

[GatherTextStep1]
CommandletClass=GenerateTextLocalizationResource
SourcePath=G:/UE/Projects/MyGame/Content/Localization/Game
ManifestName=Game.manifest
ArchiveName=Game.archive
NativeCulture=zh-Hans
CulturesToGenerate=zh-Hans
CulturesToGenerate=en
CulturesToGenerate=ja
DestinationPath=G:/UE/Projects/MyGame/Content/Localization/Game
ResourceName=Game.locres

Note two things: the import step’s CulturesToGenerate does not include the NativeCulture, while the compilation step does (so that the native .locres for the editor UI language is rebuilt as well).

Tasks and exit codes

ScenarioTask list (executed serially in order)
Import (single Target)Import TranslationsGenerate Reports
Import (TargetSet)One group per Target: CLIFF 导入:<Target> / CLIFF 报告:<Target>
Export (single Target)Export Translations
Export (TargetSet)One CLIFF 导出:<Target> per Target
AI translation (single Target)Export TranslationsAI 翻译Import TranslationsGenerate Reports
AI translation (TargetSet)One group per Target: AI 翻译:导出 <Target> / AI 翻译:<Target> / AI 翻译:导入 <Target> / AI 翻译:报告 <Target>
  • GUI path: the official subprocess FLocalizationCommandletProcess::Execute(config, true), where ReturnCode == 0 counts as success
  • Headless path (no active top-level window): embeds UGatherTextCommandlet::Execute("-Config=\"…\" -Unattended")
  • Any step returning non-zero → that task is marked failed, and the progress window shows a red cross plus the failure log

Commandlet log examples

UCliffImportCommandlet::Main (Import) started with 2 CLIFF file(s)...
Importing CLIFF file '<path>'...
CLIFF import succeeded for '<path>': 42 sources, 40 translations.
CLIFF batch import succeeded: 84 sources, 80 translations.

UCliffExportCommandlet::Main (Export) started...
CLIFF export succeeded: 3 documents, 126 entries -> '<dir>'.

UCliffAITranslateCommandlet::Main started with 2 culture(s) in '<dir>'.
AI translation succeeded: 84 candidates, 82 translated, 2 failed, 0 repairs.