added more internal strings to the language file
Imported-from: https://svn.code.sf.net/p/dosbox/code-0/dosbox/trunk@400
This commit is contained in:
parent
b6ee1caa6d
commit
2460aa3bf9
4 changed files with 72 additions and 39 deletions
|
@ -35,10 +35,10 @@ public:
|
|||
/* Parse the command line */
|
||||
/* if the command line is empty show current mounts */
|
||||
if (!cmd->GetCount()) {
|
||||
WriteOut("Current mounted drives are\n");
|
||||
WriteOut(MSG_Get("PROGRAM_MOUNT_STATUS_1"));
|
||||
for (int d=0;d<DOS_DRIVES;d++) {
|
||||
if (Drives[d]) {
|
||||
WriteOut("Drive %c is mounted as %s\n",d+'A',Drives[d]->GetInfo());
|
||||
WriteOut(MSG_Get("PROGRAM_MOUNT_STATUS_2"),d+'A',Drives[d]->GetInfo());
|
||||
}
|
||||
}
|
||||
return;
|
||||
|
@ -75,12 +75,12 @@ public:
|
|||
if (!temp_line.size()) goto showusage;
|
||||
struct stat test;
|
||||
if (stat(temp_line.c_str(),&test)) {
|
||||
WriteOut("Directory %s Doesn't exist",temp_line.c_str());
|
||||
WriteOut(MSG_Get("PROGRAM_MOUNT_ERROR_1"),temp_line.c_str());
|
||||
return;
|
||||
}
|
||||
/* Not a switch so a normal directory/file */
|
||||
if (!(test.st_mode & S_IFDIR)) {
|
||||
WriteOut("%s isn't a directory",temp_line.c_str());
|
||||
WriteOut(MSG_Get("PROGRAM_MOUNT_ERROR_2"),temp_line.c_str());
|
||||
return;
|
||||
}
|
||||
if (temp_line[temp_line.size()-1]!=CROSS_FILESPLIT) temp_line+=CROSS_FILESPLIT;
|
||||
|
@ -91,7 +91,7 @@ public:
|
|||
drive=toupper(temp_line[0]);
|
||||
if (!isalpha(drive)) goto showusage;
|
||||
if (Drives[drive-'A']) {
|
||||
WriteOut("Drive %c already mounted with %s\n",drive,Drives[drive-'A']->GetInfo());
|
||||
WriteOut(MSG_Get("PROGRAM_MOUNT_ALLREADY_MOUNDTED"),drive,Drives[drive-'A']->GetInfo());
|
||||
if (newdrive) delete newdrive;
|
||||
return;
|
||||
}
|
||||
|
@ -102,7 +102,7 @@ public:
|
|||
WriteOut("Drive %c mounted as %s\n",drive,newdrive->GetInfo());
|
||||
return;
|
||||
showusage:
|
||||
WriteOut("Usage MOUNT Drive-Letter Local-Directory\nSo a MOUNT c c:\\windows mounts windows directory as the c: drive in DOSBox\n");
|
||||
WriteOut(MSG_Get("PROGRAM_MOUNT_USAGE"));
|
||||
return;
|
||||
}
|
||||
};
|
||||
|
@ -118,7 +118,7 @@ public:
|
|||
WriteOut("\n");
|
||||
Bit16u seg,blocks;blocks=0xffff;
|
||||
DOS_AllocateMemory(&seg,&blocks);
|
||||
WriteOut("%10d Kb free conventional memory\n",blocks*16/1024);
|
||||
WriteOut(MSG_Get("PROGRAM_MEM_CONVEN"),blocks*16/1024);
|
||||
/* Test for and show free XMS */
|
||||
reg_ax=0x4300;CALLBACK_RunRealInt(0x2f);
|
||||
if (reg_al==0x80) {
|
||||
|
@ -127,7 +127,7 @@ public:
|
|||
reg_ah=8;
|
||||
CALLBACK_RunRealFar(xms_seg,xms_off);
|
||||
if (!reg_bl) {
|
||||
WriteOut("%10d Kb free extended memory\n",reg_dx);
|
||||
WriteOut(MSG_Get("PROGRAM_MEM_EXTEND"),reg_dx);
|
||||
}
|
||||
}
|
||||
/* Test for and show free EMS */
|
||||
|
@ -136,7 +136,7 @@ public:
|
|||
DOS_CloseFile(handle);
|
||||
reg_ah=0x42;
|
||||
CALLBACK_RunRealInt(0x67);
|
||||
WriteOut("%10d Kb free expanded memory\n",reg_bx*16);
|
||||
WriteOut(MSG_Get("PROGRAM_MEM_EXPAND"),reg_bx*16);
|
||||
}
|
||||
}
|
||||
};
|
||||
|
@ -163,10 +163,10 @@ void UPCASE::upcasedir(const char * directory) {
|
|||
struct stat finfo;
|
||||
|
||||
if(!(sdir=opendir(directory))) {
|
||||
WriteOut("Failed to open directory %s\n",directory);
|
||||
WriteOut(MSG_Get("PROGRAM_UPCASE_ERROR_DIR"),directory);
|
||||
return;
|
||||
}
|
||||
WriteOut("Scanning directory %s\n",fullname);
|
||||
WriteOut(MSG_Get("PROGRAM_UPCASE_SCANNING_DIR"),fullname);
|
||||
while (tempdata=readdir(sdir)) {
|
||||
if (strcmp(tempdata->d_name,".")==0) continue;
|
||||
if (strcmp(tempdata->d_name,"..")==0) continue;
|
||||
|
@ -177,7 +177,7 @@ void UPCASE::upcasedir(const char * directory) {
|
|||
strcat(newname,"/");
|
||||
upcase(tempdata->d_name);
|
||||
strcat(newname,tempdata->d_name);
|
||||
WriteOut("Renaming %s to %s\n",fullname,newname);
|
||||
WriteOut(MSG_Get("PROGRAM_UPCASE_RENAME"),fullname,newname);
|
||||
rename(fullname,newname);
|
||||
stat(fullname,&finfo);
|
||||
if(S_ISDIR(finfo.st_mode)) {
|
||||
|
@ -191,31 +191,27 @@ void UPCASE::upcasedir(const char * directory) {
|
|||
void UPCASE::Run(void) {
|
||||
/* First check if the directory exists */
|
||||
struct stat info;
|
||||
WriteOut("UPCASE 0.1 Directory case convertor.\n");
|
||||
WriteOut(MSG_Get("PROGRAM_UPCASE_RUN_1"));
|
||||
if (!cmd->GetCount()) {
|
||||
WriteOut("Usage UPCASE [local directory]\n");
|
||||
WriteOut("This tool will convert all files and subdirectories in a directory.\n");
|
||||
WriteOut("Be VERY sure this directory contains only dos related material.\n");
|
||||
WriteOut("Otherwise you might horribly screw up your filesystem.\n");
|
||||
WriteOut(MSG_Get("PROGRAM_UPCASE_USAGE"));
|
||||
return;
|
||||
}
|
||||
cmd->FindCommand(1,temp_line);
|
||||
if (stat(temp_line.c_str(),&info)) {
|
||||
WriteOut("%s doesn't exist\n",temp_line.c_str());
|
||||
WriteOut(MSG_Get("PROGRAM_UPCASE_RUN_ERROR_1"),temp_line.c_str());
|
||||
return;
|
||||
}
|
||||
if(!S_ISDIR(info.st_mode)) {
|
||||
WriteOut("%s isn't a directory\n",temp_line.c_str());
|
||||
WriteOut(MSG_Get("PROGRAM_UPCASE_RUN_ERROR_2"),temp_line.c_str());
|
||||
return;
|
||||
}
|
||||
WriteOut("Converting the wrong directories can be very harmfull, please be carefull.\n");
|
||||
WriteOut("Are you really really sure you want to convert %s to upcase?Y/N\n",temp_line.c_str());
|
||||
WriteOut(MSG_Get("PROGRAM_UPCASE_RUN_CHOICE"),temp_line.c_str());
|
||||
Bit8u key;Bit16u n=1;
|
||||
DOS_ReadFile(STDIN,&key,&n);
|
||||
if (toupper(key)=='Y') {
|
||||
upcasedir(temp_line.c_str());
|
||||
} else {
|
||||
WriteOut("Okay better not do it.\n");
|
||||
WriteOut(MSG_Get("PROGRAM_UPCASE_RUN_NO"));
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -225,7 +221,30 @@ static void UPCASE_ProgramStart(Program * * make) {
|
|||
#endif
|
||||
|
||||
void DOS_SetupPrograms(void) {
|
||||
|
||||
/*Add Messages */
|
||||
MSG_Add("PROGRAM_MOUNT_STATUS_2","Drive %c is mounted as %s\n");
|
||||
MSG_Add("PROGRAM_MOUNT_STATUS_1","Current mounted drives are:\n");
|
||||
MSG_Add("PROGRAM_MOUNT_ERROR_1","Directory %s doesn't exist.\n");
|
||||
MSG_Add("PROGRAM_MOUNT_ERROR_2","%s isn't a directory\n");
|
||||
MSG_Add("PROGRAM_MOUNT_ALLREADY_MOUNTED","Drive %c already mounted with %s\n");
|
||||
MSG_Add("PROGRAM_MOUNT_USAGE","Usage MOUNT Drive-Letter Local-Directory\nSo a MOUNT c c:\\windows mounts windows directory as the c: drive in DOSBox\n");
|
||||
|
||||
MSG_Add("PROGRAM_MEM_CONVEN","%10d Kb free conventional memory\n");
|
||||
MSG_Add("PROGRAM_MEM_EXTEND","%10d Kb free extended memory\n");
|
||||
MSG_Add("PROGRAM_MEM_EXPAND","%10d Kb free expanded memory\n");
|
||||
|
||||
#if !defined (WIN32) /* Unix */
|
||||
MSG_Add("PROGRAM_UPCASE_ERROR_DIR","Failed to open directory %s\n");
|
||||
MSG_Add("PROGRAM_UPCASE_SCANNING_DIR","Scanning directory %s\n");
|
||||
MSG_Add("PROGRAM_UPCASE_RENAME","Renaming %s to %s\n");
|
||||
MSG_Add("PROGRAM_UPCASE_RUN_1","UPCASE 0.1 Directory case convertor.\n");
|
||||
MSG_Add("PROGRAM_UPCASE_USAGE","Usage UPCASE [local directory]\nThis tool will convert all files and subdirectories in a directory.\nBe VERY sure this directory contains only dos related material.\nOtherwise you might horribly screw up your filesystem.\n");
|
||||
MSG_Add("PROGRAM_UPCASE_RUN_ERROR_1","%s doesn't exist\n");
|
||||
MSG_Add("PROGRAM_UPCASE_RUN_ERROR_2","%s isn't a directory\n");
|
||||
MSG_Add("PROGRAM_UPCASE_RUN_CHOICE","Converting the wrong directories can be very harmfull, please be carefull.\nAre you really really sure you want to convert %s to upcase?Y/N\n");
|
||||
MSG_Add("PROGRAM_UPCASE_RUN_NO","Okay better not do it.\n");
|
||||
#endif
|
||||
/*regular setup*/
|
||||
PROGRAMS_MakeFile("MOUNT.COM",MOUNT_ProgramStart);
|
||||
PROGRAMS_MakeFile("MEM.COM",MEM_ProgramStart);
|
||||
#if !defined (WIN32) /* Unix */
|
||||
|
|
|
@ -121,7 +121,7 @@ bool localDrive::FindNext(DOS_DTA & dta) {
|
|||
strcpy(full_name,srch_dir);
|
||||
strcat(full_name,dir_ent->d_name);
|
||||
if(stat(full_name,&stat_block)!=0){
|
||||
exit(1);
|
||||
goto again;
|
||||
}
|
||||
if(S_ISDIR(stat_block.st_mode)) find_attr=DOS_ATTR_DIRECTORY;
|
||||
else find_attr=DOS_ATTR_ARCHIVE;
|
||||
|
|
|
@ -202,7 +202,21 @@ void SHELL_Init() {
|
|||
MSG_Add("SHELL_EXECUTE_DRIVE_NOT_FOUND","Drive %c does not exist!\n");
|
||||
MSG_Add("SHELL_EXECUTE_ILLEGAL_COMMAND","Illegal command: %s.\n");
|
||||
MSG_Add("SHELL_STARTUP","DOSBox Shell v0.40\nFor Help and supported commands type: HELP\n\nHAVE FUN!\nThe DOSBox Team\n\n");
|
||||
/* Regular startup */
|
||||
MSG_Add("SHELL_CMD_CHDIR_HELP","Change Directory.\n");
|
||||
MSG_Add("SHELL_CMD_CLS_HELP","Clear screen.\n");
|
||||
MSG_Add("SHELL_CMD_DIR_HELP","Directory View.\n");
|
||||
MSG_Add("SHELL_CMD_ECHO_HELP","Display messages and enable/disable command echoing.\n");
|
||||
MSG_Add("SHELL_CMD_EXIT_HELP","Exit from the shell.\n");
|
||||
MSG_Add("SHELL_CMD_HELP_HELP","Show help.\n");
|
||||
MSG_Add("SHELL_CMD_MKDIR_HELP","Make Directory.\n");
|
||||
MSG_Add("SHELL_CMD_RMDIR_HELP","Remove Directory.\n");
|
||||
MSG_Add("SHELL_CMD_SET_HELP","Change environment variables.\n");
|
||||
MSG_Add("SHELL_CMD_IF_HELP","Performs conditional processing in batch programs.\n");
|
||||
MSG_Add("SHELL_CMD_GOTO_HELP","Jump to a labeled line in a batch script.\n");
|
||||
MSG_Add("SHELL_CMD_TYPE_HELP","Display the contents of a text-file.\n");
|
||||
MSG_Add("SHELL_CMD_REM_HELP","Add comments in a batch file.\n");
|
||||
|
||||
/* Regular startup */
|
||||
call_shellstop=CALLBACK_Allocate();
|
||||
|
||||
CALLBACK_Setup(call_shellstop,shellstop_handler,CB_IRET);
|
||||
|
|
|
@ -24,20 +24,20 @@
|
|||
|
||||
|
||||
static SHELL_Cmd cmd_list[]={
|
||||
"CD", 0, &DOS_Shell::CMD_CHDIR, "Change Directory.",
|
||||
"CLS", 0, &DOS_Shell::CMD_CLS, "Clear screen.",
|
||||
"CD", 0, &DOS_Shell::CMD_CHDIR, "SHELL_CMD_CHDIR_HELP",
|
||||
"CLS", 0, &DOS_Shell::CMD_CLS, "SHELL_CMD_CLS_HELP",
|
||||
// "COPY", 0, &DOS_Shell::CMD_COPY, "Copy Files.",
|
||||
"DIR", 0, &DOS_Shell::CMD_DIR, "Directory View.",
|
||||
"ECHO", 0, &DOS_Shell::CMD_ECHO, "Display messages and enable/disable command echoing.",
|
||||
"EXIT", 0, &DOS_Shell::CMD_EXIT, "Exit from the shell.",
|
||||
"HELP", 0, &DOS_Shell::CMD_HELP, "Show help.",
|
||||
"MD", 0, &DOS_Shell::CMD_MKDIR, "Make Directory.",
|
||||
"RD", 0, &DOS_Shell::CMD_RMDIR, "Remove Directory.",
|
||||
"SET", 0, &DOS_Shell::CMD_SET, "Change environment variables.",
|
||||
"IF", 0, &DOS_Shell::CMD_IF, "Performs conditional processing in batch programs.",
|
||||
"GOTO", 0, &DOS_Shell::CMD_GOTO, "Jump to a labeled line in a batch script.",
|
||||
"TYPE", 0, &DOS_Shell::CMD_TYPE, "Display the contents of a text-file.",
|
||||
"REM", 0, &DOS_Shell::CMD_REM, "Add comments in a batch file.",
|
||||
"DIR", 0, &DOS_Shell::CMD_DIR, "SHELL_CMD_DIR_HELP",
|
||||
"ECHO", 0, &DOS_Shell::CMD_ECHO, "SHELL_CMD_ECHO_HELP",
|
||||
"EXIT", 0, &DOS_Shell::CMD_EXIT, "SHELL_CMD_EXIT_HELP",
|
||||
"HELP", 0, &DOS_Shell::CMD_HELP, "SHELL_CMD_HELP_HELP",
|
||||
"MD", 0, &DOS_Shell::CMD_MKDIR, "SHELL_CMD_MKDIR_HELP",
|
||||
"RD", 0, &DOS_Shell::CMD_RMDIR, "SHELL_CMD_RMDIR_HELP",
|
||||
"SET", 0, &DOS_Shell::CMD_SET, "SHELL_CMD_SET_HELP",
|
||||
"IF", 0, &DOS_Shell::CMD_IF, "SHELL_CMD_IF_HELP",
|
||||
"GOTO", 0, &DOS_Shell::CMD_GOTO, "SHELL_CMD_GOTO_HELP",
|
||||
"TYPE", 0, &DOS_Shell::CMD_TYPE, "SHELL_CMD_TYPE_HELP",
|
||||
"REM", 0, &DOS_Shell::CMD_REM, "SHELL_CMD_REM_HELP",
|
||||
|
||||
/*
|
||||
"CHDIR", 0, &DOS_Shell::CMD_CHDIR, "Change Directory",
|
||||
|
@ -85,7 +85,7 @@ void DOS_Shell::CMD_HELP(char * args){
|
|||
WriteOut(MSG_Get("SHELL_CMD_HELP"));
|
||||
Bit32u cmd_index=0;
|
||||
while (cmd_list[cmd_index].name) {
|
||||
if (!cmd_list[cmd_index].flags) WriteOut("%-8s %s\n",cmd_list[cmd_index].name,cmd_list[cmd_index].help);
|
||||
if (!cmd_list[cmd_index].flags) WriteOut("%-8s %s",cmd_list[cmd_index].name,MSG_Get(cmd_list[cmd_index].help));
|
||||
cmd_index++;
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue