Created
November 29, 2012 13:20
-
-
Save shimizukawa/4169008 to your computer and use it in GitHub Desktop.
sphinx i18n avoid unusable warnings patch.
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
diff -r 8a5db9f7719d -r 02d86c1ce059 sphinx/environment.py | |
--- a/sphinx/environment.py Tue Nov 27 20:07:30 2012 +0900 | |
+++ b/sphinx/environment.py Thu Nov 29 15:46:57 2012 +0900 | |
@@ -219,6 +219,14 @@ | |
if not msgstr or msgstr == msg: # as-of-yet untranslated | |
continue | |
+ # Avoid "Literal block expected; none found." warnings. | |
+ # If msgstr ends with '::' then it cause warning message at | |
+ # parser.parse() processing. | |
+ # literal-block-warning is only appear in avobe case. | |
+ if msgstr.strip().endswith('::'): | |
+ msgstr += '\n\n dummy literal' | |
+ # dummy literal node will discard by 'patch = patch[0]' | |
+ | |
patch = new_document(source, settings) | |
parser.parse(msgstr, patch) | |
patch = patch[0] |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment