Remake old APIs using new APIs
[platform/core/appfw/app-core.git] / src / legacy / appcore-i18n.c
1 /*
2  * Copyright (c) 2000 - 2017 Samsung Electronics Co., Ltd. All rights reserved.
3  *
4  * Licensed under the Apache License, Version 2.0 (the "License");
5  * you may not use this file except in compliance with the License.
6  * You may obtain a copy of the License at
7  *
8  * http://www.apache.org/licenses/LICENSE-2.0
9  *
10  * Unless required by applicable law or agreed to in writing, software
11  * distributed under the License is distributed on an "AS IS" BASIS,
12  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13  * See the License for the specific language governing permissions and
14  * limitations under the License.
15  */
16
17 #include <locale.h>
18 #include <libintl.h>
19 #include <stdlib.h>
20 #include <errno.h>
21 #include <sys/types.h>
22 #include <sys/stat.h>
23 #include <unistd.h>
24 #include <linux/limits.h>
25 #include <glib.h>
26 #include <vconf.h>
27
28 #include "appcore-internal.h"
29 #include "appcore_base.h"
30
31 EXPORT_API int appcore_set_i18n(const char *domainname, const char *dirname)
32 {
33         return appcore_base_set_i18n(domainname, dirname);
34 }
35
36 EXPORT_API int appcore_get_timeformat(enum appcore_time_format *timeformat)
37 {
38         int r;
39
40         if (timeformat == NULL) {
41                 errno = EINVAL;
42                 return -1;
43         }
44
45         r = vconf_get_int(VCONFKEY_REGIONFORMAT_TIME1224, (int *)timeformat);
46
47         if (r < 0) {
48                 *timeformat = APPCORE_TIME_FORMAT_UNKNOWN;
49                 return -1;
50         }
51
52         return 0;
53 }