summaryrefslogtreecommitdiff
path: root/lib/common/ct-text.c
blob: fcca876dfdf3bfc9f2a7e386eb8eb3d0c014a2f9 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
/*
 * Copyright (c) 2000 - 2012 Samsung Electronics Co., Ltd All Rights Reserved
 *
 * This file is part of ug-contacts-efl
 *
 * Written by Youngjae Shin <yj99.shin@samsung.com>
 *            Donghee Ye <donghee.ye@samsung.com>
 *            Sunggoo Kim <sung.goo.kim@samsung.com>
 *
 * PROPRIETARY/CONFIDENTIAL
 *
 * This software is the confidential and proprietary information of
 * SAMSUNG ELECTRONICS ("Confidential Information"). You shall not
 * disclose such Confidential Information and shall use it only in
 * accordance with the terms of the license agreement you entered
 * into with SAMSUNG ELECTRONICS.
 * SAMSUNG make no representations or warranties about the suitability
 * of the software, either express or implied, including but not limited
 * to the implied warranties of merchantability, fitness for a particular
 * purpose, or non-infringement. SAMSUNG shall not be liable for any
 * damages suffered by licensee as a result of using, modifying or
 * distributing this software or its derivatives.
 *
 */

#include <appcore-efl.h>

#include "contacts.h"
#include "ct-common.h"

static const char *number_type_str[] = {
	N_("IDS_PB_BODY_MOBILE"),/*Mobile*/
	N_("IDS_PB_BODY_TELEPHONE"),/*Telephone*/
	N_("IDS_PB_BODY_FAX"),/*Fax*/
	N_("IDS_PB_BODY_OTHER"),/*Other*/
	N_("IDS_PB_BODY_HOME"),/*Home*/
	N_("IDS_PB_BODY_WORK"),/*Work*/
	N_("IDS_PB_BODY_CAR_TELEPHONE"),/*Car*/
	N_("IDS_PB_BODY_PAGER"),/*Pager*/
	N_("IDS_PB_BODY_ASSISTANT_S_NUMBER"),/*Assistant*/
};

static const char *postal_type_str[] = {
	N_("IDS_PB_BODY_HOME"),/*Home*/
	N_("IDS_PB_BODY_WORK"),/*Work*/
	N_("IDS_PB_BODY_OTHER")/*Other*/
};

static const char *basic_str[] = {
	N_("IDS_PB_BODY_ALL_CONTACTS"),/*All Contacts*/
	N_("IDS_PB_BODY_NOT_ASSIGNED"),/*Not Assigned*/
	N_("IDS_PB_BODY_SERVICE_NUMBER"),/*Service Number*/
	N_("IDS_PB_BODY_PHONE"),/*Phone*/
	N_("IDS_PB_BODY_GROUPS"),/*Groups*/
	N_("IDS_PB_BODY_DEFAULT"),/*Default*/
	N_("IDS_PB_BODY_RINGTONE"),/*Ringtone*/
	N_("IDS_PB_BODY_WEBSITE"),/*Website*/
	N_("IDS_PB_BODY_IM"),/*Instant Messenger*/
	N_("IDS_PB_BODY_EMAIL"),/*Email*/
	N_("IDS_PB_BODY_NUMBER"),/*Number*/
	N_("IDS_PB_BODY_NOTE"),/*Note*/
	N_("IDS_PB_BODY_POSTAL_ADDRESS"),/*Postal Address*/
	N_("IDS_PB_HEADER_DETAILS"),/*Details*/
	N_("IDS_PB_BODY_COMPANY"),/*Company*/
	N_("IDS_PB_BODY_BIRTHDAY"),/*Birthday*/
	N_("IDS_PB_SK1_ADD_TO_HOME_SCREEN"),/*Added to Home*/
	N_("IDS_PB_BODY_ORDER_OF_DISPLAY_NAME"),/* Order display name */
	N_("IDS_PB_BODY_OWN_NUMBER"),/* Own number */
	N_("IDS_PB_BODY_FIRST_NAME"),
	N_("IDS_PB_BODY_LAST_NAME"),
	N_("IDS_PB_BODY_MIDDLE_NAME"),
	N_("IDS_PB_BODY_SUFFIX"),
	N_("IDS_PB_BODY_NICKNAME"),
	N_("IDS_PB_BODY_GROUP_ONLY"),
	N_("IDS_PB_POP_GROUP_AND_GROUP_MEMBERS"),
	N_("IDS_PB_BODY_EXPORT_CONTACTS"),
	N_("IDS_PB_SK_IMPORT_CONTACTS"),
	N_("IDS_PB_HEADER_SELECT_CONTACTS"),
	N_("IDS_PB_BODY_POSTAL_CODE"),
	N_("IDS_PB_BODY_COUNTRY"),
	N_("IDS_PB_BODY_PROVINCE"),
	N_("IDS_PB_BODY_CITY"),
	N_("IDS_PB_BODY_STREET"),
	N_("IDS_KA_BODY_SAVED_IN"),
	N_("IDS_PB_POP_COPIED"),
	N_("IDS_PB_BODY_BACKUP"),
	N_("IDS_PB_POP_DELETING_CONTACTS_ING"),
	N_("IDS_PB_BODY_MOVING_ING"),
	N_("IDS_PB_BODY_COPYING_ING"),
	N_("IDS_PB_POP_IMPORTING_SIM_CONTACTS_ING"),
	N_("IDS_PB_POP_IMPORTING_CONTACTS_FROM_VCARD_ING"),
	N_("IDS_PB_POP_EXPORTING_CONTACTS_TO_PS_ING"),
	N_("IDS_COM_BODY_IMPORTED_ABB"),
	N_("IDS_COM_BODY_NA"),
	N_("IDS_COM_BODY_NO_SIM"),
};

