Remove all hardcode string to En.rc Modified: trunk/reactos/subsys/system/cmd/En.rc Modified: trunk/reactos/subsys/system/cmd/ren.c Modified: trunk/reactos/subsys/system/cmd/resource.h Modified: trunk/reactos/subsys/system/cmd/start.c Modified: trunk/reactos/subsys/system/cmd/time.c _____
Modified: trunk/reactos/subsys/system/cmd/En.rc --- trunk/reactos/subsys/system/cmd/En.rc 2005-04-30 12:36:36 UTC (rev 14869) +++ trunk/reactos/subsys/system/cmd/En.rc 2005-04-30 13:13:36 UTC (rev 14870) @@ -355,6 +355,23 @@
STRING_RMDIR_HELP, "Removes a directory.\n\n \ RMDIR [drive:]path\nRD [drive:]path"
+STRING_REN_HELP1, "Renames a file/directory or files/directories.\n\n \ +RENAME [/E /N /P /Q /S /T] old_name ... new_name\n \ +REN [/E /N /P /Q /S /T] old_name ... new_name\n\n \ + /E No eror messages.\n \ + /N Nothing.\n \ + /P Prompts for confirmation before renaming each file.\n \ + (Not implemented yet!)\n \ + /Q Quiet.\n \ + /S Rename subdirectories.\n \ + /T Display total number of renamed files.\n\n \ +Note that you cannot specify a new drive or path for your destination. Use\n \ +the MOVE command for that purpose." + +STRING_REN_HELP2, " %lu file renamed\n" + +STRING_REN_HELP3, " %lu files renamed\n" + STRING_SHIFT_HELP, "Changes the position of replaceable parameters in a batch file.\n\n \ SHIFT [DOWN]"
@@ -369,14 +386,25 @@ string Specifies a series of characters to assign to the variable.\n\n \ Type SET without parameters to display the current environment variables.\n"
+STRING_START_HELP1, "Starts a command.\n\n \ +START command \n\n \ + command Specifies the command to run.\n\n \ +At the moment all commands are started asynchronously.\n" + STRING_TITLE_HELP, "Sets the window title for the command prompt window.\n\n \ TITLE [string]\n\n \ string Specifies the title for the command prompt window."
- +STRING_TIME_HELP1, "Displays or sets the system time.\n\n \ +TIME [/T][time]\n\n \ + /T display only\n\n \ +Type TIME with no parameters to display the current time setting and a prompt\n \ +for a new one. Press ENTER to keep the same time."
+STRING_TIME_HELP2, "Enter new time: "
+ STRING_CHOICE_OPTION, "YN" STRING_COPY_OPTION, "YNA" @@ -431,8 +459,14 @@
STRING_PARAM_ERROR, "Required parameter missing\n"
-STRING_PATH_ERROR "CMD: Not in environment 'PATH'\n" +STRING_PATH_ERROR, "CMD: Not in environment 'PATH'\n"
+STRING_REN_ERROR1, "MoveFile() failed. Error: %lu\n" + +STRING_START_ERROR1, "No batch support at the moment!" + +STRING_TIME_ERROR1, "Invalid time." + STRING_ERROR_PARAMETERF_ERROR, "Parameter format not correct - %c\n" STRING_ERROR_INVALID_SWITCH, "Invalid switch - /%c\n" STRING_ERROR_TOO_MANY_PARAMETERS, "Too many parameters - %s\n" _____
Modified: trunk/reactos/subsys/system/cmd/ren.c --- trunk/reactos/subsys/system/cmd/ren.c 2005-04-30 12:36:36 UTC (rev 14869) +++ trunk/reactos/subsys/system/cmd/ren.c 2005-04-30 13:13:36 UTC (rev 14870) @@ -15,9 +15,13 @@
* * 17-Oct-2001 (Eric Kohl ekohl@rz.online.de * Implemented basic rename code. + * + * 30-Apr-2005 (Magnus Olsen) magnus@greatlord.com) + * Remove all hardcode string to En.rc */
#include "precomp.h" +#include "resource.h"
#ifdef INCLUDE_CMD_RENAME
@@ -54,24 +58,13 @@
HANDLE hFile; WIN32_FIND_DATA f; + WCHAR szMsg[RC_STRING_MAX_SIZE];
if (!_tcsncmp(param, _T("/?"), 2)) { - ConOutPuts(_T("Renames a file/directory or files/directories.\n" - "\n" - "RENAME [/E /N /P /Q /S /T] old_name ... new_name\n" - "REN [/E /N /P /Q /S /T] old_name ... new_name\n" - "\n" - " /E No eror messages.\n" - " /N Nothing.\n" - " /P Prompts for confirmation before renaming each file.\n" - " (Not implemented yet!)\n" - " /Q Quiet.\n" - " /S Rename subdirectories.\n" - " /T Display total number of renamed files.\n" - "\n" - "Note that you cannot specify a new drive or path for your destination. Use\n" - "the MOVE command for that purpose.")); + LoadString( GetModuleHandle(NULL), STRING_REN_HELP1, (LPTSTR) szMsg,sizeof(szMsg)); + ConOutPuts((LPTSTR)szMsg); + return(0); }
@@ -245,7 +238,10 @@ else { if (!(dwFlags & REN_ERROR)) - ConErrPrintf(_T("MoveFile() failed. Error: %lu\n"), GetLastError()); + { + LoadString( GetModuleHandle(NULL), STRING_REN_ERROR1, (LPTSTR) szMsg,sizeof(szMsg)); + ConErrPrintf ((LPTSTR)szMsg, GetLastError()); + } } } } @@ -256,13 +252,15 @@ if (!(dwFlags & REN_QUIET)) { if (dwFiles == 1) - ConOutPrintf(_T(" %lu file renamed\n"), - dwFiles); + LoadString( GetModuleHandle(NULL), STRING_REN_HELP2, (LPTSTR) szMsg,sizeof(szMsg)); else - ConOutPrintf(_T(" %lu files renamed\n"), - dwFiles); + LoadString( GetModuleHandle(NULL), STRING_REN_HELP3, (LPTSTR) szMsg,sizeof(szMsg)); + + ConOutPrintf((LPTSTR)szMsg,dwFiles); }
+ + freep(arg);
return(0); _____
Modified: trunk/reactos/subsys/system/cmd/resource.h --- trunk/reactos/subsys/system/cmd/resource.h 2005-04-30 12:36:36 UTC (rev 14869) +++ trunk/reactos/subsys/system/cmd/resource.h 2005-04-30 13:13:36 UTC (rev 14870) @@ -65,6 +65,9 @@
#define STRING_MOVE_ERROR2 343 #define STRING_PARAM_ERROR 344 #define STRING_PATH_ERROR 345 +#define STRING_REN_ERROR1 346 +#define STRING_START_ERROR1 347 +#define STRING_TIME_ERROR1 348
@@ -158,18 +161,27 @@
#define STRING_REM_HELP 670
-#define STRING_RMDIR_HELP 671 +#define STRING_REN_HELP1 671 +#define STRING_REN_HELP2 672 +#define STRING_REN_HELP3 673
-#define STRING_SCREEN_HELP 672 +#define STRING_RMDIR_HELP 672
-#define STRING_SHIFT_HELP 673 +#define STRING_SCREEN_HELP 673
-#define STRING_SET_HELP 674 +#define STRING_SHIFT_HELP 674
-#define STRING_TITLE_HELP 675 +#define STRING_SET_HELP 675
+#define STRING_START_HELP1 676
+#define STRING_TITLE_HELP 677
+#define STRING_TIME_HELP1 678 +#define STRING_TIME_HELP2 679 + + +
_____
Modified: trunk/reactos/subsys/system/cmd/start.c --- trunk/reactos/subsys/system/cmd/start.c 2005-04-30 12:36:36 UTC (rev 14869) +++ trunk/reactos/subsys/system/cmd/start.c 2005-04-30 13:13:36 UTC (rev 14870) @@ -6,9 +6,13 @@
* * 24-Jul-1999 (Eric Kohl ekohl@abo.rhein-zeitung.de) * Started. + * + * 30-Apr-2005 (Magnus Olsen) magnus@greatlord.com) + * Remove all hardcode string to En.rc */
#include "precomp.h" +#include "resource.h"
#ifdef INCLUDE_CMD_START
@@ -18,13 +22,13 @@ TCHAR szFullName[MAX_PATH]; BOOL bWait = FALSE; TCHAR *param; + WCHAR szMsg[RC_STRING_MAX_SIZE];
if (_tcsncmp (rest, _T("/?"), 2) == 0) { - ConOutPuts (_T("Starts a command.\n\n" - "START command \n\n" - " command Specifies the command to run.\n\n" - "At the moment all commands are started asynchronously.\n")); + + LoadString( GetModuleHandle(NULL), STRING_START_HELP1, (LPTSTR) szMsg,sizeof(szMsg)); + ConOutPuts((LPTSTR)szMsg);
return 0; } @@ -68,7 +72,9 @@ #ifdef _DEBUG DebugPrintf (_T("[BATCH: %s %s]\n"), szFullName, rest); #endif - ConErrPuts (_T("No batch support at the moment!")); + + LoadString( GetModuleHandle(NULL), STRING_START_ERROR1, (LPTSTR) szMsg,sizeof(szMsg)); + ConErrPuts ((LPTSTR)szMsg); } else { _____
Modified: trunk/reactos/subsys/system/cmd/time.c --- trunk/reactos/subsys/system/cmd/time.c 2005-04-30 12:36:36 UTC (rev 14869) +++ trunk/reactos/subsys/system/cmd/time.c 2005-04-30 13:13:36 UTC (rev 14870) @@ -19,9 +19,13 @@
* * 04-Feb-1999 (Eric Kohl ekohl@abo.rhein-zeitung.de) * Fixed time input bug. + * + * 30-Apr-2005 (Magnus Olsen) magnus@greatlord.com) + * Remove all hardcode string to En.rc */
#include "precomp.h" +#include "resource.h"
#ifdef INCLUDE_CMD_TIME
@@ -133,17 +137,13 @@ INT i; BOOL bPrompt = TRUE; INT nTimeString = -1; + WCHAR szMsg[RC_STRING_MAX_SIZE];
+ if (!_tcsncmp (param, _T("/?"), 2)) { - ConOutPuts (_T("Displays or sets the system time.\n" - "\n" - "TIME [/T][time]\n" - "\n" - " /T display only\n" - "\n" - "Type TIME with no parameters to display the current time setting and a prompt\n" - "for a new one. Press ENTER to keep the same time.")); + LoadString( GetModuleHandle(NULL), STRING_TIME_HELP1, (LPTSTR) szMsg,sizeof(szMsg)); + ConOutPuts((LPTSTR)szMsg); return 0; }
@@ -175,7 +175,8 @@ { TCHAR s[40];
- ConOutPrintf (_T("Enter new time: ")); + LoadString( GetModuleHandle(NULL), STRING_TIME_HELP2, (LPTSTR) szMsg,sizeof(szMsg)); + ConOutPrintf ((LPTSTR)szMsg);
ConInString (s, 40);
@@ -203,7 +204,8 @@ /* force input the next time around. */ nTimeString = -1; } - ConErrPuts (_T("Invalid time.")); + LoadString( GetModuleHandle(NULL), STRING_TIME_ERROR1, (LPTSTR) szMsg,sizeof(szMsg)); + ConErrPuts ((LPTSTR)szMsg); }
freep (arg);