diff options
Diffstat (limited to 'webkit/tools/test_shell/test_shell_gtk.cc')
-rw-r--r-- | webkit/tools/test_shell/test_shell_gtk.cc | 138 |
1 files changed, 5 insertions, 133 deletions
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) { |