[TIZENIOT-2475] Multilingual handling in Tabs 25/259225/3 submit/tizen/20210602.130122
authorshivamv <shivam.v2@samsung.com>
Wed, 2 Jun 2021 11:57:20 +0000 (17:27 +0530)
committerAmritanshu Pandia <a.pandia1@samsung.com>
Wed, 2 Jun 2021 12:56:17 +0000 (12:56 +0000)
Change-Id: I2a5b081c756cdec9fa85d2c9c4dd2a4b51d91e92
Signed-off-by: shivamv <shivam.v2@samsung.com>
inc/gallery.h [changed mode: 0644->0755]
src/features/gl-main.c
src/gallery.c
src/util/gl-lang.c

old mode 100644 (file)
new mode 100755 (executable)
index 0c809d7..f73fee4
@@ -444,6 +444,7 @@ extern "C" {
                Evas_Object *bg;
                Evas_Object *ctxpopup;
                Evas_Object *entry_win; /* For 3D view */
+               Evas_Object* tabbar;
                int rotate_mode;                /* Type: appcore_rm; Indicate rotation mode of whole application */
                int view_mode;                  /* Type: gl_view_mode; Indicate view mode of whole application */
                bool reentrant;
index 7a416a4d12d5ab0da6dd964159d74d8d1499ada1..5246bf55a7fd03105cb67f5431f77589a2094ada 100755 (executable)
@@ -480,9 +480,9 @@ int _gl_main_create_view(gl_appdata * ad)
                __gl_main_create_naviframe(ad->maininfo.layout);
        GL_CHECK_VAL(ad->maininfo.naviframe, -1);
        /* Set Naviframe to main layout */
-       Evas_Object* tabbar=create_tabbar_with_title(ad->maininfo.layout,ad);
+       ad->maininfo.tabbar=create_tabbar_with_title(ad->maininfo.layout,ad);
        elm_object_part_content_set(ad->maininfo.layout, "elm.swallow.content",ad->maininfo.naviframe);
-       elm_object_part_content_set(ad->maininfo.layout, "tabbar",tabbar);
+       elm_object_part_content_set(ad->maininfo.layout, "tabbar", ad->maininfo.tabbar);
        /* Save conform pointer to naviframe object */
        evas_object_data_set(ad->maininfo.naviframe, GL_NAVIFRAME_OBJ_DATA_KEY,
                                                 conform);
index 69bb3bd529b9f463da8446a022dc434162f56ea4..9842fd4d77df693f4d31055b3ba1579dc64398e5 100755 (executable)
  * See the License for the specific language governing permissions and
  * limitations under the License.
  */
+#include <system_settings.h>
 #include "gl-main.h"
 #include "gl-debug.h"
 #include "gl-lang.h"
 #include "gl-entry.h"
 #include "gl-db-update.h"
 #include "gl-albums.h"
+#include "gl-popup.h"
 
 /* *
  * The basic policy of Tizen applications for OOM case is "silent exit" as
@@ -50,7 +52,26 @@ static void _gallery_lang_changed_cb(app_event_info_h event_info,
                                                                         void *data)
 {
        GL_CHECK(data);
+       gl_dbg("");
        gl_appdata *ad = (gl_appdata *) data;
+       _gl_del_popup(ad);
+
+       char* locale = NULL;
+       int retcode =
+               system_settings_get_value_string
+               (SYSTEM_SETTINGS_KEY_LOCALE_LANGUAGE, &locale);
+       if (retcode != SYSTEM_SETTINGS_ERROR_NONE) {
+               gl_dbgE
+               ("Unable to fetch the current language setting with return value %d",
+                       retcode);
+       }
+       if (locale) {
+               gl_dbg("locale is [%s]", locale);
+               elm_language_set(locale);
+               GL_FREE(locale);
+               locale = NULL;
+       }
+
        evas_object_smart_callback_call(ad->maininfo.naviframe,
                                                                        "gallery,language,changed", data);
        /* Change text in APP */
index f0ca0fd330970436ce8def9e96b98d00d7b4b926..765c1c3c56a2eba4b46565bc2156d6831b167214 100755 (executable)
@@ -47,6 +47,22 @@ static int __gl_lang_update_albums(void *data)
        return 0;
 }
 
+void _gl_update_lang_tabbar(void* data)
+{
+       gl_dbg("");
+       gl_appdata* ad = (gl_appdata*)data;
+       Evas_Object* toolbar = ad->maininfo.tabbar;
+
+       Elm_Object_Item* it = NULL;
+       char* text = GL_STR_PHOTO_TAB;
+       it = elm_toolbar_first_item_get(toolbar);
+       elm_object_item_part_text_set(it,NULL,_gl_str(text));
+       it = elm_toolbar_last_item_get(toolbar);
+       text = GL_STR_ALBUM_TAB;
+       elm_object_item_part_text_set(it,NULL,_gl_str(text));
+       gl_dbg("tabs language changed");
+}
+
 /**
  *
  * @param data
@@ -54,20 +70,7 @@ static int __gl_lang_update_albums(void *data)
  */
 int _gl_lang_update(void *data)
 {
-       char *locale = NULL;
-       int retcode =
-               system_settings_get_value_string
-               (SYSTEM_SETTINGS_KEY_LOCALE_LANGUAGE, &locale);
-
-       if (retcode != SYSTEM_SETTINGS_ERROR_NONE) {
-               gl_dbgW("failed to get language[%d]", retcode);
-       }
-
-       if (locale) {
-               elm_language_set(locale);
-               GL_FREE(locale);
-       }
-       GL_CHECK_VAL(data, -1);
+       gl_dbg("");
        gl_appdata *ad = (gl_appdata *) data;
        ad->maininfo.lang_changed = true;
        int view_mode = gl_get_view_mode(ad);
@@ -75,6 +78,8 @@ int _gl_lang_update(void *data)
        /* Remove ctxpopup */
        _gl_ctxpopup_del(data);
 
+       _gl_update_lang_tabbar(data);
+
        switch (view_mode) {
        case GL_VIEW_ALBUMS:
        case GL_VIEW_ALBUM_REORDER: