Apply system region locale for dateformatter on setting.
authorHokwon Song <hokwon.song@samsung.com>
Thu, 29 Aug 2013 03:13:21 +0000 (12:13 +0900)
committerHokwon Song <hokwon.song@samsung.com>
Thu, 29 Aug 2013 03:13:21 +0000 (12:13 +0900)
Change-Id: I200f375242b0bdbfb0091ff91de4f1e64aabb0b7
Signed-off-by: Hokwon Song <hokwon.song@samsung.com>
src/system-server/setting/providers/FSys_Icu.cpp

index 63a7c8d..c5f590d 100644 (file)
@@ -21,6 +21,7 @@
 
 #include <stdlib.h>
 #include <memory.h>
+#include <runtime_info.h>
 
 #include <FBaseSysLog.h>
 #include <FBase_NativeError.h>
@@ -98,13 +99,13 @@ _Icu::GetDateTimeFormatN(const char* pIcuFormat)
        }
 
        UChar   customSkeleton[256] = {0, };
-       const char* pLocaleDefault = uloc_getDefault();
-
-       pDateTimeFormat = const_cast< char* > (pLocaleDefault);
-
-       u_uastrncpy(customSkeleton, pIcuFormat, sizeof(customSkeleton));
-       pFormatString = GetIcuPatternN(pDateTimeFormat, customSkeleton);
-
+       char* pRegionPtr;
+       if (runtime_info_get_value_string(RUNTIME_INFO_KEY_REGION, &pRegionPtr) == RUNTIME_INFO_ERROR_NONE)
+       {
+               u_uastrncpy(customSkeleton, pIcuFormat, sizeof(customSkeleton));
+               pFormatString = GetIcuPatternN(pRegionPtr, customSkeleton);
+               free(pRegionPtr);
+       }
        return pFormatString;
 }