Merge the Windows and Mac localized strings and exceptions files
authoraroben <aroben@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Wed, 4 Jul 2007 00:40:57 +0000 (00:40 +0000)
committeraroben <aroben@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Wed, 4 Jul 2007 00:40:57 +0000 (00:40 +0000)
WebKit:

        Merge the Windows and Mac localized strings and exceptions files

        Reviewed by Darin and Anders.

        * English.lproj/Localizable.strings: Added Windows strings.
        * StringsNotToBeLocalized.txt: Renamed from WebKit/English.lproj/StringsNotToBeLocalized.txt.

WebKit/win:

        Merge the Windows and Mac localized strings and exceptions files

        Reviewed by Darin and Anders.

        * English.lproj/Localizable.strings: Added Mac strings.
        * English.lproj/StringsNotToBeLocalized.txt: Removed.

WebKitTools:

        Modify scripts to keep Mac/Windows localized strings in sync

        extract-webkit-localizable-strings now handles extracting strings from
        both the Mac and Windows WebKit ports and updating their respective
        Localizable.strings files. extract-localizable-strings is now really a
        piece of plumbing rather than a top-level tool.

        Reviewed by Darin and Anders.

        * Scripts/extract-localizable-strings: Changed to handle multiple
        directories.
        * Scripts/extract-webkit-localizable-strings: Added.

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@23972 268f45cc-cd09-0410-ab3c-d52691b4dbfc

WebKit/ChangeLog
WebKit/English.lproj/Localizable.strings
WebKit/StringsNotToBeLocalized.txt [moved from WebKit/English.lproj/StringsNotToBeLocalized.txt with 67% similarity]
WebKit/win/ChangeLog
WebKit/win/English.lproj/Localizable.strings
WebKit/win/English.lproj/StringsNotToBeLocalized.txt [deleted file]
WebKitTools/ChangeLog
WebKitTools/Scripts/extract-localizable-strings
WebKitTools/Scripts/extract-webkit-localizable-strings [new file with mode: 0755]

index 4c0b52fc022789b234f2c952337a2a8726063423..f03e4657f182dbe4c5f4b6af2c75ac1f6d0aee75 100644 (file)
@@ -1,3 +1,12 @@
+2007-07-03  Adam Roben  <aroben@apple.com>
+
+        Merge the Windows and Mac localized strings and exceptions files
+
+        Reviewed by Darin and Anders.
+
+        * English.lproj/Localizable.strings: Added Windows strings.
+        * StringsNotToBeLocalized.txt: Renamed from WebKit/English.lproj/StringsNotToBeLocalized.txt.
+
 2007-07-03  Adele Peterson  <adele@apple.com>
 
         Removed printf I accidently left in.
index 801bc4a83c0192561f2914dabcab00a98df3ec70..7565faf7d809dce35eba122c8c9be5b9e4d63ac2 100644 (file)
Binary files a/WebKit/English.lproj/Localizable.strings and b/WebKit/English.lproj/Localizable.strings differ
similarity index 67%
rename from WebKit/English.lproj/StringsNotToBeLocalized.txt
rename to WebKit/StringsNotToBeLocalized.txt
index a2913bc83210cb7b35fe8f5cab368bcbef7615a3..4eb0235bede0ba9d7790c7a0a29df3b754020154 100644 (file)
@@ -12,6 +12,7 @@
 "%.1lf"
 "%.2lu/%.2lu/%.10lu-%.10lu.cache"
 "%.2u/%.2u/%.10u-%.10u.cache"
+"%20"
 "%2d) "
 "%@ %.0fpx %.0fpx %.0fpx"
 "%@ %.0fpx %.0fpx"
 "%d"
 "%dpx"
 "%ld"
+"&ie=UTF-8&oe=UTF-8"
+"+"
 ","
 "-"
 "-1px"
 "-khtml-text-decorations-in-effect"
 "."
 "._"
+".download"
 "/"
 "/Frameworks/PDFKit.framework"
 "/Library/Internet Plug-Ins"
