How 7-Zip Handles Language and Localization Files

7-Zip uses a lightweight, text-based localization architecture to support dozens of languages across its interface. Instead of compiling separate binary resources for each locale, the software relies on external plain text translation files that map internal resource identifiers to translated strings. This article explains how 7-Zip organizes, reads, and applies these language files, and how users can customize or create new translations without modifying the application's source code.

The Lang Directory and File Storage

7-Zip stores all its localization assets in a dedicated subfolder named Lang, located inside the primary installation directory (typically C:\Program Files\7-Zip\Lang).

Each supported language is represented by a single text file ending with the .txt extension. The files are usually named using standard ISO language codes or language names, such as en.txt for English, de.txt for German, or fr.txt for French. Because these files reside outside the main executable binaries (7zG.exe and 7zFM.exe), the program can add, update, or remove language support without requiring binary recompilation or application reinstallations.

Structure of 7-Zip Translation Files

Each .txt file in the Lang directory follows a straightforward key-value format readable by any standard text editor. The file consists of two primary components:

  1. Header Metadata: The beginning of the file specifies the language name in English, the native language name, and optional credits for the translator.
  2. Numeric ID Mappings: The body of the file maps specific numerical IDs directly to their translated text strings.

A typical entry resembles the following structure:

; Language Name
English
English

401
OK
402
Cancel

In this system, the numeric identifier corresponds to a specific control, menu item, dialog prompt, or error message inside 7-Zip's graphical user interface.

Runtime Loading and String Replacement

When a user selects a language in 7-Zip (Tools > Options > Language), the application performs the following runtime sequence:

  • File Parsing: 7-Zip opens the selected .txt file from the Lang directory and reads the ID-to-string mappings into memory.
  • UI Dynamic Replacement: During window creation and dialog rendering, 7-Zip queries the loaded language map using the control or message ID. If a translated string exists for that ID, it dynamically replaces the default interface text.
  • Fallback Behavior: English is hardcoded into the 7-Zip binaries as the default fallback. If a specific translation file is missing certain IDs—or if a file becomes corrupted—7-Zip automatically falls back to the embedded English string, preventing blank buttons or missing labels in the UI.

Creating and Modifying Localization Files

Because 7-Zip uses standard text files, creating a custom localization or editing an existing one requires only basic text editing tools:

  1. Open the Lang directory with administrative permissions.
  2. Duplicate an existing, up-to-date translation file (such as en.txt).
  3. Rename the copy to match the target language code.
  4. Translate the strings beneath each numeric ID while preserving the ID numbers.
  5. Save the file using UTF-8 encoding to preserve special characters and non-Latin scripts.

Once saved in the Lang directory, the newly created language appears immediately in 7-Zip's language selection menu.