Merge "Fix the prevent issue" into tizen_2.1
[platform/framework/native/appfw.git] / src / locales / FLcl_LocaleManagerImpl.cpp
1 //
2 // Open Service Platform
3 // Copyright (c) 2012 Samsung Electronics Co., Ltd.
4 //
5 // Licensed under the Apache License, Version 2.0 (the License);
6 // you may not use this file except in compliance with the License.
7 // You may obtain a copy of the License at
8 //
9 // http://www.apache.org/licenses/LICENSE-2.0
10 //
11 // Unless required by applicable law or agreed to in writing, software
12 // distributed under the License is distributed on an "AS IS" BASIS,
13 // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14 // See the License for the specific language governing permissions and
15 // limitations under the License.
16 //
17
18 /**
19 * @file         FLcl_LocaleManagerImpl.cpp
20 * @brief        This is the implementation file for _LocaleManagerImpl class.
21 */
22 #include <unique_ptr.h>
23 #include <limits.h>
24 #include <runtime_info.h>
25 #include <unicode/calendar.h>
26 #include <unicode/timezone.h>
27 #include <libxml/parser.h>
28 #include <libxml/tree.h>
29
30 #include <FIo.h>
31 #include <FBaseSysLog.h>
32 #include <FBase_StringConverter.h>
33
34 #include "FLcl_LocaleImpl.h"
35 #include "FLcl_TimeZoneImpl.h"
36 #include "FLcl_LocaleManagerImpl.h"
37
38
39 using namespace Tizen::Base;
40 using namespace Tizen::Base::Utility;
41 using namespace Tizen::Base::Collection;
42 using namespace Tizen::Io;
43
44 namespace Tizen { namespace Locales
45 {
46 static const char* LANGUAGE_LIST_FILE_PATH ="/opt/data/setting/langlist.xml";
47 static const char* TIMEZONE_LIST_FILE_PATH = "/opt/data/setting/tzlist.ini";
48 static const int TIMEZONE_MAX = 224;
49 static const char* TimeZoneList[TIMEZONE_MAX] =
50 {
51         "Africa/Abidjan",
52         "Africa/Accra",
53         "Africa/Addis_Ababa",
54         "Africa/Algiers",
55         "Africa/Asmara",
56         "Africa/Bamako",
57         "Africa/Bangui",
58         "Africa/Bissau",
59         "Africa/Cairo",
60         "Africa/Casablanca",
61         "Africa/Conakry",
62         "Africa/Dakar",
63         "Africa/Dar_es_Salaam",
64         "Africa/Djibouti",
65         "Africa/Douala",
66         "Africa/Freetown",
67         "Africa/Gaborone",
68         "Africa/Harare",
69         "Africa/Johannesburg",
70         "Africa/Kampala",
71         "Africa/Khartoum",
72         "Africa/Kinshasa",
73         "Africa/Lagos",
74         "Africa/Luanda",
75         "Africa/Lubumbashi",
76         "Africa/Lusaka",
77         "Africa/Malabo",
78         "Africa/Maputo",
79         "Africa/Mogadishu",
80         "Africa/Monrovia",
81         "Africa/Nairobi",
82         "Africa/Ndjamena",
83         "Africa/Niamey",
84         "Africa/Nouakchott",
85         "Africa/Ouagadougou",
86         "Africa/Tripoli",
87         "Africa/Tunis",
88         "America/Anchorage",
89         "America/Antigua",
90         "America/Argentina/Buenos_Aires",
91         "America/Asuncion",
92         "America/Barbados",
93         "America/Belize",
94         "America/Bogota",
95         "America/Caracas",
96         "America/Cayenne",
97         "America/Chicago",
98         "America/Costa_Rica",
99         "America/Denver",
100         "America/Detroit",
101         "America/El_Salvador",
102         "America/Godthab",
103         "America/Guadeloupe",
104         "America/Guatemala",
105         "America/Guayaquil",
106         "America/Guyana",
107         "America/Halifax",
108         "America/Havana",
109         "America/Indiana/Indianapolis",
110         "America/Jamaica",
111         "America/Kentucky/Louisville",
112         "America/La_Paz",
113         "America/Lima",
114         "America/Los_Angeles",
115         "America/Managua",
116         "America/Marigot",
117         "America/Martinique",
118         "America/Mazatlan",
119         "America/Mexico_City",
120         "America/Montevideo",
121         "America/Montreal",
122         "America/New_York",
123         "America/Nome",
124         "America/Panama",
125         "America/Paramaribo",
126         "America/Phoenix",
127         "America/Port-au-Prince",
128         "America/Puerto_Rico",
129         "America/Recife",
130         "America/Regina",
131         "America/Santiago",
132         "America/Santo_Domingo",
133         "America/Sao_Paulo",
134         "America/St_Johns",
135         "America/St_Thomas",
136         "America/Tegucigalpa",
137         "America/Tijuana",
138         "America/Toronto",
139         "America/Tortola",
140         "America/Vancouver",
141         "America/Winnipeg",
142         "Asia/Aden",
143         "Asia/Almaty",
144         "Asia/Amman",
145         "Asia/Anadyr",
146         "Asia/Ashgabat",
147         "Asia/Baghdad",
148         "Asia/Bahrain",
149         "Asia/Baku",
150         "Asia/Bangkok",
151         "Asia/Beirut",
152         "Asia/Bishkek",
153         "Asia/Colombo",
154         "Asia/Damascus",
155         "Asia/Dhaka",
156         "Asia/Dubai",
157         "Asia/Dushanbe",
158         "Asia/Ho_Chi_Minh",
159         "Asia/Hong_Kong",
160         "Asia/Hovd",
161         "Asia/Irkutsk",
162         "Asia/Istanbul",
163         "Asia/Jakarta",
164         "Asia/Jayapura",
165         "Asia/Jerusalem",
166         "Asia/Kabul",
167         "Asia/Kamchatka",
168         "Asia/Karachi",
169         "Asia/Kathmandu",
170         "Asia/Kolkata",
171         "Asia/Krasnoyarsk",
172         "Asia/Kuala_Lumpur",
173         "Asia/Kuwait",
174         "Asia/Macau",
175         "Asia/Magadan",
176         "Asia/Makassar",
177         "Asia/Manila",
178         "Asia/Muscat",
179         "Asia/Novokuznetsk",
180         "Asia/Novosibirsk",
181         "Asia/Omsk",
182         "Asia/Phnom_Penh",
183         "Asia/Pyongyang",
184         "Asia/Qatar",
185         "Asia/Rangoon",
186         "Asia/Riyadh",
187         "Asia/Sakhalin",
188         "Asia/Seoul",
189         "Asia/Shanghai",
190         "Asia/Singapore",
191         "Asia/Taipei",
192         "Asia/Tashkent",
193         "Asia/Tbilisi",
194         "Asia/Tehran",
195         "Asia/Tokyo",
196         "Asia/Ulan_Bator",
197         "Asia/Vladivostok",
198         "Asia/Yakutsk",
199         "Asia/Yekaterinburg",
200         "Asia/Yerevan",
201         "Atlantic/Azores",
202         "Atlantic/Canary",
203         "Atlantic/Reykjavik",
204         "Atlantic/South_Georgia",
205         "Australia/Adelaide",
206         "Australia/Brisbane",
207         "Australia/Canberra",
208         "Australia/Darwin",
209         "Australia/Hobart",
210         "Australia/Melbourne",
211         "Australia/Perth",
212         "Australia/Sydney",
213         "CST6CDT",
214         "EST5EDT",
215         "Europe/Amsterdam",
216         "Europe/Athens",
217         "Europe/Belgrade",
218         "Europe/Berlin",
219         "Europe/Bratislava",
220         "Europe/Brussels",
221         "Europe/Bucharest",
222         "Europe/Budapest",
223         "Europe/Chisinau",
224         "Europe/Copenhagen",
225         "Europe/Dublin",
226         "Europe/Helsinki",
227         "Europe/Istanbul",
228         "Europe/Kaliningrad",
229         "Europe/Kiev",
230         "Europe/Lisbon",
231         "Europe/Ljubljana",
232         "Europe/London",
233         "Europe/Luxembourg",
234         "Europe/Madrid",
235         "Europe/Malta",
236         "Europe/Minsk",
237         "Europe/Moscow",
238         "Europe/Paris",
239         "Europe/Podgorica",
240         "Europe/Prague",
241         "Europe/Riga",
242         "Europe/Rome",
243         "Europe/Samara",
244         "Europe/San_Marino",
245         "Europe/Skopje",
246         "Europe/Sofia",
247         "Europe/Stockholm",
248         "Europe/Tallinn",
249         "Europe/Vaduz",
250         "Europe/Vienna",
251         "Europe/Vilnius",
252         "Europe/Volgograd",
253         "Europe/Warsaw",
254         "Europe/Zagreb",
255         "Europe/Zurich",
256         "Indian/Antananarivo",
257         "Indian/Chagos",
258         "Indian/Maldives",
259         "Indian/Mauritius",
260         "Indian/Reunion",
261         "MST7MDT",
262         "Pacific/Auckland",
263         "Pacific/Easter",
264         "Pacific/Fiji",
265         "Pacific/Galapagos",
266         "Pacific/Guam",
267         "Pacific/Honolulu",
268         "Pacific/Midway",
269         "Pacific/Noumea",
270         "Pacific/Pago_Pago",
271         "Pacific/Tahiti",
272         "Pacific/Tarawa",
273         "Pacific/Tongatapu",
274         "PST8PDT"
275 };
276
277 Locale
278 _LocaleManagerImpl::GetSystemLocale(void)
279 {
280         char* pRegionPtr;
281         if (runtime_info_get_value_string(RUNTIME_INFO_KEY_REGION, &pRegionPtr) == RUNTIME_INFO_ERROR_NONE)
282         {
283                 SetLastResult(E_SUCCESS);
284
285                 Locale ospLoc = _LocaleImpl(pRegionPtr).GetOspLocale();
286                 free(pRegionPtr);
287                 return ospLoc;
288         }
289
290         SetLastResult(E_SYSTEM);
291         return Locale(LANGUAGE_INVALID, COUNTRY_INVALID, null);
292 }
293
294 IList*
295 _LocaleManagerImpl::GetAvailableLocalesN(void)
296 {
297         result r = E_SUCCESS;
298         int count = 0;
299         const U_ICU_NAMESPACE::Locale* pIcuLocaleList = U_ICU_NAMESPACE::Locale::getAvailableLocales(count);
300         SysTryReturn(NID_LCL, count > 0, null, E_SYSTEM,
301                                 "[%s] The method cannot proceed due to a severe system error.", GetErrorMessage(E_SYSTEM));
302
303         std::unique_ptr<LinkedList, AllElementsDeleter> pAvailableLocaleList(new (std::nothrow) LinkedList());
304         SysTryReturn(NID_LCL, pAvailableLocaleList, null, E_OUT_OF_MEMORY,
305                                 "[%s] Memory allocation failed", GetErrorMessage(E_OUT_OF_MEMORY));
306
307         for (int i = 0; i < count; i++)
308         {
309                 SysTryReturn(NID_LCL, (pIcuLocaleList + i) != null, null, E_SYSTEM,
310                                         "[%s] The method cannot proceed due to a severe system error.",GetErrorMessage(E_SYSTEM));
311
312                 Locale ospLocale = _LocaleImpl(*(pIcuLocaleList + i)).GetOspLocale();
313                 if (_LocaleImpl::IsSupported(ospLocale))
314                 {
315                         Locale* pLocale = new (std::nothrow) Locale(ospLocale);
316                         SysTryReturn(NID_LCL, pLocale, null, E_OUT_OF_MEMORY,
317                                                 "[%s] Memory allocation failed", GetErrorMessage(E_OUT_OF_MEMORY));
318                         if (!pAvailableLocaleList->Contains(*pLocale))
319                         {
320                                 r = pAvailableLocaleList->Add(*pLocale);
321                                 if (IsFailed(r))
322                                 {
323                                         delete pLocale;
324                                         SetLastResult(E_SYSTEM);
325                                         return null;
326                                 }
327                         }
328                 }
329         }
330
331         SetLastResult(E_SUCCESS);
332         return pAvailableLocaleList.release();
333 }
334
335 String
336 _LocaleManagerImpl::GetSelectedLanguage(void)
337 {
338         char* pLanguagePtr;
339
340         int ret = runtime_info_get_value_string(RUNTIME_INFO_KEY_LANGUAGE, &pLanguagePtr);
341         SysTryReturn(NID_LCL, ret == RUNTIME_INFO_ERROR_NONE, String(), E_SYSTEM,
342                         "[%s] The method cannot proceed due to a severe system error.", GetErrorMessage(E_SYSTEM));
343         String language(_LocaleImpl(pLanguagePtr).GetLanguageCodeString(false));
344         free(pLanguagePtr);
345
346         return language;
347 }
348
349 IList*
350 _LocaleManagerImpl::GetAvailableLanguagesN(void)
351 {
352         xmlDocPtr doc = null;
353         xmlNodePtr cur = null;
354
355         std::unique_ptr<ArrayList, AllElementsDeleter> pAvailableLanguageList(new (std::nothrow) ArrayList());
356         SysTryCatch(NID_LCL, pAvailableLanguageList, null, E_OUT_OF_MEMORY,"[%s] Memory allocation failed", GetErrorMessage(E_OUT_OF_MEMORY));
357
358         doc = xmlParseFile(LANGUAGE_LIST_FILE_PATH);
359         SysTryCatch(NID_LCL, doc != null, , E_FILE_NOT_FOUND, "[E_FILE_NOT_FOUND] It is failed to get the langlist from the resource.");
360
361         cur = xmlDocGetRootElement(doc);
362         SysTryCatch(NID_LCL, cur != null, , E_EMPTY_BODY, "[E_EMPTY_BODY] It is empty document.");
363         SysTryCatch(NID_LCL, xmlStrcmp(cur->name, (const xmlChar *) "langlist") == 0, , E_INVALID_CONTENT, "[E_INVALID_CONTENT] The document is wrong type");
364
365         cur = cur->xmlChildrenNode;
366
367         pAvailableLanguageList->Construct();
368
369         for (xmlNodePtr cur_node = cur; cur_node; cur_node = cur_node->next)
370         {
371                 if (cur_node->type == XML_ELEMENT_NODE)
372                 {
373                         char* pLocId = (char*)xmlGetProp(cur_node, (const xmlChar *)"id");
374                         Locale loc = _LocaleImpl(pLocId).GetOspLocale();
375                         std::unique_ptr<String> pLanguageLocaleID(new (std::nothrow) String(loc.GetLanguageCodeString()));
376                         SysTryCatch(NID_LCL, pLanguageLocaleID, null, E_OUT_OF_MEMORY,"[%s] Memory allocation failed",GetErrorMessage(E_OUT_OF_MEMORY));
377
378                         result r = pAvailableLanguageList->Add(pLanguageLocaleID.get());
379                         SysTryCatch(NID_LCL, r == E_SUCCESS, null, E_SYSTEM,
380                                         "[%s] It is failed to add a locale string [%ls].", GetErrorMessage(E_SYSTEM), pLanguageLocaleID->GetPointer());
381                         pLanguageLocaleID.release();
382                 }
383         }
384
385         SetLastResult(E_SUCCESS);
386
387         if (doc)
388         {
389                 xmlFreeDoc(doc);
390         }
391
392         return pAvailableLanguageList.release();
393
394 CATCH:
395         if (doc)
396         {
397                 xmlFreeDoc(doc);
398         }
399         SysLog(NID_LCL, "It is calling fallback api.");
400         return GetAvailableLanguagesFallbackN();
401 }
402
403
404 IList*
405 _LocaleManagerImpl::GetAvailableLanguagesFallbackN(void)
406 {
407         std::unique_ptr<IList, AllElementsDeleter> pLocaleList (GetAvailableLocalesN());
408         std::unique_ptr<HashMap> pLanguageMap(new (std::nothrow) HashMap());
409
410         SysTryReturn(NID_LCL, pLanguageMap, null, E_OUT_OF_MEMORY,"[%s] Memory allocation failed", GetErrorMessage(E_OUT_OF_MEMORY));
411
412         pLanguageMap->Construct();
413
414         for (int i = 0; i < pLocaleList->GetCount() ; i++)
415         {
416                 Locale* pLocale = (Locale*)pLocaleList->GetAt(i);
417                 std::unique_ptr<String> pLanguageCode(new (std::nothrow) String(pLocale->GetLanguageCodeString()));
418                 SysTryReturn(NID_LCL, pLanguageCode, null, E_OUT_OF_MEMORY,"[%s] Memory allocation failed", GetErrorMessage(E_OUT_OF_MEMORY));
419
420                 if (!pLanguageMap->ContainsKey(*pLanguageCode))
421                 {
422                         std::unique_ptr<String> pDummyValue(new (std::nothrow) String());
423                         SysTryReturn(NID_LCL, pDummyValue, null, E_OUT_OF_MEMORY,"[%s] Memory allocation failed", GetErrorMessage(E_OUT_OF_MEMORY));
424
425                         result r = pLanguageMap->Add(*(pLanguageCode.get()), *(pDummyValue.get()));
426
427                         if (IsFailed(r))
428                         {
429                                 SetLastResult(E_SYSTEM);
430                                 return null;
431                         }
432                         pLanguageCode.release();
433                         pDummyValue.release();
434                 }
435         }
436
437         IList* pAvailableLanguageList;
438         pAvailableLanguageList = pLanguageMap->GetKeysN();
439         SetLastResult(E_SUCCESS);
440         pLanguageMap->RemoveAll();
441         return pAvailableLanguageList;
442 }
443
444
445 IMap*
446 _LocaleManagerImpl::GetAvailableTimeZonesN(U_ICU_NAMESPACE::StringEnumeration* pIcuTZStrList)
447 {
448         SysTryReturn(NID_LCL, pIcuTZStrList, null, E_SYSTEM,
449                                 "[%s] The method cannot proceed due to a severe system error.",GetErrorMessage(E_SYSTEM));
450
451         std::unique_ptr<HashMap, AllElementsDeleter> pTimeZoneMap(new (std::nothrow) HashMap());
452
453         SysTryReturn(NID_LCL, pTimeZoneMap, null, E_OUT_OF_MEMORY,
454                         "[%s] Memory allocation failed", GetErrorMessage(E_OUT_OF_MEMORY));
455         pTimeZoneMap->Construct();
456         result r = E_SUCCESS;
457         int resultLength = -1;
458         UErrorCode ec = U_ZERO_ERROR;
459         const char* pIcuTZStr = pIcuTZStrList->next(&resultLength, ec);
460         IMap* pTZMap = GetAvailableTimeZonesN();
461
462         r = GetLastResult();
463         SysTryReturn(NID_LCL, pTZMap, null, r, "[%s] Fail to get available time zone list", GetErrorMessage(r));
464
465         while (pIcuTZStr != null)
466         {
467                 String* pTimeZone = new (std::nothrow) String(pIcuTZStr);
468                 SysTryReturn(NID_LCL, pTimeZone, null, E_OUT_OF_MEMORY,
469                                         "[%s] Memory allocation failed.", GetErrorMessage(E_OUT_OF_MEMORY));
470                 if (!pTimeZoneMap->ContainsKey(*pTimeZone) && pTZMap->ContainsKey(*pTimeZone))
471                 {
472                         String* pDummyValue = new  (std::nothrow) String();
473                         r = pTimeZoneMap->Add(*pTimeZone, *pDummyValue);
474                         if (IsFailed(r))
475                         {
476                                 delete pTimeZone;
477                                 delete pDummyValue;
478                                 pTZMap->RemoveAll();
479                                 SetLastResult(E_SYSTEM);
480                                 return null;
481                         }
482                 }
483
484                 pIcuTZStr = pIcuTZStrList->next(&resultLength, ec);
485         }
486         SetLastResult(E_SUCCESS);
487         pTZMap->RemoveAll();
488         return pTimeZoneMap.release();
489 }
490
491
492 IMap*
493 _LocaleManagerImpl::GetAvailableTimeZonesN(void)
494 {
495         File file;
496         String tzFilePath(TIMEZONE_LIST_FILE_PATH);
497         result r = E_SUCCESS;
498
499         std::unique_ptr<HashMap, AllElementsDeleter> pTimeZoneMap(new (std::nothrow) HashMap());
500         SysTryCatch(NID_LCL, pTimeZoneMap, null, E_OUT_OF_MEMORY,
501                         "[%s] Memory allocation failed", GetErrorMessage(E_OUT_OF_MEMORY));
502         r = file.Construct(tzFilePath, "r");
503         SysTryCatch(NID_LCL, r == E_SUCCESS, ,E_FILE_NOT_FOUND, "[E_FILE_NOT_FOUND] It is failed to get the tzlist from the ini file.");
504
505         pTimeZoneMap->Construct();
506
507         do
508         {
509                 std::unique_ptr<String> pTimeZone(new (std::nothrow) String());
510                 SysTryCatch(NID_LCL, pTimeZone, null, E_OUT_OF_MEMORY,
511                                 "[%s] Memory allocation failed.", GetErrorMessage(E_OUT_OF_MEMORY));
512                 r = file.Read(*(pTimeZone.get()));
513                 if ( r == E_END_OF_FILE)
514                 {
515                         break;
516                 }
517                 SysTryCatch(NID_LCL, r == E_SUCCESS, , r, "[%s] It is failed to read the tzlist.", GetErrorMessage(r));
518                 pTimeZone->Replace(L"\n", L"\0");
519
520                 if (!pTimeZoneMap->ContainsKey(*(pTimeZone.get())))
521                 {
522                         std::unique_ptr<String> pDummyValue(new (std::nothrow) String());
523                         SysTryCatch(NID_LCL, pDummyValue, null, E_OUT_OF_MEMORY,
524                                         "[%s] Memory allocation failed.", GetErrorMessage(E_OUT_OF_MEMORY));
525
526                         r = pTimeZoneMap->Add(*(pTimeZone.get()), *(pDummyValue.get()));
527                         SysTryCatch(NID_LCL, r == E_SUCCESS, , r,"[%s] It is failed to add the tz into the tz map.", GetErrorMessage(r));
528                         pTimeZone.release();
529                         pDummyValue.release();
530                 }
531         }while (1);
532
533         SetLastResult(E_SUCCESS);
534         return pTimeZoneMap.release();
535
536 CATCH:
537         return GetAvailableTimeZonesFallbackN();
538 }
539
540
541 IMap*
542 _LocaleManagerImpl::GetAvailableTimeZonesFallbackN(void)
543 {
544         std::unique_ptr<HashMap, AllElementsDeleter> pTimeZoneMap(new (std::nothrow) HashMap());
545         SysTryReturn(NID_LCL, pTimeZoneMap, null, E_OUT_OF_MEMORY,
546                         "[%s] Memory allocation failed", GetErrorMessage(E_OUT_OF_MEMORY));
547
548         result r = E_SUCCESS;
549         int index = 0;
550                 
551         pTimeZoneMap->Construct();
552         
553         do
554         {
555                 String* pTimeZone = new (std::nothrow) String(TimeZoneList[index++]);
556                 SysTryReturn(NID_LCL, pTimeZone, null, E_OUT_OF_MEMORY,
557                         "[%s] Memory allocation failed.", GetErrorMessage(E_OUT_OF_MEMORY));
558
559                 if (!pTimeZoneMap->ContainsKey(*pTimeZone))
560                 {
561                         String* pDummyValue = new  (std::nothrow) String();
562
563                         r = pTimeZoneMap->Add(*pTimeZone, *pDummyValue);
564                         if (IsFailed(r))
565                         {
566                                 delete pTimeZone;
567                                 delete pDummyValue;
568                                 SetLastResult(E_SYSTEM);
569                                 return null;
570                         }
571                 }
572         }while (index < TIMEZONE_MAX);
573
574         SetLastResult(E_SUCCESS);
575         return pTimeZoneMap.release();
576 }
577
578
579 IMap*
580 _LocaleManagerImpl::GetAvailableTimeZonesN(int rawOffset)
581 {
582         return GetAvailableTimeZonesN(U_ICU_NAMESPACE::TimeZone::createEnumeration(rawOffset * _TimeZoneImpl::ONE_MIN_IN_MILLISEC));
583 }
584
585
586 TimeZone
587 _LocaleManagerImpl::GetSystemTimeZone(void)
588 {
589         char tz[PATH_MAX + 1];
590         int len = readlink("/opt/etc/localtime", tz, PATH_MAX);
591
592         SysTryReturn(NID_LCL, len > 0, TimeZone(-1, ""), E_SYSTEM, "It is failed to get System Time Zone");
593         tz[len] = '\0';
594         SysTryReturn(NID_LCL, len > 20, TimeZone(-1, ""), E_SYSTEM, "It is failed to get System Time Zone");
595
596         String tzId(tz + 20);
597         SysLog(NID_LCL, "System TimeZone id [%ls]", tzId.GetPointer());
598         TimeZone timeZone;
599         result r = Tizen::Locales::TimeZone::GetTimeZone(tzId, timeZone);
600         SysTryReturn(NID_LCL, r == E_SUCCESS, TimeZone(-1, ""), r, "[%s] error occurs.", GetErrorMessage(r));
601         return timeZone;
602 }
603
604 result
605 _LocaleManagerImpl::IsSupportedLocale(const Tizen::Locales::Locale& locale, bool& isSupportedLocale)
606 {
607         isSupportedLocale = _LocaleImpl::IsSupported(locale);
608         return E_SUCCESS;
609 }
610
611 };
612 };      // Tizen::Locales