mirror of
				https://github.com/python/cpython.git
				synced 2025-10-31 05:31:20 +00:00 
			
		
		
		
	write(): Karl Eichwalder points out that the #, flag comments should
be outputted just before the msgid lines.
This commit is contained in:
		
							parent
							
								
									6302ec63fc
								
							
						
					
					
						commit
						5c94ce58e7
					
				
					 1 changed files with 4 additions and 1 deletions
				
			
		|  | @ -338,11 +338,12 @@ def write(self, fp): | |||
|             rentries = reverse[rkey] | ||||
|             rentries.sort() | ||||
|             for k, v in rentries: | ||||
|                 isdocstring = 0 | ||||
|                 # If the entry was gleaned out of a docstring, then add a | ||||
|                 # comment stating so.  This is to aid translators who may wish | ||||
|                 # to skip translating some unimportant docstrings. | ||||
|                 if reduce(operator.__add__, v.values()): | ||||
|                     print >> fp, '#, docstring' | ||||
|                     isdocstring = 1 | ||||
|                 # k is the message string, v is a dictionary-set of (filename, | ||||
|                 # lineno) tuples.  We want to sort the entries in v first by | ||||
|                 # file name and then by line number. | ||||
|  | @ -370,6 +371,8 @@ def write(self, fp): | |||
|                             locline = "#:" + s | ||||
|                     if len(locline) > 2: | ||||
|                         print >> fp, locline | ||||
|                 if isdocstring: | ||||
|                     print >> fp, '#, docstring' | ||||
|                 print >> fp, 'msgid', normalize(k) | ||||
|                 print >> fp, 'msgstr ""\n' | ||||
| 
 | ||||
|  |  | |||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue
	
	 Barry Warsaw
						Barry Warsaw