Make buttons in javascript popups locale-aware.
authorBartlomiej Gajda <b.gajda@samsung.com>
Tue, 10 Feb 2015 17:47:36 +0000 (18:47 +0100)
committerYoungsoo Choi <kenshin.choi@samsung.com>
Tue, 10 Jul 2018 06:57:09 +0000 (06:57 +0000)
[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 <b.gajda@samsung.com>
tizen_src/ewk/po_tizen/pl.po
tizen_src/impl/browser/javascript_modal_dialog_efl.cc

index 4e1df6fdbe531c985b32ea30c8a0c3baed5f2197..40394c6372c5b5f903e4833fbe7004618f967358 100644 (file)
@@ -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"
index 7e7c486d6c76ee66b9263eb84785741494d66d28..58a5c691be1decd598cb7f9faf5734fb87e3f338 100644 (file)
@@ -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);
   }