summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorsegwon <segwon.han@samsung.com>2016-10-14 20:31:44 +0900
committersegwon <segwon.han@samsung.com>2016-10-17 11:53:46 +0900
commitbd6f9a09f0d34f71093eca5d1da254ab5605bd07 (patch)
treecaacc6708758574844a8718379bcbd726d65cd83
parent5a37487acf61d1c2401b0d8c94972c458b13fe7f (diff)
downloadd2d-conv-setting-bd6f9a09f0d34f71093eca5d1da254ab5605bd07.tar.gz
d2d-conv-setting-bd6f9a09f0d34f71093eca5d1da254ab5605bd07.tar.bz2
d2d-conv-setting-bd6f9a09f0d34f71093eca5d1da254ab5605bd07.zip
Signed-off-by: segwon <segwon.han@samsung.com> Change-Id: I58dd252fcbda8cf7c33ee75674fceac4321cf611
-rw-r--r--inc/language.h4
-rw-r--r--inc/main.h4
-rw-r--r--packaging/d2d-conv-setting.spec3
-rw-r--r--po/CMakeLists.txt7
-rw-r--r--po/en_US.po23
-rw-r--r--po/it_IT.po6
-rw-r--r--po/ko_KR.po5
-rw-r--r--src/ui/setting_home.c25
-rw-r--r--src/ui/setting_item_sign.c13
9 files changed, 56 insertions, 34 deletions
diff --git a/inc/language.h b/inc/language.h
new file mode 100644
index 0000000..1150946
--- /dev/null
+++ b/inc/language.h
@@ -0,0 +1,4 @@
+#include <libintl.h>
+
+#define POWER_ON_SIGN_TEXT dgettext(PACKAGE, "CONV_SETTING_APP_POWER_ON")
+#define POWER_OFF_SIGN_TEXT dgettext(PACKAGE, "CONV_SETTING_APP_POWER_OFF") \ No newline at end of file
diff --git a/inc/main.h b/inc/main.h
index c0b73e4..ee78051 100644
--- a/inc/main.h
+++ b/inc/main.h
@@ -8,6 +8,7 @@
#include <dlog.h>
#include <glib.h>
#include "convergence.h"
+#include "language.h"
#ifdef LOG_TAG
#undef LOG_TAG
@@ -21,7 +22,8 @@ typedef enum state
POWER_OFF = 0,
POWER_ON,
SCAN_START,
- SCAN_STOP
+ SCAN_STOP,
+ CHANGE_LANGUAGE
} state_e;
diff --git a/packaging/d2d-conv-setting.spec b/packaging/d2d-conv-setting.spec
index fc07f77..dd57feb 100644
--- a/packaging/d2d-conv-setting.spec
+++ b/packaging/d2d-conv-setting.spec
@@ -47,9 +47,8 @@ cp %{_builddir}/%{buildsubdir}/LICENSE %{buildroot}/%{_datadir}/license/%{name}
%files
%defattr(-,root,root,-)
%{_pkg_dir}/bin/*
-%{_pkg_dir}/res/*
%{_pkg_dir}/shared/*
-%{_pkg_dir}/res/locale/*/LC_MESSAGES/*
+%{_datadir}/locale/*/LC_MESSAGES/*.mo
%{TZ_SYS_RO_PACKAGES}/%{name}.xml
%{_datadir}/license/%{name}
%manifest %{name}.manifest
diff --git a/po/CMakeLists.txt b/po/CMakeLists.txt
index 6e69f30..a432eee 100644
--- a/po/CMakeLists.txt
+++ b/po/CMakeLists.txt
@@ -1,4 +1,4 @@
-SET(POFILES en_US.po it_IT.po)
+SET(POFILES en_US.po ko_KR.po)
SET(MSGFMT "/usr/bin/msgfmt")
FOREACH(pofile ${POFILES})
@@ -13,9 +13,8 @@ FOREACH(pofile ${POFILES})
DEPENDS ${absPofile}
)
INSTALL(FILES ${moFile}
- DESTINATION ${LOCALEDIR}/${lang}/LC_MESSAGES RENAME ${PACKAGE}.mo)
+ DESTINATION /usr/share/locale/${lang}/LC_MESSAGES RENAME ${PACKAGE}.mo)
SET(moFiles ${moFiles} ${moFile})
ENDFOREACH(pofile)
-ADD_CUSTOM_TARGET(po ALL DEPENDS ${moFiles})
-
+ADD_CUSTOM_TARGET(po ALL DEPENDS ${moFiles}) \ No newline at end of file
diff --git a/po/en_US.po b/po/en_US.po
index bc00f5c..30ee3fe 100644
--- a/po/en_US.po
+++ b/po/en_US.po
@@ -1,20 +1,5 @@
-msgid "IDS_BUTTON_DESCRIPTION"
-msgstr "One finger double tap to activate"
+msgid "CONV_SETTING_APP_POWER_ON"
+msgstr "Now, you can experience a variety of convergence features! Please be aware that a remote device can launch an application on your device or access data in your application. A notice will appear when your device is accessed by remote devices. You can disable this feature by clicking the button again."
-msgid "IDS_BUTTON_NAME"
-msgstr "Button accessiblity name"
-
-msgid "IDS_GENLIST_GROUP_CHECKBOX_TICK_BOX"
-msgstr "Tick box for the entire group"
-
-msgid "IDS_INDEX_FASTSCROLL_DESCRIPTION"
-msgstr "Alphabetical index bar, Swipe right or left with one finger to select next or previous letter"
-
-msgid "Page %d of %d"
-msgstr "Page %d of %d"
-
-msgid "IDS_SLIDER_NAME"
-msgstr "Slider accessiblity name"
-
-msgid "IDS_FAVOURITE_NAME"
-msgstr "Favorite button"
+msgid "CONV_SETTING_APP_POWER_OFF"
+msgstr "You can experience a variety of convergence feature, if you enable TIZEN Convergence - an application on a separate device can be launched remotely, or communicate between applications on separate devices. Please be aware that remote device can launch an application on your device or access data in your application. A notice will appear when your device is accessed by remote devices." \ No newline at end of file
diff --git a/po/it_IT.po b/po/it_IT.po
deleted file mode 100644
index bd54823..0000000
--- a/po/it_IT.po
+++ /dev/null
@@ -1,6 +0,0 @@
-msgid "IDS_BUTTON_DESCRIPTION"
-msgstr "Un dito doppio tap per attivare"
-
-msgid "IDS_BUTTON_NAME"
-msgstr "Button nome di accessibilità"
-
diff --git a/po/ko_KR.po b/po/ko_KR.po
new file mode 100644
index 0000000..96e9465
--- /dev/null
+++ b/po/ko_KR.po
@@ -0,0 +1,5 @@
+msgid "CONV_SETTING_APP_POWER_ON"
+msgstr "다양한 Convergence 기능을 경험할 수 있습니다! 단, 동일한 Wi-Fi 망 내 주변기기에서도 본 기기에 접근이 가능해지므로, 주변기기가 본 기기의 App을 실행하거나 data에 접근할 수도 있습니다. 주변기기 접근 시도 시 팝업창을 통해 이용자의 동의를 받아 본기능이 활성화 됩니다. 본 기능은 본 메뉴의 버튼을 다시 선택하여 끌 수 있습니다."
+
+msgid "CONV_SETTING_APP_POWER_OFF"
+msgstr "TIZEN Convergence 기능을 켜면, 동일한 Wi-Fi 망 내의 주변기기의 App을 실행하거나 App 간 통신이 가능하게 되며, 다양한 Convergence 기능을 경험할 수 있습니다. 단, 동일한 Wi-Fi 망 내 주변기기에서 주변기기가 본 기기의 App을 실행하거나 data에 접근을 요청할 수 있습니다." \ No newline at end of file
diff --git a/src/ui/setting_home.c b/src/ui/setting_home.c
index 9c35e64..9c5c1fb 100644
--- a/src/ui/setting_home.c
+++ b/src/ui/setting_home.c
@@ -23,8 +23,33 @@ static Eina_Bool setting_menu_pop_cb(void *data, Elm_Object_Item *it)
return EINA_FALSE;
}
+static void app_language_changed(app_event_info_h event_info, void *user_data)
+{
+ char *language;
+
+ int ret = app_event_get_language(event_info, &language);
+ if (ret != APP_ERROR_NONE) {
+ dlog_print(DLOG_ERROR, LOG_TAG, "app_event_get_language() failed. Err = %d.", ret);
+ return;
+ }
+
+ dlog_print(DLOG_ERROR, LOG_TAG, "language = %s.", language);
+
+ if (language != NULL) {
+ elm_language_set(language);
+ free(language);
+ }
+
+ dlog_print(DLOG_ERROR, LOG_TAG, "language = %s.", language);
+
+ state_change_event(CHANGE_LANGUAGE);
+}
+
extern void create_setting_menu(Evas_Object *parent)
{
+ app_event_handler_h handle = NULL;
+ ui_app_add_event_handler(&handle, APP_EVENT_LANGUAGE_CHANGED, app_language_changed, NULL);
+
Evas_Object *background = elm_bg_add(parent);
elm_object_content_set(parent, background);
elm_bg_color_set(background, 255, 255, 255);
diff --git a/src/ui/setting_item_sign.c b/src/ui/setting_item_sign.c
index cd07485..3356d85 100644
--- a/src/ui/setting_item_sign.c
+++ b/src/ui/setting_item_sign.c
@@ -8,12 +8,21 @@ static void state_change_event_listener (state_e state)
switch (state)
{
case POWER_ON :
- notice = "Now, you can experience a various Convergence features! Please be aware that a remote device can launch an application in your device or access a data in your application. A notice will be poped up when your device is accessed by the remote devices. You can disable this feature by touch the button again.";
+ notice = POWER_ON_SIGN_TEXT;
elm_genlist_realized_items_update(sign_item);
break;
case POWER_OFF :
- notice = "You can experience a various Convergence features, if you enable Tizen Convergence feature - an application in a different device can be launched remotely, or a communication between applications in different devices is supported. Please be aware that a remote device can launch an application in your device or access a data in your application. A notice will be poped up when your device is accessed by the remote devices.";
+ notice = POWER_OFF_SIGN_TEXT;
+ elm_genlist_realized_items_update(sign_item);
+ break;
+
+ case CHANGE_LANGUAGE :
+ if (get_convergence_power_state() == 1) {
+ notice = POWER_ON_SIGN_TEXT;
+ } else {
+ notice = POWER_OFF_SIGN_TEXT;
+ }
elm_genlist_realized_items_update(sign_item);
break;