From: Bartlomiej Gajda Date: Tue, 10 Feb 2015 17:47:36 +0000 (+0100) Subject: Make buttons in javascript popups locale-aware. X-Git-Tag: submit/tizen/20190801.160004~1905 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=6b7e9a116d51398843a15864d3c2071359b360a3;p=platform%2Fframework%2Fweb%2Fchromium-efl.git Make buttons in javascript popups locale-aware. [Issue] WCS TC 214 - popups (alert(), confirm()) do not have translated buttons. Bug: http://web.sec.samsung.net/bugzilla/show_bug.cgi?id=6508 Reviewed by: DONGJUN KiM, Piotr Grad Change-Id: Idd43446b9f0f37103c07ac19315386c0d7bcc245 Signed-off-by: Bartlomiej Gajda --- diff --git a/tizen_src/ewk/po_tizen/pl.po b/tizen_src/ewk/po_tizen/pl.po index 4e1df6fdbe53..40394c6372c5 100644 --- a/tizen_src/ewk/po_tizen/pl.po +++ b/tizen_src/ewk/po_tizen/pl.po @@ -92,7 +92,7 @@ msgid "IDS_WEBVIEW_BUTTON_SAVE" msgstr "Zapisz" msgid "IDS_WEBVIEW_BUTTON_STAY" -msgstr "Stay" +msgstr "Zostań" msgid "IDS_WEBVIEW_BUTTON_SUBMIT" msgstr "Wyślij" diff --git a/tizen_src/impl/browser/javascript_modal_dialog_efl.cc b/tizen_src/impl/browser/javascript_modal_dialog_efl.cc index 7e7c486d6c76..58a5c691be1d 100644 --- a/tizen_src/impl/browser/javascript_modal_dialog_efl.cc +++ b/tizen_src/impl/browser/javascript_modal_dialog_efl.cc @@ -101,13 +101,13 @@ bool JavaScriptModalDialogEfl::ShowJavaScriptDialog() { cancel_button_ = elm_button_add(popup_); elm_object_style_set(cancel_button_, "popup"); - elm_object_text_set(cancel_button_, "Cancel"); + elm_object_text_set(cancel_button_, dgettext("sys_string", "IDS_COM_SK_CANCEL")); elm_object_part_content_set(popup_, "button1", cancel_button_); evas_object_smart_callback_add(cancel_button_, "clicked", CancelButtonHandlerForPrompt, this); ok_button_ = elm_button_add(popup_); elm_object_style_set(ok_button_, "popup"); - elm_object_text_set(ok_button_, "OK"); + elm_object_text_set(ok_button_, dgettext("sys_string", "IDS_COM_SK_OK")); elm_object_part_content_set(popup_, "button2", ok_button_); evas_object_focus_set(ok_button_, true); evas_object_smart_callback_add(ok_button_, "clicked", OkButtonHandlerForPrompt, this); @@ -116,23 +116,26 @@ bool JavaScriptModalDialogEfl::ShowJavaScriptDialog() { if (message_text_.c_str()) elm_object_part_text_set(popup_, "title,text", UTF16ToUTF8(message_text_).c_str()); + + std::string question(dgettext("WebKit", "IDS_WEBVIEW_POP_LEAVE_THIS_PAGE_Q")); + std::string message; if (default_prompt_text_.c_str()) - message = std::string(UTF16ToUTF8(default_prompt_text_).c_str()) + std::string("\nLeave this page?"); + message = std::string(UTF16ToUTF8(default_prompt_text_).c_str()) + std::string("\n") + question; else - message = std::string("Leave this page?"); + message = question; setLabelText(message.c_str()); cancel_button_ = elm_button_add(popup_); elm_object_style_set(cancel_button_, "popup"); - elm_object_text_set(cancel_button_, "Leave"); + elm_object_text_set(cancel_button_, dgettext("WebKit", "IDS_WEBVIEW_BUTTON_LEAVE")); elm_object_part_content_set(popup_, "button1", cancel_button_); evas_object_smart_callback_add(cancel_button_, "clicked", OkButtonHandlerForPrompt, this); ok_button_ = elm_button_add(popup_); elm_object_style_set(ok_button_, "popup"); - elm_object_text_set(ok_button_, "Stay"); + elm_object_text_set(ok_button_, dgettext("WebKit", "IDS_WEBVIEW_BUTTON_STAY")); elm_object_part_content_set(popup_, "button2", ok_button_); evas_object_smart_callback_add(ok_button_, "clicked", CancelButtonHandlerForPrompt, this); } else if (type_ == ALERT) { @@ -141,7 +144,7 @@ bool JavaScriptModalDialogEfl::ShowJavaScriptDialog() { ok_button_ = elm_button_add(popup_); elm_object_style_set(ok_button_, "popup"); - elm_object_text_set(ok_button_, "OK"); + elm_object_text_set(ok_button_, dgettext("sys_string", "IDS_COM_SK_OK")); elm_object_part_content_set(popup_, "button1", ok_button_); evas_object_smart_callback_add(ok_button_, "clicked", OkButtonHandlerForAlert, this); @@ -151,13 +154,13 @@ bool JavaScriptModalDialogEfl::ShowJavaScriptDialog() { cancel_button_ = elm_button_add(popup_); elm_object_style_set(cancel_button_, "popup"); - elm_object_text_set(cancel_button_, "Cancel"); + elm_object_text_set(cancel_button_, dgettext("sys_string", "IDS_COM_SK_CANCEL")); elm_object_part_content_set(popup_, "button1", cancel_button_); evas_object_smart_callback_add(cancel_button_, "clicked", CancelButtonHandlerForConfirm, this); ok_button_ = elm_button_add(popup_); elm_object_style_set(ok_button_, "popup"); - elm_object_text_set(ok_button_, "OK"); + elm_object_text_set(ok_button_, dgettext("sys_string", "IDS_COM_SK_OK")); elm_object_part_content_set(popup_, "button2", ok_button_); evas_object_smart_callback_add(ok_button_, "clicked", OkButtonHandlerForConfirm, this); }