Generate Localization
The localization workflow lets you generate guidance documents in languages other than English. It involves generating a JSON template of translatable strings, translating them, and compiling the result into a format the tool can use.
Overview
Section titled “Overview”-
Generate a translation template
Extract all translatable strings into a JSON file:
Terminal window ./mscp.py admin translation-jsonThis creates
messages.jsonin thebuild/output directory. -
Translate the strings
Open
messages.jsonand fill in the translated values for each string. -
Compile to a
.mofileConvert the translated JSON into a binary format:
Terminal window ./mscp.py admin mo-from-json build/messages.json -l deThis creates
build/locale/de/LC_MESSAGES/messages.mo. -
Generate guidance in your language
Terminal window ./mscp.py guidance custom/baselines/800-53r5_moderate_macos_26.0.yaml -L de
Command Reference
Section titled “Command Reference”Generate Translation Template
Section titled “Generate Translation Template”./mscp.py admin translation-json [OPTIONS]| Flag | Description |
|---|---|
-o OUTPUT | Output file path (default: messages.json) |
-d DOMAIN | Translation domain (default: messages) |
Example — custom output path:
./mscp.py admin translation-json -o ~/Desktop/translations.jsonCompile Translations to MO
Section titled “Compile Translations to MO”./mscp.py admin mo-from-json JSON_FILE [OPTIONS]| Flag | Description |
|---|---|
JSON_FILE | Path to the translated JSON file (required) |
-l LOCALE | Target locale code, e.g. de, fr, ja (required) |
-m MO_FILE | Output .mo filename (default: messages.mo) |
-d DOMAIN | Translation domain (default: messages) |
-f | Enable fuzzy translation matching |
Example — compile German translations:
./mscp.py admin mo-from-json build/messages.json -l deThe compiled file is placed at build/locale/{LOCALE}/LC_MESSAGES/messages.mo.
Output Structure
Section titled “Output Structure”Directorybuild/
- messages.json Translation template
Directorylocale/
Directoryde/
DirectoryLC_MESSAGES/
- messages.mo Compiled translation
- messages.po Human-readable translation source
Next Steps
Section titled “Next Steps”- How to Generate Guidance — Use
-L LANGto generate in your language