@@ -86,6 +90,7 @@
 "BEGIN:VCALENDAR"
 "BEGIN:VCARD"
 "BP_CreatePluginMIMETypesPreferences"
+"BackwardDelete"
 "Cache-Control"
 "Content-Length"
 "Courier"
 "LTR"
 "Library/Internet Plug-Ins"
 "Look Up in Dictionary menu title."
+"Lucida Grande"
 "MenuCommands"
 "MoveBackward"
 "MoveBackwardAndModifySelection"
 "WebKitErrorPlugInPageURLStringKey"
 "WebKitHistoryAgeInDaysLimit"
 "WebKitHistoryItemLimit"
+"WebKitLogLevel"
 "WebKitOmitPDFSupport"
 "WebKitOriginalBottomMargin"
 "WebKitOriginalTopMargin"
 "\"@?"
 "\"\\"
 "\0"
+"\\"
 "\n        "
 "\n    "
 "\n"
 "htm"
 "html"
 "http"
+"http://www.google.com/search?client=safari&q="
 "https"
 "icon.db"
 "image.pict"
 "pluginspage"
 "proxy-revalidate"
 "r"
+"r+b"
 "resizeTop"
 "rgb(%.0f,%.0f,%.0f)"
 "rgba(%.0f,%.0f,%.0f,%f)"
 "xml"
 "yahoo.com"
 "~/Library/Icons"
