Fixed Cz.rc to SUBLANG_DEFAULT so make VS happy
[reactos.git] / reactos / lib / cpl / timedate / timedate.c
index a7c4d78..70c9301 100644 (file)
@@ -102,14 +102,35 @@ SetTimeZoneName(HWND hwnd)
 {
   TIME_ZONE_INFORMATION TimeZoneInfo;
   WCHAR TimeZoneString[128];
+  WCHAR TimeZoneText[128];
+  WCHAR TimeZoneName[128];
   DWORD TimeZoneId;
 
   TimeZoneId = GetTimeZoneInformation(&TimeZoneInfo);
 
-  wsprintf(TimeZoneString,
-          L"Current time zone: %s\n",
-          (TimeZoneId == TIME_ZONE_ID_DAYLIGHT) ? TimeZoneInfo.DaylightName : TimeZoneInfo.StandardName);
+  LoadString(hApplet, IDS_TIMEZONETEXT, TimeZoneText, 128);
 
+  switch (TimeZoneId)
+  {
+    case TIME_ZONE_ID_STANDARD:
+      wcscpy(TimeZoneName, TimeZoneInfo.StandardName);
+      break;
+
+    case TIME_ZONE_ID_DAYLIGHT:
+      wcscpy(TimeZoneName, TimeZoneInfo.DaylightName);
+      break;
+
+    case TIME_ZONE_ID_UNKNOWN:
+      LoadString(hApplet, IDS_TIMEZONEUNKNOWN, TimeZoneName, 128);
+      break;
+
+    case TIME_ZONE_ID_INVALID:
+    default:
+      LoadString(hApplet, IDS_TIMEZONEINVALID, TimeZoneName, 128);
+      break;
+  }
+
+  wsprintf(TimeZoneString, TimeZoneText, TimeZoneName);
   SendDlgItemMessageW(hwnd, IDC_TIMEZONE, WM_SETTEXT, 0, (LPARAM)TimeZoneString);
 }
 
@@ -441,7 +462,7 @@ GetAutoDaylightInfo(HWND hwnd)
   if (RegOpenKeyExW(HKEY_LOCAL_MACHINE,
                    L"SYSTEM\\CurrentControlSet\\Control\\TimeZoneInformation",
                    0,
-                   KEY_SET_VALUE,
+                   KEY_QUERY_VALUE,
                    &hKey))
     return;