summaryrefslogtreecommitdiffstats
path: root/webkit
diff options
context:
space:
mode:
authortc@google.com <tc@google.com@0039d316-1c4b-4281-b951-d872f2087c98>2009-01-22 01:24:08 +0000
committertc@google.com <tc@google.com@0039d316-1c4b-4281-b951-d872f2087c98>2009-01-22 01:24:08 +0000
commit5bc0feb22687326cc26214c100c4658c79ce314f (patch)
tree07f13f815259685f43c3f903feffe4a69a74af67 /webkit
parentdfe1486216ccb5942ef52bafa30d361638183eea (diff)
downloadchromium_src-5bc0feb22687326cc26214c100c4658c79ce314f.zip
chromium_src-5bc0feb22687326cc26214c100c4658c79ce314f.tar.gz
chromium_src-5bc0feb22687326cc26214c100c4658c79ce314f.tar.bz2
Include webkit strings in test shell data pack.
This adds <message> node to the types of GRIT nodes that we can stuff into a data package file and removes a test shell hack. Review URL: http://codereview.chromium.org/18478 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@8431 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'webkit')
-rw-r--r--webkit/glue/webkit_strings.grd2
-rw-r--r--webkit/tools/test_shell/SConscript3
-rw-r--r--webkit/tools/test_shell/test_shell_gtk.cc138
3 files changed, 9 insertions, 134 deletions
diff --git a/webkit/glue/webkit_strings.grd b/webkit/glue/webkit_strings.grd
index 1c16d5f..61c2f5c 100644
--- a/webkit/glue/webkit_strings.grd
+++ b/webkit/glue/webkit_strings.grd
@@ -97,6 +97,8 @@ below:
<output filename="webkit_strings_vi.rc" type="rc_all" lang="vi" />
<output filename="webkit_strings_zh-CN.rc" type="rc_all" lang="zh-CN" />
<output filename="webkit_strings_zh-TW.rc" type="rc_all" lang="zh-TW" />
+
+ <output filename="webkit_strings_en-US.pak" type="data_package" lang="en" />
</outputs>
<translations>
<file path="resources/webkit_strings_ar.xtb" lang="ar" />
diff --git a/webkit/tools/test_shell/SConscript b/webkit/tools/test_shell/SConscript
index 45213a9..90291a1 100644
--- a/webkit/tools/test_shell/SConscript
+++ b/webkit/tools/test_shell/SConscript
@@ -211,8 +211,9 @@ if env.Bit('linux'):
test_shell_data = env.Repack(
'$TARGET_ROOT/test_shell.pak',
['$TARGET_ROOT/grit_derived_sources/net_resources.pak',
- '$TARGET_ROOT/grit_derived_sources/webkit_resources.pak',
'$TARGET_ROOT/grit_derived_sources/test_shell_resources.pak',
+ '$TARGET_ROOT/grit_derived_sources/webkit_resources.pak',
+ '$TARGET_ROOT/grit_derived_sources/webkit_strings_en-US.pak',
]
)
env.Depends(test_shell, test_shell_data)
diff --git a/webkit/tools/test_shell/test_shell_gtk.cc b/webkit/tools/test_shell/test_shell_gtk.cc
index f085393..7fe0796 100644
--- a/webkit/tools/test_shell/test_shell_gtk.cc
+++ b/webkit/tools/test_shell/test_shell_gtk.cc
@@ -31,10 +31,8 @@
#include "webkit/tools/test_shell/test_webview_delegate.h"
// Generated by GRIT
-#include "webkit_resources.h"
#include "test_shell_resources.h"
-// TODO(deanm): Needed for the localized string shim.
-#include "webkit_strings.h"
+#include "webkit_resources.h"
namespace {
@@ -678,139 +676,13 @@ StringPiece TestShell::NetResourceProvider(int key) {
namespace webkit_glue {
-// TODO(deanm): This is just a shim for now. We need to extend GRIT to do
-// proper resources on Linux, and figure out exactly how we'll do localization.
-// For now this is just a copy of webkit_strings_en-US.rc in switch form.
std::wstring GetLocalizedString(int message_id) {
- const char* str = NULL;
-
- switch (message_id) {
- case IDS_SEARCHABLE_INDEX_INTRO:
- str = "This is a searchable index. Enter search keywords: ";
- break;
- case IDS_FORM_SUBMIT_LABEL:
- str = "Submit";
- break;
- case IDS_FORM_INPUT_ALT:
- str = "Submit";
- break;
- case IDS_FORM_RESET_LABEL:
- str = "Reset";
- break;
- case IDS_FORM_FILE_BUTTON_LABEL:
- str = "Choose File";
- break;
- case IDS_FORM_FILE_NO_FILE_LABEL:
- str = "No file chosen";
- break;
- case IDS_FORM_FILE_NO_FILE_DRAG_LABEL:
- str = "Drag file here";
- break;
- case IDS_RECENT_SEARCHES_NONE:
- str = "No recent searches";
- break;
- case IDS_RECENT_SEARCHES:
- str = "Recent Searches";
- break;
- case IDS_RECENT_SEARCHES_CLEAR:
- str = "Clear Recent Searches";
- break;
- case IDS_IMAGE_TITLE_FOR_FILENAME:
- str = "%s%d\xc3\x97%d";
- break;
- case IDS_AX_ROLE_WEB_AREA:
- str = "web area";
- break;
- case IDS_AX_ROLE_LINK:
- str = "link";
- break;
- case IDS_AX_ROLE_LIST_MARKER:
- str = "list marker";
- break;
- case IDS_AX_ROLE_IMAGE_MAP:
- str = "image map";
- break;
- case IDS_AX_ROLE_HEADING:
- str = "heading";
- break;
- case IDS_AX_BUTTON_ACTION_VERB:
- str = "press";
- break;
- case IDS_AX_RADIO_BUTTON_ACTION_VERB:
- str = "select";
- break;
- case IDS_AX_TEXT_FIELD_ACTION_VERB:
- str = "activate";
- break;
- case IDS_AX_CHECKED_CHECK_BOX_ACTION_VERB:
- str = "uncheck";
- break;
- case IDS_AX_UNCHECKED_CHECK_BOX_ACTION_VERB:
- str = "check";
- break;
- case IDS_AX_LINK_ACTION_VERB:
- str = "jump";
- break;
- case IDS_KEYGEN_HIGH_GRADE_KEY:
- str = "2048 (High Grade)";
- break;
- case IDS_KEYGEN_MED_GRADE_KEY:
- str = "1024 (Medium Grade)";
- break;
- case IDS_DEFAULT_PLUGIN_GET_PLUGIN_MSG:
- str = "$1 plugin is not installed";
- break;
- case IDS_DEFAULT_PLUGIN_GET_PLUGIN_MSG_NO_PLUGIN_NAME:
- str = "The required plugin is not installed";
- break;
- case IDS_DEFAULT_PLUGIN_GET_PLUGIN_MSG_2:
- str = "Click here to download plugin";
- break;
- case IDS_DEFAULT_PLUGIN_REFRESH_PLUGIN_MSG:
- str = "After installing the plugin, click here to refresh";
- break;
- case IDS_DEFAULT_PLUGIN_NO_PLUGIN_AVAILABLE_MSG:
- str = "No plugin available to display this content";
- break;
- case IDS_DEFAULT_PLUGIN_DOWNLOADING_PLUGIN_MSG:
- str = "Downloading plugin...";
- break;
- case IDS_DEFAULT_PLUGIN_GET_THE_PLUGIN_BTN_MSG:
- str = "Get Plugin";
- break;
- case IDS_DEFAULT_PLUGIN_CANCEL_PLUGIN_DOWNLOAD_MSG:
- str = "Cancel";
- break;
- case IDS_DEFAULT_PLUGIN_CONFIRMATION_DIALOG_TITLE:
- str = "$1 plugin needed";
- break;
- case IDS_DEFAULT_PLUGIN_CONFIRMATION_DIALOG_TITLE_NO_PLUGIN_NAME:
- str = "Additional plugin needed";
- break;
- case IDS_DEFAULT_PLUGIN_USER_OPTION_MSG:
- str = "Please confirm that you would like to install the $1 plugin. You should only install plugins that you trust.";
- break;
- case IDS_DEFAULT_PLUGIN_USER_OPTION_MSG_NO_PLUGIN_NAME:
- str = "Please confirm that you would like to install this plugin. You should only install plugins that you trust.";
- break;
- case IDS_DEFAULT_PLUGIN_USE_OPTION_CONFIRM:
- str = "Install";
- break;
- case IDS_DEFAULT_PLUGIN_USE_OPTION_CANCEL:
- str = "Cancel";
- break;
- case IDS_DEFAULT_PLUGIN_DOWNLOAD_FAILED_MSG:
- str = "Failed to install plugin from $1";
- break;
- case IDS_DEFAULT_PLUGIN_INSTALLATION_FAILED_MSG:
- str = "Plugin installation failed";
- break;
- default:
- NOTIMPLEMENTED();
- str = "No string for this identifier!";
+ StringPiece res;
+ if (!g_resource_data_pack->Get(message_id, &res)) {
+ LOG(FATAL) << "failed to load webkit string with id " << message_id;
}
- return UTF8ToWide(str);
+ return UTF8ToWide(res.as_string());
}
std::string GetDataResource(int resource_id) {