Skip to content

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.


  1. Generate a translation template

    Extract all translatable strings into a JSON file:

    Terminal window
    ./mscp.py admin translation-json

    This creates messages.json in the build/ output directory.

  2. Translate the strings

    Open messages.json and fill in the translated values for each string.

  3. Compile to a .mo file

    Convert the translated JSON into a binary format:

    Terminal window
    ./mscp.py admin mo-from-json build/messages.json -l de

    This creates build/locale/de/LC_MESSAGES/messages.mo.

  4. Generate guidance in your language

    Terminal window
    ./mscp.py guidance custom/baselines/800-53r5_moderate_macos_26.0.yaml -L de

Terminal window
./mscp.py admin translation-json [OPTIONS]
FlagDescription
-o OUTPUTOutput file path (default: messages.json)
-d DOMAINTranslation domain (default: messages)

Example — custom output path:

Terminal window
./mscp.py admin translation-json -o ~/Desktop/translations.json

Terminal window
./mscp.py admin mo-from-json JSON_FILE [OPTIONS]
FlagDescription
JSON_FILEPath to the translated JSON file (required)
-l LOCALETarget locale code, e.g. de, fr, ja (required)
-m MO_FILEOutput .mo filename (default: messages.mo)
-d DOMAINTranslation domain (default: messages)
-fEnable fuzzy translation matching

Example — compile German translations:

Terminal window
./mscp.py admin mo-from-json build/messages.json -l de

The compiled file is placed at build/locale/{LOCALE}/LC_MESSAGES/messages.mo.


  • Directorybuild/
    • messages.json Translation template
    • Directorylocale/
      • Directoryde/
        • DirectoryLC_MESSAGES/
          • messages.mo Compiled translation
          • messages.po Human-readable translation source