-DOM/WebDOMOperations.mm:"background"
-DOM/WebDOMOperations.mm:"data"
-DOM/WebDOMOperations.mm:"icon"
-DOM/WebDOMOperations.mm:"movie"
-DOM/WebDOMOperations.mm:"stylesheet"
-DefaultDelegates/WebDefaultContextMenuDelegate.mm:"Look Up in Dictionary"
-DefaultDelegates/WebDefaultContextMenuDelegate.mm:"Search in Google"
-DefaultDelegates/WebDefaultContextMenuDelegate.mm:"Search in Spotlight"
-DefaultDelegates/WebScriptDebugServer.m
-History/WebHistoryItem.mm:" in \"%@\""
-History/WebHistoryItem.mm:"children"
-History/WebHistoryItem.mm:"title"
-Misc/WebCache.mm
-Misc/WebKitLogging.h:"<not running on main thread>"
-Misc/WebKitLogging.m
-Misc/WebKitVersionChecks.m
-Misc/WebNSURLExtras.m:"IDNScriptWhiteList"
-Misc/WebNSURLExtras.m:"IDNScriptWhiteList.txt"
-Misc/WebNSURLExtras.m:"file"
-Misc/WebNSURLRequestExtras.m
-Plugins/WebBaseNetscapePluginStream.mm:" OK\n"
-Plugins/WebBaseNetscapePluginStream.mm:": "
-Plugins/WebBaseNetscapePluginStream.mm:"HTTP "
-Plugins/WebBaseNetscapePluginView.mm:"height"
-Plugins/WebBaseNetscapePluginView.mm:"width"
-Plugins/WebBasePluginPackage.m:"Java Applet Plugin Enabler"
-Plugins/WebBasePluginPackage.m:"name: %@\npath: %@\nmimeTypes:\n%@\npluginDescription:%@"
-Plugins/WebNetscapePluginPackage.m:"RealPlayer Plugin"
-Plugins/WebNetscapePluginPackage.m:"main"
-WebCoreSupport/WebChromeClient.mm
-WebCoreSupport/WebEditorClient.mm:"Down"
-WebCoreSupport/WebEditorClient.mm:"Enter"
-WebCoreSupport/WebEditorClient.mm:"Up"
-WebCoreSupport/WebFrameBridge.mm:"height"
-WebCoreSupport/WebFrameBridge.mm:"width"
-WebInspector/WebInspector.m
-WebInspector/WebInspectorPanel.m:"control"
-WebInspector/WebInspectorPanel.m:"resize"
-WebView/WebHTMLView.mm:"%0.fpx"
-WebView/WebHTMLView.mm:"'%@'"
-WebView/WebHTMLView.mm:"Version:"
-WebView/WebHTMLView.mm:"applet"
-WebView/WebHTMLView.mm:"b"
-WebView/WebHTMLView.mm:"baseline"
-WebView/WebHTMLView.mm:"black"
-WebView/WebHTMLView.mm:"body"
-WebView/WebHTMLView.mm:"bold"
-WebView/WebHTMLView.mm:"center"
-WebView/WebHTMLView.mm:"font"
-WebView/WebHTMLView.mm:"head"
-WebView/WebHTMLView.mm:"i"
-WebView/WebHTMLView.mm:"italic"
-WebView/WebHTMLView.mm:"justify"
-WebView/WebHTMLView.mm:"left"
-WebView/WebHTMLView.mm:"line-through"
-WebView/WebHTMLView.mm:"menu"
-WebView/WebHTMLView.mm:"none"
-WebView/WebHTMLView.mm:"normal"
-WebView/WebHTMLView.mm:"object"
-WebView/WebHTMLView.mm:"right"
-WebView/WebHTMLView.mm:"strike"
-WebView/WebHTMLView.mm:"style"
-WebView/WebHTMLView.mm:"sub"
-WebView/WebHTMLView.mm:"submit"
-WebView/WebHTMLView.mm:"super"
-WebView/WebHTMLView.mm:"transparent"
-WebView/WebHTMLView.mm:"underline"
-WebView/WebHTMLView.mm:"white"
-WebView/WebPreferenceKeysPrivate.h
-WebView/WebPreferences.m:"Identifier"
-WebView/WebPreferences.m:"Values"
-WebView/WebPreferences.m:"WebPreferences%d"
-WebView/WebRenderNode.mm
-WebView/WebScriptDebugDelegate.mm
-WebView/WebView.mm:"Preferences"
-WebView/WebView.mm:"Search With Google"
-WebView/WebView.mm:"Show DOM Tree"
-WebView/WebView.mm:"control"
-WebView/WebView.mm:"return "
+WebKit/DOM/WebDOMOperations.mm:"background"
+WebKit/DOM/WebDOMOperations.mm:"data"
+WebKit/DOM/WebDOMOperations.mm:"icon"
+WebKit/DOM/WebDOMOperations.mm:"movie"
+WebKit/DOM/WebDOMOperations.mm:"stylesheet"
+WebKit/DefaultDelegates/WebDefaultContextMenuDelegate.mm:"Look Up in Dictionary"
+WebKit/DefaultDelegates/WebDefaultContextMenuDelegate.mm:"Search in Google"
+WebKit/DefaultDelegates/WebDefaultContextMenuDelegate.mm:"Search in Spotlight"
+WebKit/DefaultDelegates/WebScriptDebugServer.m
+WebKit/History/WebHistoryItem.mm:" in \"%@\""
+WebKit/History/WebHistoryItem.mm:"children"
+WebKit/History/WebHistoryItem.mm:"title"
+WebKit/Misc/WebCache.mm
+WebKit/Misc/WebKitLogging.h:"<not running on main thread>"
+WebKit/Misc/WebKitLogging.m
+WebKit/Misc/WebKitVersionChecks.m
+WebKit/Misc/WebNSURLExtras.m:"IDNScriptWhiteList"
+WebKit/Misc/WebNSURLExtras.m:"IDNScriptWhiteList.txt"
+WebKit/Misc/WebNSURLExtras.m:"file"
+WebKit/Misc/WebNSURLRequestExtras.m
+WebKit/Plugins/WebBaseNetscapePluginStream.mm:" OK\n"
+WebKit/Plugins/WebBaseNetscapePluginStream.mm:": "
+WebKit/Plugins/WebBaseNetscapePluginStream.mm:"HTTP "
+WebKit/Plugins/WebBaseNetscapePluginView.mm:"height"
+WebKit/Plugins/WebBaseNetscapePluginView.mm:"width"
+WebKit/Plugins/WebBasePluginPackage.m:"Java Applet Plugin Enabler"
+WebKit/Plugins/WebBasePluginPackage.m:"name: %@\npath: %@\nmimeTypes:\n%@\npluginDescription:%@"
+WebKit/Plugins/WebNetscapePluginPackage.m:"RealPlayer Plugin"
+WebKit/Plugins/WebNetscapePluginPackage.m:"main"
+WebKit/WebCoreSupport/WebChromeClient.mm
+WebKit/WebCoreSupport/WebEditorClient.mm:"Down"
+WebKit/WebCoreSupport/WebEditorClient.mm:"Enter"
+WebKit/WebCoreSupport/WebEditorClient.mm:"Up"
+WebKit/WebCoreSupport/WebFrameBridge.mm:"height"
+WebKit/WebCoreSupport/WebFrameBridge.mm:"width"
+WebKit/WebInspector/WebInspector.m
+WebKit/WebInspector/WebInspectorPanel.m:"control"
+WebKit/WebInspector/WebInspectorPanel.m:"resize"
+WebKit/WebView/WebHTMLView.mm:"%0.fpx"
+WebKit/WebView/WebHTMLView.mm:"'%@'"
+WebKit/WebView/WebHTMLView.mm:"Version:"
+WebKit/WebView/WebHTMLView.mm:"applet"
+WebKit/WebView/WebHTMLView.mm:"b"
+WebKit/WebView/WebHTMLView.mm:"baseline"
+WebKit/WebView/WebHTMLView.mm:"black"
+WebKit/WebView/WebHTMLView.mm:"body"
+WebKit/WebView/WebHTMLView.mm:"bold"
+WebKit/WebView/WebHTMLView.mm:"center"
+WebKit/WebView/WebHTMLView.mm:"font"
+WebKit/WebView/WebHTMLView.mm:"head"
+WebKit/WebView/WebHTMLView.mm:"i"
+WebKit/WebView/WebHTMLView.mm:"italic"
+WebKit/WebView/WebHTMLView.mm:"justify"
+WebKit/WebView/WebHTMLView.mm:"left"
+WebKit/WebView/WebHTMLView.mm:"line-through"
+WebKit/WebView/WebHTMLView.mm:"menu"
+WebKit/WebView/WebHTMLView.mm:"none"
+WebKit/WebView/WebHTMLView.mm:"normal"
+WebKit/WebView/WebHTMLView.mm:"object"
+WebKit/WebView/WebHTMLView.mm:"right"
+WebKit/WebView/WebHTMLView.mm:"strike"
+WebKit/WebView/WebHTMLView.mm:"style"
+WebKit/WebView/WebHTMLView.mm:"sub"
+WebKit/WebView/WebHTMLView.mm:"submit"
+WebKit/WebView/WebHTMLView.mm:"super"
+WebKit/WebView/WebHTMLView.mm:"transparent"
+WebKit/WebView/WebHTMLView.mm:"underline"
+WebKit/WebView/WebHTMLView.mm:"white"
+WebKit/WebView/WebPreferenceKeysPrivate.h
+WebKit/WebView/WebPreferences.m:"Identifier"
+WebKit/WebView/WebPreferences.m:"Values"
+WebKit/WebView/WebPreferences.m:"WebPreferences%d"
+WebKit/WebView/WebRenderNode.mm
+WebKit/WebView/WebScriptDebugDelegate.mm
+WebKit/WebView/WebView.mm:"Preferences"
+WebKit/WebView/WebView.mm:"Search With Google"
+WebKit/WebView/WebView.mm:"Show DOM Tree"
+WebKit/WebView/WebView.mm:"control"
+WebKit/WebView/WebView.mm:"return "
+WebKit/win/ProgIDMacros.h
+WebKit/win/WebCache.cpp
+WebKit/win/WebDownload.cpp:"ab"
+WebKit/win/WebFrame.cpp
+WebKit/win/WebHistory.cpp
+WebKit/win/WebHistoryItem.cpp
+WebKit/win/WebIconDatabase.cpp
+WebKit/win/WebInspector/WebInspector.cpp
+WebKit/win/WebKitDLL.cpp
+WebKit/win/WebLocalizableStrings.cpp
+WebKit/win/WebPreferenceKeysPrivate.h
+WebKit/win/WebPreferences.cpp
+WebKit/win/WebURLResponse.cpp
+WebKit/win/WebView.cpp
index 4108d25f78ba924415093fadb178fbcda8402ba8..5935fe7497069861c35687104eddf9cdac5dd71a 100644 (file)
@@ -1,3 +1,12 @@
+2007-07-03  Adam Roben  <aroben@apple.com>
+
+        Merge the Windows and Mac localized strings and exceptions files
+
+        Reviewed by Darin and Anders.
+
+        * English.lproj/Localizable.strings: Added Mac strings.
+        * English.lproj/StringsNotToBeLocalized.txt: Removed.
+
 2007-06-27  Steve Falkenburg  <sfalken@apple.com>
 
         Turn on static code analysis.
