Revision: 7108 http://skim-app.svn.sourceforge.net/skim-app/?rev=7108&view=rev Author: hofman Date: 2011-02-14 22:33:26 +0000 (Mon, 14 Feb 2011)
Log Message: ----------- remove duplicate localization strings in generated .strings files from NIBs Modified Paths: -------------- trunk/Dutch.lproj/DisplayPreferences.strings trunk/Dutch.lproj/GeneralPreferences.strings trunk/Dutch.lproj/LineInspector.strings trunk/Dutch.lproj/MainMenu.strings trunk/Dutch.lproj/NoteWindow.strings trunk/Dutch.lproj/NotesPreferences.strings trunk/English.lproj/DisplayPreferences.strings trunk/English.lproj/GeneralPreferences.strings trunk/English.lproj/LineInspector.strings trunk/English.lproj/MainMenu.strings trunk/English.lproj/NoteWindow.strings trunk/English.lproj/NotesPreferences.strings trunk/French.lproj/DisplayPreferences.strings trunk/French.lproj/GeneralPreferences.strings trunk/French.lproj/LineInspector.strings trunk/French.lproj/MainMenu.strings trunk/French.lproj/NoteWindow.strings trunk/French.lproj/NotesPreferences.strings trunk/German.lproj/DisplayPreferences.strings trunk/German.lproj/GeneralPreferences.strings trunk/German.lproj/LineInspector.strings trunk/German.lproj/MainMenu.strings trunk/German.lproj/NoteWindow.strings trunk/German.lproj/NotesPreferences.strings trunk/Italian.lproj/DisplayPreferences.strings trunk/Italian.lproj/GeneralPreferences.strings trunk/Italian.lproj/LineInspector.strings trunk/Italian.lproj/MainMenu.strings trunk/Italian.lproj/NoteWindow.strings trunk/Italian.lproj/NotesPreferences.strings trunk/Spanish.lproj/DisplayPreferences.strings trunk/Spanish.lproj/GeneralPreferences.strings trunk/Spanish.lproj/LineInspector.strings trunk/Spanish.lproj/MainMenu.strings trunk/Spanish.lproj/NoteWindow.strings trunk/Spanish.lproj/NotesPreferences.strings trunk/pl.lproj/DisplayPreferences.strings trunk/pl.lproj/GeneralPreferences.strings trunk/pl.lproj/LineInspector.strings trunk/pl.lproj/MainMenu.strings trunk/pl.lproj/NoteWindow.strings trunk/pl.lproj/NotesPreferences.strings trunk/postprocess-xib-strings.py trunk/ru.lproj/DisplayPreferences.strings trunk/ru.lproj/GeneralPreferences.strings trunk/ru.lproj/LineInspector.strings trunk/ru.lproj/MainMenu.strings trunk/ru.lproj/NoteWindow.strings trunk/ru.lproj/NotesPreferences.strings trunk/zh_TW.lproj/DisplayPreferences.strings trunk/zh_TW.lproj/GeneralPreferences.strings trunk/zh_TW.lproj/LineInspector.strings trunk/zh_TW.lproj/MainMenu.strings trunk/zh_TW.lproj/NoteWindow.strings trunk/zh_TW.lproj/NotesPreferences.strings Modified: trunk/Dutch.lproj/DisplayPreferences.strings =================================================================== (Binary files differ) Modified: trunk/Dutch.lproj/GeneralPreferences.strings =================================================================== (Binary files differ) Modified: trunk/Dutch.lproj/LineInspector.strings =================================================================== (Binary files differ) Modified: trunk/Dutch.lproj/MainMenu.strings =================================================================== (Binary files differ) Modified: trunk/Dutch.lproj/NoteWindow.strings =================================================================== (Binary files differ) Modified: trunk/Dutch.lproj/NotesPreferences.strings =================================================================== (Binary files differ) Modified: trunk/English.lproj/DisplayPreferences.strings =================================================================== (Binary files differ) Modified: trunk/English.lproj/GeneralPreferences.strings =================================================================== (Binary files differ) Modified: trunk/English.lproj/LineInspector.strings =================================================================== (Binary files differ) Modified: trunk/English.lproj/MainMenu.strings =================================================================== (Binary files differ) Modified: trunk/English.lproj/NoteWindow.strings =================================================================== (Binary files differ) Modified: trunk/English.lproj/NotesPreferences.strings =================================================================== (Binary files differ) Modified: trunk/French.lproj/DisplayPreferences.strings =================================================================== (Binary files differ) Modified: trunk/French.lproj/GeneralPreferences.strings =================================================================== (Binary files differ) Modified: trunk/French.lproj/LineInspector.strings =================================================================== (Binary files differ) Modified: trunk/French.lproj/MainMenu.strings =================================================================== (Binary files differ) Modified: trunk/French.lproj/NoteWindow.strings =================================================================== (Binary files differ) Modified: trunk/French.lproj/NotesPreferences.strings =================================================================== (Binary files differ) Modified: trunk/German.lproj/DisplayPreferences.strings =================================================================== (Binary files differ) Modified: trunk/German.lproj/GeneralPreferences.strings =================================================================== (Binary files differ) Modified: trunk/German.lproj/LineInspector.strings =================================================================== (Binary files differ) Modified: trunk/German.lproj/MainMenu.strings =================================================================== (Binary files differ) Modified: trunk/German.lproj/NoteWindow.strings =================================================================== (Binary files differ) Modified: trunk/German.lproj/NotesPreferences.strings =================================================================== (Binary files differ) Modified: trunk/Italian.lproj/DisplayPreferences.strings =================================================================== (Binary files differ) Modified: trunk/Italian.lproj/GeneralPreferences.strings =================================================================== (Binary files differ) Modified: trunk/Italian.lproj/LineInspector.strings =================================================================== (Binary files differ) Modified: trunk/Italian.lproj/MainMenu.strings =================================================================== (Binary files differ) Modified: trunk/Italian.lproj/NoteWindow.strings =================================================================== (Binary files differ) Modified: trunk/Italian.lproj/NotesPreferences.strings =================================================================== (Binary files differ) Modified: trunk/Spanish.lproj/DisplayPreferences.strings =================================================================== (Binary files differ) Modified: trunk/Spanish.lproj/GeneralPreferences.strings =================================================================== (Binary files differ) Modified: trunk/Spanish.lproj/LineInspector.strings =================================================================== (Binary files differ) Modified: trunk/Spanish.lproj/MainMenu.strings =================================================================== (Binary files differ) Modified: trunk/Spanish.lproj/NoteWindow.strings =================================================================== (Binary files differ) Modified: trunk/Spanish.lproj/NotesPreferences.strings =================================================================== (Binary files differ) Modified: trunk/pl.lproj/DisplayPreferences.strings =================================================================== (Binary files differ) Modified: trunk/pl.lproj/GeneralPreferences.strings =================================================================== (Binary files differ) Modified: trunk/pl.lproj/LineInspector.strings =================================================================== (Binary files differ) Modified: trunk/pl.lproj/MainMenu.strings =================================================================== (Binary files differ) Modified: trunk/pl.lproj/NoteWindow.strings =================================================================== (Binary files differ) Modified: trunk/pl.lproj/NotesPreferences.strings =================================================================== (Binary files differ) Modified: trunk/postprocess-xib-strings.py =================================================================== --- trunk/postprocess-xib-strings.py 2011-02-14 18:32:54 UTC (rev 7107) +++ trunk/postprocess-xib-strings.py 2011-02-14 22:33:26 UTC (rev 7108) @@ -7,13 +7,14 @@ argc = len(sys.argv) if argc != 3: - sys.stderr.write('Error: wrong number of arguments.\n') + sys.stderr.write('error: wrong number of arguments.\n') exit(1) input = sys.argv[1] output = sys.argv[2] -locline = re.compile(r'^"(.*)" = "(.*)";$') +locre = re.compile(r'^"(.*)" = "(.*)";$') +commentre = re.compile(r'^(/\*.*\*/)|(//.*)$') inputfile = codecs.open(input, 'r', 'utf-16') lines = inputfile.readlines() @@ -22,8 +23,25 @@ outputfile = codecs.open(output, 'w', 'utf-16') outputfile.seek(0) +foundstrings = set() +comment = None + for line in lines: - line = locline.sub(r'"\2" = "\2";', line, 1) - outputfile.write(line) + if commentre.match(line) != None: + comment = line + else: + match = locre.match(line) + if match != None: + string = match.group(2) + if string not in foundstrings: + foundstrings.add(string) + outputfile.write('\n') + if comment != None: + outputfile.write(comment) + line = match.expand(r'"\2" = "\2";\n') + outputfile.write(line) + comment = None + elif line != '\n': + sys.stderr.write('warning: confused about line in {0}:\n{1}\n'.format(input, line)) outputfile.close() Modified: trunk/ru.lproj/DisplayPreferences.strings =================================================================== (Binary files differ) Modified: trunk/ru.lproj/GeneralPreferences.strings =================================================================== (Binary files differ) Modified: trunk/ru.lproj/LineInspector.strings =================================================================== (Binary files differ) Modified: trunk/ru.lproj/MainMenu.strings =================================================================== (Binary files differ) Modified: trunk/ru.lproj/NoteWindow.strings =================================================================== (Binary files differ) Modified: trunk/ru.lproj/NotesPreferences.strings =================================================================== (Binary files differ) Modified: trunk/zh_TW.lproj/DisplayPreferences.strings =================================================================== (Binary files differ) Modified: trunk/zh_TW.lproj/GeneralPreferences.strings =================================================================== (Binary files differ) Modified: trunk/zh_TW.lproj/LineInspector.strings =================================================================== (Binary files differ) Modified: trunk/zh_TW.lproj/MainMenu.strings =================================================================== (Binary files differ) Modified: trunk/zh_TW.lproj/NoteWindow.strings =================================================================== (Binary files differ) Modified: trunk/zh_TW.lproj/NotesPreferences.strings =================================================================== (Binary files differ) This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. ------------------------------------------------------------------------------ The ultimate all-in-one performance toolkit: Intel(R) Parallel Studio XE: Pinpoint memory and threading errors before they happen. Find and fix more than 250 security defects in the development cycle. Locate bottlenecks in serial and parallel code that limit performance. http://p.sf.net/sfu/intel-dev2devfeb _______________________________________________ Skim-app-commit mailing list Skim-app-commit@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/skim-app-commit