forked from python-babel/babel
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Allow extractors to provide message flags
This adds a sixth value to the tuple returned by the extractor functions which should be a set of flags. Which flags should be applied to a message should be determined by the extractor, as it depends on e.g. the file format being parsed. For example "%s" should have the python-format flag if it was parsed from a Python file and the c-format flag if it was extracted from a C file. The logic of detecting python-format flags is also moved to the Python extractor in this PR. NOTE: This is partially a breaking change. Backwards compability is maintained with extractors that return 5-tuples instead of 6-tuples, but the interface Babel exposes for extracting messages always returns 6-tuples. I don't see a good way around this. Removing the python-format detection from Message.__init__ is also a breaking change, but that could potentially be put back for now.
- Loading branch information
Showing
9 changed files
with
120 additions
and
98 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.