index ff0c56fb8bc5d4a10efab173d56ab5b372b97975..7565faf7d809dce35eba122c8c9be5b9e4d63ac2 100644 (file)
Binary files a/WebKit/win/English.lproj/Localizable.strings and b/WebKit/win/English.lproj/Localizable.strings differ
diff --git a/WebKit/win/English.lproj/StringsNotToBeLocalized.txt b/WebKit/win/English.lproj/StringsNotToBeLocalized.txt
deleted file mode 100644 (file)
index 81b567f..0000000
+++ /dev/null
@@ -1,24 +0,0 @@
-"%20"
-"+"
-"&ie=UTF-8&oe=UTF-8"
-".download"
-"\\"
-"BackwardDelete"
-"http://www.google.com/search?client=safari&q="
-"Lucida Grande"
-"r+b"
-"WebKitLogLevel"
-ProgIDMacros.h
-WebCache.cpp
-WebDownload.cpp:"ab"
-WebFrame.cpp
-WebHistory.cpp
-WebHistoryItem.cpp
-WebIconDatabase.cpp
-WebInspector/WebInspector.cpp
-WebKitDLL.cpp
-WebLocalizableStrings.cpp
-WebPreferenceKeysPrivate.h
-WebPreferences.cpp
-WebURLResponse.cpp
-WebView.cpp
index 8803b39981236c236e9f1b2ebe38c369c1d52a95..81588c68d1345ad07ed8e39bfcd962214290e7e6 100644 (file)
@@ -1,3 +1,18 @@
+2007-07-03  Adam Roben  <aroben@apple.com>
+
+        Modify scripts to keep Mac/Windows localized strings in sync
+
+        extract-webkit-localizable-strings now handles extracting strings from
+        both the Mac and Windows WebKit ports and updating their respective
+        Localizable.strings files. extract-localizable-strings is now really a
+        piece of plumbing rather than a top-level tool.
+
+        Reviewed by Darin and Anders.
+
+        * Scripts/extract-localizable-strings: Changed to handle multiple
+        directories.
+        * Scripts/extract-webkit-localizable-strings: Added.
+
 2007-07-03  Adele Peterson  <adele@apple.com>
 
         Reviewed by Darin.