static const char *err_str[] = {
	N_("IDS_PB_BODY_NO_NAME"),
	N_("IDS_PB_POP_INVALID_EMAIL_ADDRESS"),
	N_("IDS_PB_POP_COMPLETE_AT_LEAST_ONE_FIELD_AS_WELL_AS_NAME"),
	N_("IDS_IM_BODY_FAILED_TO_ACCESS_DATABASE"),
	N_("IDS_PB_POP_ALREADY_ADDED"),
	N_("IDS_PB_POP_GROUP_ALREADY_IN_USE"),
	N_("IDS_PB_BODY_NO_GROUP"),
	N_("IDS_PB_POP_NO_NUMBER"),
	N_("IDS_PB_POP_NO_EMAIL_ADDRESSES"),
	N_("IDS_PB_BODY_NO_CONTACTS"),
	N_("IDS_PB_POP_SIM_MEMORY_EMPTY"),
	N_("IDS_PB_POP_MAXIMUM_NUMBER_OF_ENTRIES_EXCEEDED"),
	N_("IDS_PB_POP_INITIALISING_TRY_LATER_ING"),
	N_("IDS_SEARCH_BODY_DATA_DOES_NOT_EXIST"),
	N_("IDS_PB_BODY_INVALID_NUMBER"),
};

static const char *base_op_str[] = {
	N_("IDS_PB_BODY_MARK_AS_DEFAULT_NUMBER"),/*Set Default Number*/
	N_("IDS_PB_BODY_IMAGE"),/*Image*/
	N_("IDS_PB_BODY_TAKE_A_PHOTO"),/*Take a photo*/
	N_("IDS_PB_OPT_REMOVE_PHOTO_ABB"),/*Delete photo*/
	N_("IDS_PB_SK1_ADD_TO_HOME_SCREEN"),/*Add to Home*/
	N_("IDS_PB_BODY_SAVE_CONTACT_TO"),/*Save contact to*/
	N_("IDS_PB_BODY_IMPORT_SIM_CONTACTS"), /* Import SIM contacts */
	N_("IDS_PB_BODY_FIRST_NAME_LAST_NAME"),/* order display - First, Last */
	N_("IDS_PB_BODY_LAST_NAME_FIRST_NAME"),/* order display - Last, First */
	N_("IDS_PB_HEADER_SEND_NAMECARD"),
	N_("IDS_PB_POP_THIS_CONTACT_WILL_BE_DELETED"),
	N_("IDS_PB_OPT_NEW_GROUP"),
	N_("IDS_PB_HEADER_SELECT_GROUP"),
	N_("IDS_PB_BODY_EXPORT_CONTACTS"),
	N_("IDS_PB_BODY_IMPORT_FROM_SD_CARD"),
};

static const char *event_type_str[] = {
	N_("IDS_PB_BODY_BIRTHDAY"),/*CTS_EVENT_TYPE_BIRTH*/
	N_("IDS_PB_BODY_ANNIVERSARY")/*CTS_EVENT_TYPE_ANNIVERSARY*/
};

static const char *im_type_str[] = {
	N_("IDS_PB_HEADER_UNKNOWN"),/*CTS_IM_TYPE_NONE*/
	N_("IDS_PB_BODY_GOOGLE"),/*CTS_IM_TYPE_GOOGLE*/
	N_("IDS_PB_BODY_MSN"),/*CTS_IM_TYPE_WLM*/
	N_("IDS_PB_BODY_YAHOO"),/*CTS_IM_TYPE_YAHOO*/
	N_("IDS_PB_BODY_FACEBOOK"),/*CTS_IM_TYPE_FACEBOOK*/
	N_("IDS_PB_BODY_IMPSCOMMUNITY_ICQ"),/*CTS_IM_TYPE_ICQ*/
	N_("IDS_PB_BODY_IMPSCOMMUNITY_AIM"),/*CTS_IM_TYPE_AIM*/
	N_("IDS_PB_OPT_QQ")/*CTS_IM_TYPE_QQ*/
};

