Bench Generate POT File
The bench generate-pot-file command creates a Portable Object Template (.pot) file containing all translatable strings from a Frappe application. The generated template does not include translations, it only extracts source strings that translators can later translate into different languages.
Many official Frappe applications automatically regenerate their POT files through GitHub Actions, ensuring translation templates remain up to date.
Usage
bench generate-pot-file [OPTIONS]
What Does This Command Do?
This command scans the source code of one or more Frappe applications and extracts every translatable string into a main.pot template file.
The generated template is saved in the application’s locale directory:
[app_module]/locale/main.pot
Translation teams can then use this template to create language-specific .po files without modifying the application source code.
Available Option
| Option | Description |
|---|---|
--app |
Generate the POT file for a specific application. If omitted, Bench generates POT files for all installed applications. |
Common Example
Generate a POT File for ERPNext
Regenerate the translation template for the ERPNext application.
bench generate-pot-file --app erpnext
This command scans the apps/erpnext directory, extracts all translatable strings, and generates the following template file:
apps/erpnext/erpnext/locale/main.pot
Run this command whenever you add, modify, or remove user-facing text in your application. Keeping the main.pot file updated ensures translators always work with the latest translatable strings.