[Mac] Make built-in PDF description localizable
authorap@apple.com <ap@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Wed, 5 Oct 2011 19:22:21 +0000 (19:22 +0000)
committerap@apple.com <ap@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Wed, 5 Oct 2011 19:22:21 +0000 (19:22 +0000)
https://bugs.webkit.org/show_bug.cgi?id=69442

Reviewed by Dan Bernstein.

Source/WebCore:

Added strings for plug-in's name and for its supported MIME type.

* English.lproj/Localizable.strings:
* WebCore.exp.in:
* platform/DefaultLocalizationStrategy.cpp:
(WebCore::DefaultLocalizationStrategy::builtInPDFPluginName):
(WebCore::DefaultLocalizationStrategy::pdfDocumentTypeDescription):
* platform/DefaultLocalizationStrategy.h:
* platform/LocalizationStrategy.h:
* platform/LocalizedStrings.cpp:
(WebCore::builtInPDFPluginName):
(WebCore::pdfDocumentTypeDescription):
* platform/LocalizedStrings.h:

Source/WebKit2:

* WebProcess/Plugins/PDF/BuiltInPDFView.cpp: Use a localized string instead of a literal one.

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

Source/WebCore/ChangeLog
Source/WebCore/English.lproj/Localizable.strings
Source/WebCore/WebCore.exp.in
Source/WebCore/platform/DefaultLocalizationStrategy.cpp
Source/WebCore/platform/DefaultLocalizationStrategy.h
Source/WebCore/platform/LocalizationStrategy.h
Source/WebCore/platform/LocalizedStrings.cpp
Source/WebCore/platform/LocalizedStrings.h
Source/WebKit2/ChangeLog
Source/WebKit2/WebProcess/Plugins/PDF/BuiltInPDFView.cpp

index 43945e7..e89d740 100644 (file)
@@ -1,3 +1,24 @@
+2011-10-05  Alexey Proskuryakov  <ap@apple.com>
+
+        [Mac] Make built-in PDF description localizable
+        https://bugs.webkit.org/show_bug.cgi?id=69442
+
+        Reviewed by Dan Bernstein.
+
+        Added strings for plug-in's name and for its supported MIME type.
+
+        * English.lproj/Localizable.strings:
+        * WebCore.exp.in:
+        * platform/DefaultLocalizationStrategy.cpp:
+        (WebCore::DefaultLocalizationStrategy::builtInPDFPluginName):
+        (WebCore::DefaultLocalizationStrategy::pdfDocumentTypeDescription):
+        * platform/DefaultLocalizationStrategy.h:
+        * platform/LocalizationStrategy.h:
+        * platform/LocalizedStrings.cpp:
+        (WebCore::builtInPDFPluginName):
+        (WebCore::pdfDocumentTypeDescription):
+        * platform/LocalizedStrings.h:
+
 2011-10-05  David Levin  <levin@chromium.org>
 
         Attempt to fix the bindings test (broken by r96727).
index 656bb10..b027cb3 100644 (file)
Binary files a/Source/WebCore/English.lproj/Localizable.strings and b/Source/WebCore/English.lproj/Localizable.strings differ
index c9488bc..7c9d56f 100644 (file)
@@ -572,6 +572,7 @@ __ZN7WebCore20SpaceSplitStringData12createVectorEv
 __ZN7WebCore20UserGestureIndicator7s_stateE
 __ZN7WebCore20UserGestureIndicatorC1ENS_26ProcessingUserGestureStateE
 __ZN7WebCore20UserGestureIndicatorD1Ev
+__ZN7WebCore20builtInPDFPluginNameEv
 __ZN7WebCore20makeRGBA32FromFloatsEffff
 __ZN7WebCore20protocolIsJavaScriptERKN3WTF6StringE
 __ZN7WebCore21BackForwardController11itemAtIndexEi
@@ -639,6 +640,7 @@ __ZN7WebCore26UserTypingGestureIndicator27processingUserTypingGestureEv
 __ZN7WebCore26UserTypingGestureIndicator28focusedElementAtGestureStartEv
 __ZN7WebCore26contextMenuItemTagFontMenuEv
 __ZN7WebCore26contextMenuItemTagOpenLinkEv
+__ZN7WebCore26pdfDocumentTypeDescriptionEv
 __ZN7WebCore26stopObservingCookieChangesEv
 __ZN7WebCore26usesTestModeFocusRingColorEv
 __ZN7WebCore27AuthenticationChallengeBaseC2Ev