index 07cf319fafbb8363c3df8be175a3d022b6bf1c39..d150c1d65b6a2c47c8f53e90b7e4586df55848b7 100755 (executable)
@@ -1,6 +1,6 @@
 #!/usr/bin/perl -w
 
-# Copyright (C) 2006 Apple Computer, Inc.  All rights reserved.
+# Copyright (C) 2006, 2007 Apple Inc.  All rights reserved.
 #
 # Redistribution and use in source and binary forms, with or without
 # modification, are permitted provided that the following conditions
 
 use strict;
 
-my $exceptionsFile = "English.lproj/StringsNotToBeLocalized.txt";
 my $stringsFile = "English.lproj/Localizable.strings";
 my %isDebugMacro = ( ASSERT_WITH_MESSAGE => 1, LOG_ERROR => 1, ERROR => 1, NSURL_ERROR => 1, FATAL => 1, LOG => 1, dprintf => 1, NSException => 1, NSLog => 1, printf => 1 );
 
-die "usage: extract-localizable-strings\n" if @ARGV != 0;
+@ARGV >= 1 or die "Usage: extract-localizable-strings <exceptions file> [ directory... ]\nDid you mean to run extract-webkit-localizable-strings instead?\n";
+
+my $exceptionsFile = $ARGV[0];
+-f $exceptionsFile or die "Couldn't find exceptions file $exceptionsFile\n";
+
+my @directories;
+if (@ARGV < 2) {
+    push(@directories, ".");
+} else {
+    push(@directories, @ARGV[1 .. $#ARGV]);
+}
 
 my $sawError = 0;
 
@@ -77,13 +86,13 @@ if (open EXCEPTIONS, $exceptionsFile) {
     close EXCEPTIONS;
 }
 
-my @files = ( split "\n", `find . -name "*.h" -o -name "*.m" -o -name "*.mm" -o -name "*.cpp"` );
+my $quotedDirectoriesString = '"' . join('" "', @directories) . '"';
 
-for my $file (sort @files) {
+my @files = ( split "\n", `find $quotedDirectoriesString -name "*.h" -o -name "*.m" -o -name "*.mm" -o -name "*.cpp"` );
 
+for my $file (sort @files) {
     next if $file =~ /\/WebLocalizableStrings\.h$/;
     next if $file =~ /\/icu\//;
-    next if $file =~ /\/COM\//;
 
     $file =~ s-^./--;
 
@@ -317,7 +326,10 @@ for my $key (sort keys %commentByKey) {
 }
 
 # Write out the strings file in UTF-16 with a BOM.
-open STRINGS, ">", $stringsFile or die;
 utf8::decode($localizedStrings) if $^V ge chr(5).chr(8);
-print STRINGS pack "n*", (0xFEFF, unpack "U*", $localizedStrings);
-close STRINGS;
+my $output = pack "n*", (0xFEFF, unpack "U*", $localizedStrings);
+foreach my $directory (@directories) {
+    open STRINGS, ">", "$directory/$stringsFile" or die;
+    print STRINGS $output;
+    close STRINGS;
+}
diff --git a/WebKitTools/Scripts/extract-webkit-localizable-strings b/WebKitTools/Scripts/extract-webkit-localizable-strings
new file mode 100755 (executable)
index 0000000..f1da8cf
--- /dev/null
@@ -0,0 +1,44 @@
+#!/usr/bin/perl -w
+
+# Copyright (C) 2007 Apple Inc.  All rights reserved.
+#
+# Redistribution and use in source and binary forms, with or without
+# modification, are permitted provided that the following conditions
+# are met:
+#
+# 1.  Redistributions of source code must retain the above copyright
+#     notice, this list of conditions and the following disclaimer. 
+# 2.  Redistributions in binary form must reproduce the above copyright
+#     notice, this list of conditions and the following disclaimer in the
+#     documentation and/or other materials provided with the distribution. 
+# 3.  Neither the name of Apple Computer, Inc. ("Apple") nor the names of
+#     its contributors may be used to endorse or promote products derived
+#     from this software without specific prior written permission. 
+#
+# THIS SOFTWARE IS PROVIDED BY APPLE AND ITS CONTRIBUTORS "AS IS" AND ANY
+# EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+# WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+# DISCLAIMED. IN NO EVENT SHALL APPLE OR ITS CONTRIBUTORS BE LIABLE FOR ANY
+# DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
+# (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
+# LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
+# ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
+# THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+use strict;
+use warnings;
+
+use File::Basename;
+use FindBin;
+use lib $FindBin::Bin;
+use webkitdirs;
+
+my @directoriesToScan = ("WebKit", "WebKit/win");
+my $exceptionsFile = "WebKit/StringsNotToBeLocalized.txt";
+
+@ARGV == 0 or die "Usage: " . basename($0) . "\n";
+
+chdirWebKit();
+
+exec "extract-localizable-strings", $exceptionsFile, @directoriesToScan;