Tizen release 1.0
[pkgs/p/phone-lock.git] / phone-lock-common / src / phone-lock-string.c
1 /*
2  * Copyright (c) 2000 - 2012 Samsung Electronics Co., Ltd All Rights Reserved 
3  *
4  * This file is part of <phone-lock>
5  * Written by <Seungtaek Chung> <seungtaek.chung@samsung.com>, <Mi-Ju Lee> <miju52.lee@samsung.com>, <Xi Zhichan> <zhichan.xi@samsung.com>
6  *
7  * PROPRIETARY/CONFIDENTIAL
8  *
9  * This software is the confidential and proprietary information of SAMSUNG ELECTRONICS ("Confidential Information").
10  * You shall not disclose such Confidential Information and shall use it only in accordance
11  * with the terms of the license agreement you entered into with SAMSUNG ELECTRONICS.
12  * SAMSUNG make no representations or warranties about the suitability of the software,
13  * either express or implied, including but not limited to the implied warranties of merchantability,
14  * fitness for a particular purpose, or non-infringement.
15  * SAMSUNG shall not be liable for any damages suffered by licensee as a result of using,
16  * modifying or distributing this software or its derivatives.
17  *
18  */
19
20 #include <stdio.h>
21 #include <libintl.h>
22
23 #include "phone-lock-util.h"
24 #include "phone-lock-string.h"
25
26 const char *sys_str_table[] = {
27         "IDS_COM_BODY_ENTER_PASSWORD",
28         "IDS_COM_SK_OK",
29 };
30
31 const char *app_str_table[] = {
32         "IDS_IDLE_BODY_PD_ATTEMPTS_LEFT",       /* msgstr "%d attempts left"  */
33         "IDS_IDLE_BODY_WRONG_PASSWORD",
34         "IDS_IDLE_BODY_PASSWORD_EMPTY",
35         "IDS_IDLE_BODY_EMERGENCY_CALL",
36         "%d to %d digits or letters required",  /* TODO: change to IDS_IDLE_BODY_PD_TO_PD_DIGITS_OR_LETTERS_REQUIRED */
37         "%d s left,please try later!",  /* TODO:IDS_IDLE_BODY_TRY_LATER *//* new request */
38         "Please input password again after 30 seconds.",        /* new request */
39 };
40
41 EXPORT_API char *phone_lock_get_string(int id)
42 {
43         PHONE_LOCK_DBG("get string id : %d\n", id);
44
45         char *str = NULL;
46
47         if (id < IDS_PHONE_LOCK_SYSTEM_STRING_MAX) {
48                 str = dgettext("sys_string", sys_str_table[id]);
49         } else {
50                 str =
51                     dgettext("phone-lock",
52                              app_str_table[id -
53                                            IDS_PHONE_LOCK_SYSTEM_STRING_MAX]);
54         }
55
56         PHONE_LOCK_DBG("get string : %s\n", str);
57
58         return str;
59 }
60