Explicite bind textdomain to avoid having splitting translation files.
Change-Id: I870d7573cebc6c600ab324feaddade7381b97fb2
#define _CLOCK_COMMON_DEFINES_H_
#define PACKAGE_CLOCK "org.tizen.clock"
-#define PACKAGE_RING "org.tizen.clock-ring"
+#define PACKAGE_RING "org.tizen.clock.ring"
+#define TEXT_DOMAIN "clock"
#define APP_CONTROL_OPERATION_TIMEOUT "http://tizen.org/appcontrol/operation/timeout"
#define APP_CONTROL_OPERATION_ALARM "http://tizen.org/appcontrol/operation/alarm"
#define RINGTONE_APP_PACKAGE_ID "org.tizen.setting-ringtone"
virtual bool OnCreate() { return false; };
/**
+ * @brief binds and use text domain
+ *
+ * @param[in] domain Text domain main
+ * @param[in] path locale path
+ */
+ void UseTextDomain(const char *domain, const char *locale_path);
+
+ /**
* @brief Run Tizen application main loop
*/
int Run(int argc, char **argv);
+#include <libintl.h>
#include "Utils/TizenApp.h"
#include "Utils/Log.h"
app->OnLanguageChanged(event_info);
}
+void TizenApp::UseTextDomain(const char *domain, const char *path)
+{
+ bindtextdomain(domain, path);
+ textdomain(domain);
+}
+
int TizenApp::Run(int argc, char **argv)
{
int ret = 0;
#include "app.h"
#include "Ring.h"
#include "Utils/TizenApp.h"
+#include "Utils/TizenAppUtils.h"
#include "Utils/SystemSettings.h"
bool RingApp::OnCreate()
provider_ = new common::AlarmProvider();
ring_ctrl_ = new controller::RingController(provider_->GetAlarms());
+ UseTextDomain(TEXT_DOMAIN, utils::TizenAppUtils::GetResourcePath(utils::TizenAppUtils::APP_DIR_RESOURCE, "locale"));
+
return true;
}
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
-<manifest xmlns="http://tizen.org/ns/packages" api-version="4.0" package="org.tizen.clock-ring" version="1.0.0">
+<manifest xmlns="http://tizen.org/ns/packages" api-version="4.0" package="org.tizen.clock" version="1.0.0">
<profile name="mobile"/>
- <ui-application appid="org.tizen.clock-ring" exec="clock-ring" hw-acceleration="on" launch_mode="single" multiple="false" nodisplay="true" taskmanage="false" type="capp">
+ <ui-application appid="org.tizen.clock.ring" exec="clock-ring" hw-acceleration="on" launch_mode="single" multiple="false" nodisplay="true" taskmanage="false" type="capp">
<label>clock-ring</label>
<icon>clock-ring.png</icon>
</ui-application>
#include "Clock.h"
#include "Utils/TizenApp.h"
#include "Utils/SystemSettings.h"
+#include "Utils/TizenAppUtils.h"
+#include "Common/Defines.h"
bool ClockApp::OnCreate()
{
provider_ = new common::AlarmProvider();
main_ctrl_ = new controller::MainController(provider_);
+ UseTextDomain(TEXT_DOMAIN, utils::TizenAppUtils::GetResourcePath(utils::TizenAppUtils::APP_DIR_RESOURCE, "locale"));
+
return true;
}