index 53b1869..adc809f 100644 (file)
@@ -729,6 +729,18 @@ String DefaultLocalizationStrategy::allFilesText()
 
 #if PLATFORM(MAC)
 
+String DefaultLocalizationStrategy::builtInPDFPluginName()
+{
+    // Also exposed to DOM.
+    return WEB_UI_STRING("WebKit built-in PDF", "Pseudo plug-in name, visible in Installed Plug-ins page in Safari.");
+}
+
+String DefaultLocalizationStrategy::pdfDocumentTypeDescription()
+{
+    // Also exposed to DOM.
+    return WEB_UI_STRING("Portable Document Format", "Description of the (only) type supported by PDF pseudo plug-in. Visible in Installed Plug-ins page in Safari.");
+}
+
 String DefaultLocalizationStrategy::keygenMenuItem512()
 {
     return WEB_UI_STRING("512 (Low Grade)", "Menu item title for KEYGEN pop-up menu");
index 9462a43..f11ce99 100644 (file)
@@ -162,6 +162,8 @@ public:
     virtual String allFilesText();
 #endif
 #if PLATFORM(MAC)
+    virtual String builtInPDFPluginName();
+    virtual String pdfDocumentTypeDescription();
     virtual String keygenMenuItem512();
     virtual String keygenMenuItem1024();
     virtual String keygenMenuItem2048();
index 7c4eb75..b2eab17 100644 (file)
@@ -169,6 +169,8 @@ public:
 #endif
 
 #if PLATFORM(MAC)
+    virtual String builtInPDFPluginName() = 0;
+    virtual String pdfDocumentTypeDescription() = 0;
     virtual String keygenMenuItem512() = 0;
     virtual String keygenMenuItem1024() = 0;
     virtual String keygenMenuItem2048() = 0;
index 75f705b..a95cfff 100644 (file)
@@ -583,6 +583,16 @@ String allFilesText()
 #endif
 
 #if PLATFORM(MAC)
+String builtInPDFPluginName()
+{
+    return localizationStrategy()->builtInPDFPluginName();
+}
+
+String pdfDocumentTypeDescription()
+{
+    return localizationStrategy()->pdfDocumentTypeDescription();
+}
+
 String keygenMenuItem512()
 {
     return localizationStrategy()->keygenMenuItem512();
index 76e1d2b..3293da4 100644 (file)
@@ -165,6 +165,8 @@ namespace WebCore {
 #endif
 
 #if PLATFORM(MAC)
+    String builtInPDFPluginName();
+    String pdfDocumentTypeDescription();
     String keygenMenuItem512();
     String keygenMenuItem1024();
     String keygenMenuItem2048();
index e748c11..5ba4121 100644 (file)
@@ -1,3 +1,12 @@
+2011-10-05  Alexey Proskuryakov  <ap@apple.com>
+
+        [Mac] Make built-in PDF description localizable
+        https://bugs.webkit.org/show_bug.cgi?id=69442
+
+        Reviewed by Dan Bernstein.
+
+        * WebProcess/Plugins/PDF/BuiltInPDFView.cpp: Use a localized string instead of a literal one.
+
 2011-10-05  Chang Shu  <cshu@webkit.org>
 
         [WK2] WebKitTestRunner needs LayoutTestController.dumpConfigurationForViewport
index 716ebf1..8346637 100644 (file)
@@ -35,6 +35,7 @@
 #include <WebCore/FrameView.h>
 #include <WebCore/GraphicsContext.h>
 #include <WebCore/HTTPHeaderMap.h>
+#include <WebCore/LocalizedStrings.h>
 #include <WebCore/Page.h>
 #include <WebCore/PluginData.h>
 #include <WebCore/ScrollAnimator.h>
@@ -72,11 +73,11 @@ BuiltInPDFView::~BuiltInPDFView()
 PluginInfo BuiltInPDFView::pluginInfo()
 {
     PluginInfo info;
-    info.name = "WebKit built-in PDF"; // FIXME: Name and description should be localizable.
+    info.name = builtInPDFPluginName();
 
     MimeClassInfo mimeClassInfo;
     mimeClassInfo.type ="application/pdf";
-    mimeClassInfo.desc = "Portable Document Format";
+    mimeClassInfo.desc = pdfDocumentTypeDescription();
     mimeClassInfo.extensions.append("pdf");
 
     info.mimes.append(mimeClassInfo);