X-Git-Url: http://review.tizen.org/git/?a=blobdiff_plain;ds=sidebyside;f=src%2Fwidget_app.c;h=d337d647f6ffd9d00a5ba97798ef63c96ee42d75;hb=refs%2Fchanges%2F58%2F65658%2F1;hp=82f1f8977cf2eb21ae9ea69dc887df8ac5df2815;hpb=bf69959df3783f311c5ae27e05a9b7b1a0b54694;p=platform%2Fcore%2Fappfw%2Fappcore-widget.git diff --git a/src/widget_app.c b/src/widget_app.c index 82f1f89..d337d64 100755 --- a/src/widget_app.c +++ b/src/widget_app.c @@ -326,6 +326,28 @@ static int __aul_handler(aul_type type, bundle *b, void *data) return 0; } +static char *__get_domain_name(char *appid) +{ + char *name_token; + + if (appid == NULL) { + _E("appid is NULL"); + return NULL; + } + + name_token = strrchr(appid, '.'); + + if (name_token == NULL) { + _E("appid is invalid"); + return appid; + } + + name_token++; + + return name_token; +} + +extern int _set_i18n(const char *name); static int __before_loop(int argc, char **argv) { @@ -333,6 +355,7 @@ static int __before_loop(int argc, char **argv) bundle *kb = NULL; char *wayland_display = NULL; char *xdg_runtime_dir = NULL; + char *name; #if !(GLIB_CHECK_VERSION(2, 36, 0)) g_type_init(); @@ -382,6 +405,22 @@ static int __before_loop(int argc, char **argv) if (r != APP_ERROR_NONE) return r; + name = __get_domain_name(appid); + + if (name == NULL) { + return widget_app_error(WIDGET_ERROR_INVALID_PARAMETER, + __FUNCTION__, + "Fail to call __get_domain_name"); + } + + r = _set_i18n(name); + + if (r < 0) { + return widget_app_error(WIDGET_ERROR_INVALID_PARAMETER, + __FUNCTION__, + "Fail to call _set_i18n"); + } + class_provider = app_ops->create(app_user_data); if (class_provider == NULL) { return widget_app_error(WIDGET_ERROR_INVALID_PARAMETER,