Unfortunately, Babel, which provides distutils commands to create messages catalogs, and extract and compile messages, doesn’t allow you to create different catalogs for the same language in one package.
New distutils commands:
The new distutils commands made available by doublespeak, are:
- init_js_catalog - Initialize a new gettext catalog, specifically for JS messages.
- extract_js_messages - Extract messages from JS and put them in the catalog.
- update_js_catalog - Update an existing catalog with messages from newer JS code.
- compile_js_catalog - Create the compiled .mo and JSON files from the .po files
Users of Babel, will notice that these commands are very similar to the ones provided by Babel:
Some of the doublespeak commands are simply wrappers around Babel commands. The benefit they provide is that you can configure them independently from the Babel commands, for example in your setup.cfg file.
Here’s an example setup.cfg file, which demonstrates how you can configure the standard Babel commands and the new Doublespeak commands:
- Add the “output-prefix” option to prefix the filenames of generated language .js files, defaults to ‘’.
- Add ‘statistics’ and ‘use-fuzzy’ to be on par with Babel’s compile_catalog.
- Build js files based on .po files instead of .mo files.
- Initial release.