[Winmerge-svn] SF.net SVN: winmerge:[6852] trunk/Translations/GetTranslationsStatus.py
Windows visual diff and merge for files and directories
Brought to you by:
christianlist,
grimmdp
From: <ge...@us...> - 2009-06-15 15:21:34
|
Revision: 6852 http://winmerge.svn.sourceforge.net/winmerge/?rev=6852&view=rev Author: gerundt Date: 2009-06-15 15:21:20 +0000 (Mon, 15 Jun 2009) Log Message: ----------- PATCH: [ 2802270 ] GetTranslationsStatus script in Python - Mark POT file with "template" attribute in XML file Modified Paths: -------------- trunk/Translations/GetTranslationsStatus.py Modified: trunk/Translations/GetTranslationsStatus.py =================================================================== --- trunk/Translations/GetTranslationsStatus.py 2009-06-14 13:59:11 UTC (rev 6851) +++ trunk/Translations/GetTranslationsStatus.py 2009-06-15 15:21:20 UTC (rev 6852) @@ -58,10 +58,22 @@ for project in self.__projects: #For all projects... xmlfile.write(' <translations project="%s">\n' % (project.name)) for status1 in project.status: #For all status... - xmlfile.write(' <translation>\n') - xmlfile.write(' <language>%s</language>\n' % (status1.language)) - xmlfile.write(' <file>%s</file>\n' % (status1.filename)) - if status1.filetype == 'PO': #If a PO file... + if status1.filetype == 'POT': #If a POT file... + xmlfile.write(' <translation template="1">\n') + xmlfile.write(' <language>%s</language>\n' % (status1.language)) + xmlfile.write(' <file>%s</file>\n' % (status1.filename)) + xmlfile.write(' <update>%s</update>\n' % (status1.potcreationdate[0:10])) + xmlfile.write(' <strings>\n') + xmlfile.write(' <count>%u</count>\n' % (status1.count)) + xmlfile.write(' <translated>%u</translated>\n' % (status1.count)) + xmlfile.write(' <fuzzy>0</fuzzy>\n') + xmlfile.write(' <untranslated>0</untranslated>\n') + xmlfile.write(' </strings>\n') + xmlfile.write(' </translation>\n') + else: #If a PO file... + xmlfile.write(' <translation>\n') + xmlfile.write(' <language>%s</language>\n' % (status1.language)) + xmlfile.write(' <file>%s</file>\n' % (status1.filename)) xmlfile.write(' <update>%s</update>\n' % (status1.porevisiondate[0:10])) xmlfile.write(' <strings>\n') xmlfile.write(' <count>%u</count>\n' % (status1.count)) @@ -69,27 +81,19 @@ xmlfile.write(' <fuzzy>%u</fuzzy>\n' % (status1.fuzzy)) xmlfile.write(' <untranslated>%u</untranslated>\n' % (status1.untranslated)) xmlfile.write(' </strings>\n') - else: #If a POT file... - xmlfile.write(' <update>%s</update>\n' % (status1.potcreationdate[0:10])) - xmlfile.write(' <strings>\n') - xmlfile.write(' <count>%u</count>\n' % (status1.count)) - xmlfile.write(' <translated>%u</translated>\n' % (status1.count)) - xmlfile.write(' <fuzzy>0</fuzzy>\n') - xmlfile.write(' <untranslated>0</untranslated>\n') - xmlfile.write(' </strings>\n') - if status1.translators: #If translators exists... - xmlfile.write(' <translators>\n') - for translator in status1.translators: #For all translators... - if (translator.ismaintainer): #If maintainer... - xmlfile.write(' <translator maintainer="1">\n') - else: #If NOT maintainer... - xmlfile.write(' <translator>\n') - xmlfile.write(' <name>%s</name>\n' % (translator.name)) - if (translator.mail): #If mail address exists... - xmlfile.write(' <mail>%s</mail>\n' % (translator.mail)) - xmlfile.write(' </translator>\n') - xmlfile.write(' </translators>\n') - xmlfile.write(' </translation>\n') + if status1.translators: #If translators exists... + xmlfile.write(' <translators>\n') + for translator in status1.translators: #For all translators... + if (translator.ismaintainer): #If maintainer... + xmlfile.write(' <translator maintainer="1">\n') + else: #If NOT maintainer... + xmlfile.write(' <translator>\n') + xmlfile.write(' <name>%s</name>\n' % (translator.name)) + if (translator.mail): #If mail address exists... + xmlfile.write(' <mail>%s</mail>\n' % (translator.mail)) + xmlfile.write(' </translator>\n') + xmlfile.write(' </translators>\n') + xmlfile.write(' </translation>\n') xmlfile.write(' </translations>\n') xmlfile.write('</status>\n') xmlfile.close() @@ -197,9 +201,11 @@ elif sMsgStr != '': tmp = rePoRevisionDate.findall(sMsgStr) if tmp: #If "PO-Revision-Date"... + #TODO: Convert to date! self.__porevisiondate = tmp[0] tmp = rePotCreationDate.findall(sMsgStr) if tmp: #If "POT-Creation-Date"... + #TODO: Convert to date! self.__potcreationdate = tmp[0] sMsgId = '' sMsgStr = '' This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |