Skip to content

Extract catalog compilation into a compile_message_catalog() function - #1327

Open
ChrisJr404 wants to merge 1 commit into
python-babel:masterfrom
ChrisJr404:compile-api-function
Open

Extract catalog compilation into a compile_message_catalog() function#1327
ChrisJr404 wants to merge 1 commit into
python-babel:masterfrom
ChrisJr404:compile-api-function

Conversation

@ChrisJr404

Copy link
Copy Markdown

Closes #760.

This pulls the compile logic out of the CompileCatalog command into a plain compile_message_catalog() function, so applications can compile catalogs from their own code without shelling out to the CLI (that was the use case in the betty PR linked from the issue). The command just calls the function now, so the command line behavior is unchanged.

I kept the signature close to the compile options (directory/locale/domain, or an explicit input and output file), added tests covering the file and directory modes plus the error counting, and dropped a short note under the compile docs.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Extract the compile functionality into an API function

1 participant