Remove all hardcode string to En.rc
from locale.c
Modified: trunk/reactos/subsys/system/cmd/En.rc
Modified: trunk/reactos/subsys/system/cmd/locale.c
Modified: trunk/reactos/subsys/system/cmd/resource.h
_____
Modified: trunk/reactos/subsys/system/cmd/En.rc
--- trunk/reactos/subsys/system/cmd/En.rc 2005-04-29 16:41:52 UTC
(rev 14862)
+++ trunk/reactos/subsys/system/cmd/En.rc 2005-04-29 19:49:50 UTC
(rev 14863)
@@ -274,6 +274,7 @@
STRING_LABEL_HELP4, "Volume Serial Number is %04X-%04X\n"
STRING_LABEL_HELP5, "Drive label (11 Characters, ENTER if none)? "
+STRING_LOCALE_HELP1, "Current time is"
STRING_MKDIR_HELP, "Creates a directory.\n\n \
MKDIR [drive:]path\nMD [drive:]path"
_____
Modified: trunk/reactos/subsys/system/cmd/locale.c
--- trunk/reactos/subsys/system/cmd/locale.c 2005-04-29 16:41:52 UTC
(rev 14862)
+++ trunk/reactos/subsys/system/cmd/locale.c 2005-04-29 19:49:50 UTC
(rev 14863)
@@ -12,6 +12,7 @@
*/
#include "precomp.h"
+#include "resource.h"
TCHAR cDateSeparator;
@@ -148,21 +149,24 @@
{
#ifdef __REACTOS__
SYSTEMTIME st;
+ WCHAR szMsg[RC_STRING_MAX_SIZE];
GetLocalTime (&st);
+ LoadString( GetModuleHandle(NULL), STRING_LOCALE_HELP1, (LPTSTR)
szMsg,sizeof(szMsg));
+
switch (nTimeFormat)
{
case 0: /* 12 hour format */
- default:
- ConOutPrintf (_T("Current time is
%2d%c%02d%c%02d%c%02d%c\n"),
+ default:
+ ConOutPrintf (_T("%s
%2d%c%02d%c%02d%c%02d%c\n"),(LPTSTR)szMsg,
(st.wHour == 0 ? 12 : (st.wHour
<= 12 ? st.wHour : st.wHour - 12)),
cTimeSeparator, st.wMinute,
cTimeSeparator, st.wSecond, cDecimalSeparator,
st.wMilliseconds / 10, (st.wHour
<= 11 ? 'a' : 'p'));
break;
case 1: /* 24 hour format */
- ConOutPrintf (_T("Current time is
%2d%c%02d%c%02d%c%02d\n"),
+ ConOutPrintf (_T("%s
%2d%c%02d%c%02d%c%02d\n"),(LPTSTR)szMsg,
st.wHour, cTimeSeparator,
st.wMinute, cTimeSeparator,
st.wSecond, cDecimalSeparator,
st.wMilliseconds / 10);
break;
@@ -172,6 +176,8 @@
GetTimeFormat (LOCALE_USER_DEFAULT, 0, NULL, NULL,
szTime, sizeof (szTime));
- ConOutPrintf (_T("Current time is: %s\n"), szTime);
+
+ LoadString( GetModuleHandle(NULL), STRING_LOCALE_HELP1, (LPTSTR)
szMsg,sizeof(szMsg));
+ ConOutPrintf (_T("%s: %s\n"),(LPTSTR)szMsg, szTime);
#endif
}
_____
Modified: trunk/reactos/subsys/system/cmd/resource.h
--- trunk/reactos/subsys/system/cmd/resource.h 2005-04-29 16:41:52 UTC
(rev 14862)
+++ trunk/reactos/subsys/system/cmd/resource.h 2005-04-29 19:49:50 UTC
(rev 14863)
@@ -130,17 +130,19 @@
#define STRING_LABEL_HELP4 655
#define STRING_LABEL_HELP5 656
-#define STRING_MKDIR_HELP 657
+#define STRING_LOCALE_HELP1 657
-#define STRING_MEMMORY_HELP1 658
-#define STRING_MEMMORY_HELP2 659
+#define STRING_MKDIR_HELP 658
-#define STRING_RMDIR_HELP 660
+#define STRING_MEMMORY_HELP1 659
+#define STRING_MEMMORY_HELP2 660
-#define STRING_REM_HELP 661
+#define STRING_RMDIR_HELP 661
+#define STRING_REM_HELP 662
+