Fixed untranslate issue.
authorbunam.jeon <bunam.jeon@samsung.com>
Wed, 23 Oct 2013 10:07:54 +0000 (19:07 +0900)
committerbunam.jeon <bunam.jeon@samsung.com>
Wed, 23 Oct 2013 10:15:37 +0000 (19:15 +0900)
[Title]    Fixed untranslate issue.
[Issue#]   P130905-02813
[Problem]  Text selection popup is untranslate when change the language
[Cause]    Do not set locale when change the language
[Solution] Set information of locale when change the languge

Change-Id: I5b82dd48a9affaa1a5a853a8db5eed25a27ddaee

Source/WebKit2/UIProcess/API/efl/ewk_error.cpp
Source/WebKit2/UIProcess/API/efl/tizen/ewk_popup_picker.cpp
Source/WebKit2/UIProcess/WebProcessProxy.cpp
Source/WebKit2/UIProcess/WebProcessProxy.h
Source/WebKit2/UIProcess/WebProcessProxy.messages.in
Source/WebKit2/WebProcess/WebProcess.cpp
Source/WebKit2/WebProcess/efl/WebProcessEfl.cpp

index 06c9738..681d21d 100755 (executable)
@@ -140,10 +140,6 @@ void ewk_error_load_error_page(Ewk_Error* error, WKPageRef page)
             return;
     }
 
-#if ENABLE(TIZEN_WEBKIT2_TEXT_TRANSLATION)
-    bindtextdomain("WebKit", WEBKIT_TEXT_DIR);
-#endif
-
     // make Error Page Source
     String errorPageFile = WEBKIT_HTML_DIR"/errorPage.html";
     long long fileSize = 0;
index 87c4a89..daa49c3 100644 (file)
@@ -149,7 +149,6 @@ static void createAndShowPopupList(Ewk_Popup_Picker* picker, Evas_Object* parent
     evas_object_show(picker->popupList);
     elm_object_part_content_set(picker->container, "elm.swallow.content", picker->popupList);
 
-    bindtextdomain("WebKit", WEBKIT_TEXT_DIR);
     edje_object_part_text_set(elm_layout_edje_get(picker->container), "elm.text.done", dgettext("WebKit","IDS_WEBVIEW_BUTTON_DONE"));
 }
 
index 2fd7453..d242176 100644 (file)
 #include <wtf/text/CString.h>
 #include <wtf/text/WTFString.h>
 
+#if ENABLE(TIZEN_WEBKIT2_TEXT_TRANSLATION)
+#include <libintl.h>
+#include <locale.h>
+#include <vconf/vconf.h>
+#endif
+
 using namespace WebCore;
 using namespace std;
 
@@ -561,6 +567,14 @@ void WebProcessProxy::removePlatformSurfaceTextureFromPool(int platformSurfaceId
 }
 #endif
 
+#if ENABLE(TIZEN_WEBKIT2_TEXT_TRANSLATION)
+void WebProcessProxy::platformLanguageChanged()
+{
+    setlocale(LC_ALL, vconf_get_str(VCONFKEY_LANGSET));
+    bindtextdomain("WebKit", WEBKIT_TEXT_DIR);
+}
+#endif
+
 #if ENABLE(TIZEN_WEBKIT2_MEMORY_SAVING_MODE)
 void WebProcessProxy::setMemorySavingMode(bool mode)
 {
index b1be628..4b3644d 100644 (file)
@@ -126,6 +126,9 @@ public:
     RefPtr<PlatformSurfaceTexturePool> platformSurfaceTexturePool() { return m_platformSurfaceTexturePool.get(); }
     void removePlatformSurfaceTextureFromPool(int platformSurfaceId);
 #endif
+#if ENABLE(TIZEN_WEBKIT2_TEXT_TRANSLATION)
+    void platformLanguageChanged();
+#endif
 #if ENABLE(TIZEN_WEBKIT2_MEMORY_SAVING_MODE)
     void setMemorySavingMode(bool);
     bool memorySavingModeEnabled() { return m_memorySavingModeEnabled; }
index 3b63839..3638afb 100644 (file)
@@ -39,4 +39,7 @@ messages -> WebProcessProxy {
 #if ENABLE(TIZEN_WEBKIT2_TILED_AC_SHARED_PLATFORM_SURFACE)
     RemovePlatformSurfaceTextureFromPool(int platformSurfaceId)
 #endif
+#if ENABLE(TIZEN_WEBKIT2_TEXT_TRANSLATION)
+    PlatformLanguageChanged()
+#endif
 }
index 72ea5c3..8694cc2 100644 (file)
 #include <WebCore/TizenExtensibleAPI.h>
 #endif
 
+#if ENABLE(TIZEN_WEBKIT2_TEXT_TRANSLATION)
+#include <libintl.h>
+#include <locale.h>
+#include <vconf/vconf.h>
+#endif
+
 using namespace JSC;
 using namespace WebCore;
 
@@ -122,6 +128,16 @@ static void sleep(unsigned seconds)
 }
 #endif
 
+#if ENABLE(TIZEN_WEBKIT2_TEXT_TRANSLATION)
+void platformLanguageChanged(keynode_t* keynode, void* data)
+{
+    setlocale(LC_ALL, vconf_get_str(VCONFKEY_LANGSET));
+    bindtextdomain("WebKit", WEBKIT_TEXT_DIR);
+
+    static_cast<WebProcess*>(data)->connection()->send(Messages::WebProcessProxy::PlatformLanguageChanged(), 0);
+}
+#endif
+
 static void randomCrashThread(void*) NO_RETURN_DUE_TO_CRASH;
 void randomCrashThread(void*)
 {
@@ -248,6 +264,13 @@ void WebProcess::initialize(CoreIPC::Connection::Identifier serverIdentifier, Ru
     WebCore::AsyncImageDecoder::sharedAsyncImageDecoder();
 #endif
 
+#if ENABLE(TIZEN_WEBKIT2_TEXT_TRANSLATION)
+    setlocale(LC_ALL, vconf_get_str(VCONFKEY_LANGSET));
+    bindtextdomain("WebKit", WEBKIT_TEXT_DIR);
+    connection()->send(Messages::WebProcessProxy::PlatformLanguageChanged(), 0);
+    vconf_notify_key_changed(VCONFKEY_LANGSET, platformLanguageChanged, this);
+#endif
+
     startRandomCrashThreadIfRequested();
 }
 
index 243a9a0..0985aed 100755 (executable)
 #include "WebProcessCreationParameters.h"
 #include <WebCore/NotImplemented.h>
 
-#if ENABLE(TIZEN_WEBKIT2_TEXT_TRANSLATION)
-#include <locale.h>
-#include <libintl.h>
-#endif
 #if ENABLE(TIZEN_SOUP_COOKIE_CACHE_FOR_WEBKIT2)
 #include <WebCore/MemoryCache.h>
 #include <WebCore/PageCache.h>
@@ -229,11 +225,6 @@ void WebProcess::platformDumpResourceCaches()
 
 void WebProcess::platformInitializeWebProcess(const WebProcessCreationParameters& parameters, CoreIPC::ArgumentDecoder*)
 {
-#if ENABLE(TIZEN_WEBKIT2_TEXT_TRANSLATION)
-    setlocale(LC_ALL, "");
-    bindtextdomain("WebKit", WEBKIT_TEXT_DIR);
-#endif
-
 #if ENABLE(TIZEN_WEBKIT2_PROXY)
     setProxy(parameters.proxyAddress);
 #endif