diff options
| author | Leon Scroggins <scroggo@google.com> | 2009-12-11 15:12:12 -0500 |
|---|---|---|
| committer | Leon Scroggins <scroggo@google.com> | 2009-12-15 08:50:06 -0500 |
| commit | 334e51bc2ff9bf7fc55fa67dc8a6d9257501a32e (patch) | |
| tree | 2178fd95aa4eea6732de9881e9348edee3cfb22a /WebCore | |
| parent | c337233bf32d37af40d40c195996c2d3bf0cba8a (diff) | |
| download | external_webkit-334e51bc2ff9bf7fc55fa67dc8a6d9257501a32e.zip external_webkit-334e51bc2ff9bf7fc55fa67dc8a6d9257501a32e.tar.gz external_webkit-334e51bc2ff9bf7fc55fa67dc8a6d9257501a32e.tar.bz2 | |
Provide localized strings for <input> labels.
Fix for http://b/issue?id=2178786
Call up to Java to get strings for <input> labels, and use them
on inputs.
Requires a change in frameworks/base.
Diffstat (limited to 'WebCore')
| -rw-r--r-- | WebCore/platform/android/FileChooserAndroid.cpp | 17 | ||||
| -rw-r--r-- | WebCore/platform/android/LocalizedStringsAndroid.cpp | 23 | ||||
| -rw-r--r-- | WebCore/platform/android/PlatformBridge.h | 10 |
3 files changed, 32 insertions, 18 deletions
diff --git a/WebCore/platform/android/FileChooserAndroid.cpp b/WebCore/platform/android/FileChooserAndroid.cpp index 69d0883..1f8200f 100644 --- a/WebCore/platform/android/FileChooserAndroid.cpp +++ b/WebCore/platform/android/FileChooserAndroid.cpp @@ -25,7 +25,6 @@ #include "config.h" #include "FileChooser.h" - #include "Font.h" namespace WebCore { @@ -44,18 +43,4 @@ String FileChooser::basenameForWidth(const Font& font, int width) const return output; } -// The following two strings are used for File Upload form control, ie -// <input type="file">. The first is the text that appears on the button -// that when pressed, the user can browse for and select a file. The -// second string is rendered on the screen when no file has been selected. -String fileButtonChooseFileLabel() -{ - return String("Upload a file"); -} - -String fileButtonNoFileSelectedLabel() -{ - return String("No file selected"); -} - -} // namesapce WebCore +} // namespace WebCore diff --git a/WebCore/platform/android/LocalizedStringsAndroid.cpp b/WebCore/platform/android/LocalizedStringsAndroid.cpp index 2fc880b..ab1c895 100644 --- a/WebCore/platform/android/LocalizedStringsAndroid.cpp +++ b/WebCore/platform/android/LocalizedStringsAndroid.cpp @@ -31,10 +31,27 @@ #include "LocalizedStrings.h" #include "NotImplemented.h" +#include "PlatformBridge.h" #include "PlatformString.h" namespace WebCore { +// The following two strings are used for File Upload form control, ie +// <input type="file">. The first is the text that appears on the button +// that when pressed, the user can browse for and select a file. The +// second string is rendered on the screen when no file has been selected. +String fileButtonChooseFileLabel() +{ + return *(PlatformBridge::globalLocalizedName( + PlatformBridge::FileUploadLabel)); +} + +String fileButtonNoFileSelectedLabel() +{ + notImplemented(); + return String(); +} + String contextMenuItemTagInspectElement() { return String("Inspect Element"); @@ -305,12 +322,14 @@ String searchableIndexIntroduction() String resetButtonDefaultLabel() { - return String("Reset"); + return *(PlatformBridge::globalLocalizedName( + PlatformBridge::ResetLabel)); } String submitButtonDefaultLabel() { - return String("Submit"); + return *(PlatformBridge::globalLocalizedName( + PlatformBridge::SubmitLabel)); } String inputElementAltText() diff --git a/WebCore/platform/android/PlatformBridge.h b/WebCore/platform/android/PlatformBridge.h index 977a0fd..e3f3b98 100644 --- a/WebCore/platform/android/PlatformBridge.h +++ b/WebCore/platform/android/PlatformBridge.h @@ -48,6 +48,16 @@ public: // KeyGenerator static WTF::Vector<String> getSupportedKeyStrengthList(); static String getSignedPublicKeyAndChallengeString(unsigned index, const String& challenge, const KURL&); + // These ids need to be in sync with the constants in BrowserFrame.java + enum rawResId { + NoDomain = 1, + LoadError, + DrawableDir, + FileUploadLabel, + ResetLabel, + SubmitLabel + }; + static String* globalLocalizedName(rawResId resId); }; } #endif // PlatformBridge_h |