static const char* acc_type_str[] = {
	N_("IDS_PB_BODY_PHONE"),/*CTS_ADDRESSBOOK_TYPE_INTERNAL*/
	N_("IDS_PB_BODY_EXCHANGE"),/*CTS_ADDRESSBOOK_TYPE_EXCHANGE*/
	N_("IDS_PB_BODY_GOOGLE"),/*CTS_ADDRESSBOOK_TYPE_GOOGLE*/
	N_("IDS_PB_BODY_YAHOO"),/*CTS_ADDRESSBOOK_TYPE_YAHOO*/
	N_("IDS_PB_BODY_FACEBOOK"),/*CTS_ADDRESSBOOK_TYPE_GOOGLE*/
	N_("IDS_PB_HEADER_UNKNOWN"),/*CTS_ADDRESSBOOK_TYPE_OTHER*/
};

static const char *month_str[] = {
	"IDS_COM_BODY_NONE",
	"IDS_COM_BODY_JAN",
	"IDS_COM_BODY_FEB",
	"IDS_COM_BODY_MAR",
	"IDS_COM_BODY_APR",
	"IDS_COM_BODY_MAY",
	"IDS_COM_BODY_JUN",
	"IDS_COM_BODY_JUL",
	"IDS_COM_BODY_AUG",
	"IDS_COM_BODY_SEP",
	"IDS_COM_BODY_OCT",
	"IDS_COM_BODY_NOV",
	"IDS_COM_BODY_DEC"
};

const char* ctui_get_text(int op, int type)
{
	const char **table;

	switch (op) {
	case CT_GET_TEXT_BASIC:
		table = basic_str;
		break;
	case CT_GET_TEXT_ERR:
		table = err_str;
		break;
	case CT_GET_TEXT_BASE_OP:
		table = base_op_str;
		break;
	case CT_GET_TEXT_NUM_TYPE:
		table = number_type_str;
		break;
	case CT_GET_TEXT_POSTAL_TYPE:
	case CT_GET_TEXT_EMAIL_TYPE:
		table = postal_type_str;
		type--;
		if (-1 == type) type = 2;
		break;
	case CT_GET_TEXT_EVENT_TYPE:
		table = event_type_str;
		break;
	case CT_GET_TEXT_IM_TYPE:
		table = im_type_str;
		break;
	case CT_GET_TEXT_MONTH:
		if (sizeof(month_str) / sizeof(month_str[0]) <= type)
			return NULL;
		else
			return dgettext("sys_string", month_str[type]);
	case CT_GET_TEXT_ACC_TYPE:
		if (5 < type) type = 5;
		table = acc_type_str;
		break;
	default:
		return NULL;
	}

	return dgettext(PACKAGE, table[type]);
}

static const char *sys_str[] = {
	"IDS_COM_SK_OK",
	"IDS_COM_SK_SAVE",
	"IDS_COM_SK_EDIT",
	"IDS_COM_SK_DONE",
	"IDS_COM_SK_DELETE",
	"IDS_COM_SK_CANCEL",
	"IDS_COM_BODY_CREATE",
	"IDS_COM_BODY_MOVE",
	"IDS_COM_BODY_COPY",
	"IDS_COM_BODY_CALL",
	"IDS_COM_BODY_MESSAGE",
	"IDS_COM_BODY_VIDEO_CALL",
	"IDS_COM_BODY_UNKNOWN",
	"IDS_COM_BODY_PHONE",
	"IDS_COM_BODY_SELECT_ALL",
	"IDS_COM_BODY_SEARCH",
	"IDS_COM_BODY_BLUETOOTH",
	"IDS_COM_BODY_EMAIL",
	"IDS_COM_BODY_CONTACTS",
	"IDS_COM_POP_SELECTED",
	"IDS_COM_POP_SUCCESS",
	"IDS_COM_POP_FAILED",
	"IDS_COM_POP_CLOSE",
	"IDS_COM_POP_ERROR",
	"IDS_COM_POP_DELETED",
	"IDS_COM_POP_REMOVED",
	"IDS_COM_POP_MOVED",
	"IDS_COM_POP_ADDED",
	"IDS_COM_POP_NOT_ENOUGH_MEMORY",
	"IDS_COM_POP_FILE_NOT_FOUND",
};

inline const char* ctui_get_system_string(int type)
{
	return dgettext("sys_string", sys_str[type]);
}