mirror of
https://github.com/joncampbell123/dosbox-x.git
synced 2025-10-14 19:08:32 +08:00
Make messages in dialog translatable (messages.cpp)
This commit is contained in:
@@ -4421,7 +4421,8 @@ The INT 2Fh hook was already set up.
|
|||||||
Quitting from DOSBox-X with this is currently disabled.
|
Quitting from DOSBox-X with this is currently disabled.
|
||||||
.
|
.
|
||||||
:QUIT_CONFIRM
|
:QUIT_CONFIRM
|
||||||
This will quit from DOSBox-X.\nAre you sure?
|
This will quit from DOSBox-X.
|
||||||
|
Are you sure?
|
||||||
.
|
.
|
||||||
:QUIT_GUEST_DISABLED
|
:QUIT_GUEST_DISABLED
|
||||||
You cannot quit DOSBox-X while running a guest system.
|
You cannot quit DOSBox-X while running a guest system.
|
||||||
@@ -4435,7 +4436,8 @@ You cannot quit DOSBox-X while one or more files are open.
|
|||||||
.
|
.
|
||||||
:QUIT_FILE_OPEN_CONFIRM
|
:QUIT_FILE_OPEN_CONFIRM
|
||||||
It may be unsafe to quit from DOSBox-X right now
|
It may be unsafe to quit from DOSBox-X right now
|
||||||
because one or more files are currently open.\nAre you sure to quit anyway now?
|
because one or more files are currently open.
|
||||||
|
Are you sure to quit anyway now?
|
||||||
.
|
.
|
||||||
:QUIT_PROGRAM_DISABLED
|
:QUIT_PROGRAM_DISABLED
|
||||||
You cannot quit DOSBox-X while running a program or game.
|
You cannot quit DOSBox-X while running a program or game.
|
||||||
@@ -4443,4 +4445,17 @@ You cannot quit DOSBox-X while running a program or game.
|
|||||||
:QUIT_PROGRAM_CONFIRM
|
:QUIT_PROGRAM_CONFIRM
|
||||||
You are currently running a program or game.
|
You are currently running a program or game.
|
||||||
Are you sure to quit anyway now?
|
Are you sure to quit anyway now?
|
||||||
.
|
.
|
||||||
|
:LANG_JP_INCOMPATIBLE
|
||||||
|
You have specified a language file which uses a code page incompatible with the Japanese PC-98 or JEGA/AX system.
|
||||||
|
|
||||||
|
Are you sure to use the language file for this machine type?
|
||||||
|
.
|
||||||
|
:LANG_DOSV_INCOMPATIBLE
|
||||||
|
You have specified a language file which uses a code page incompatible with the current DOS/V system.
|
||||||
|
|
||||||
|
Are you sure to use the language file for this system type?
|
||||||
|
.
|
||||||
|
:LANG_CHANGE_CP
|
||||||
|
The specified language file uses code page %d. Do you want to change to this code page accordingly?.
|
||||||
|
.
|
||||||
|
@@ -4462,4 +4462,19 @@ DOSBox-X を終了してよろしいですか?
|
|||||||
:QUIT_PROGRAM_CONFIRM
|
:QUIT_PROGRAM_CONFIRM
|
||||||
プログラムまたはゲームを実行中です。
|
プログラムまたはゲームを実行中です。
|
||||||
終了してもよろしいですか?
|
終了してもよろしいですか?
|
||||||
|
.
|
||||||
|
:LANG_JP_INCOMPATIBLE
|
||||||
|
指定した言語ファイルは日本の PC-98、JEGA/AX システムに対応しておりません。
|
||||||
|
|
||||||
|
この言語ファイルを使用しますか?
|
||||||
|
.
|
||||||
|
:LANG_DOSV_INCOMPATIBLE
|
||||||
|
指定した言語ファイルは現在の DOS/V システムに対応しておりません。
|
||||||
|
|
||||||
|
この言語ファイルを使用しますか?
|
||||||
|
.
|
||||||
|
:LANG_CHANGE_CP
|
||||||
|
指定した言語ファイルはコードページ %d を使用します。
|
||||||
|
|
||||||
|
このコードページへ変更しますか?
|
||||||
.
|
.
|
@@ -251,6 +251,12 @@ void AddMessages() {
|
|||||||
MSG_Add("AUTO_CYCLE_MAX","Auto cycles [max]");
|
MSG_Add("AUTO_CYCLE_MAX","Auto cycles [max]");
|
||||||
MSG_Add("AUTO_CYCLE_AUTO","Auto cycles [auto]");
|
MSG_Add("AUTO_CYCLE_AUTO","Auto cycles [auto]");
|
||||||
MSG_Add("AUTO_CYCLE_OFF","Auto cycles [off]");
|
MSG_Add("AUTO_CYCLE_OFF","Auto cycles [off]");
|
||||||
|
MSG_Add("LANG_LOAD_ERROR", "Could not load language message file %s. The default language will be used.");
|
||||||
|
MSG_Add("LANG_JP_INCOMPATIBLE", "You have specified a language file which uses a code page incompatible with the Japanese PC-98 or JEGA/AX system.\n\n"
|
||||||
|
"Are you sure to use the language file for this machine type?");
|
||||||
|
MSG_Add("LANG_DOSV_INCOMPATIBLE", "You have specified a language file which uses a code page incompatible with the current DOS/V system.\n\n"
|
||||||
|
"Are you sure to use the language file for this system type?");
|
||||||
|
MSG_Add("LANG_CHANGE_CP", "The specified language file uses code page %d. Do you want to change to this code page accordingly?");
|
||||||
}
|
}
|
||||||
|
|
||||||
// True if specified codepage is a DBCS codepage
|
// True if specified codepage is a DBCS codepage
|
||||||
@@ -310,7 +316,7 @@ void LoadMessageFile(const char* fname) {
|
|||||||
FILE* mfile = testLoadLangFile(fname);
|
FILE* mfile = testLoadLangFile(fname);
|
||||||
|
|
||||||
if(!mfile) {
|
if(!mfile) {
|
||||||
std::string message = "Could not load language message file " + std::string(fname) + ". The default language will be used.";
|
std::string message = formatString(MSG_Get("LANG_LOAD_ERROR"), fname);
|
||||||
systemmessagebox("Warning", message.c_str(), "ok", "warning", 1);
|
systemmessagebox("Warning", message.c_str(), "ok", "warning", 1);
|
||||||
SetVal("dosbox", "language", "");
|
SetVal("dosbox", "language", "");
|
||||||
LOG_MSG("MSG:Cannot load language file: %s", fname);
|
LOG_MSG("MSG:Cannot load language file: %s", fname);
|
||||||
@@ -338,7 +344,10 @@ void LoadMessageFile(const char* fname) {
|
|||||||
linein.erase(std::remove(linein.begin(), linein.end(), '\r'), linein.end());
|
linein.erase(std::remove(linein.begin(), linein.end(), '\r'), linein.end());
|
||||||
linein.erase(std::remove(linein.begin(), linein.end(), '\n'), linein.end());
|
linein.erase(std::remove(linein.begin(), linein.end(), '\n'), linein.end());
|
||||||
|
|
||||||
if(linein.empty()) continue;
|
if(linein.empty()) {
|
||||||
|
string += "\n";
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
|
||||||
std::string trimmed = linein.substr(1);
|
std::string trimmed = linein.substr(1);
|
||||||
trim(trimmed);
|
trim(trimmed);
|
||||||
@@ -360,20 +369,20 @@ void LoadMessageFile(const char* fname) {
|
|||||||
}
|
}
|
||||||
else if(((IS_PC98_ARCH || IS_JEGA_ARCH) && c != 437 && c != 932 &&
|
else if(((IS_PC98_ARCH || IS_JEGA_ARCH) && c != 437 && c != 932 &&
|
||||||
!systemmessagebox("DOSBox-X language file",
|
!systemmessagebox("DOSBox-X language file",
|
||||||
"You have specified a language file which uses a code page incompatible with the Japanese PC-98 or JEGA/AX system.\n\nAre you sure to use the language file for this machine type?",
|
MSG_Get("LANG_JP_INCOMPATIBLE"),
|
||||||
"yesno", "question", 2)) ||
|
"yesno", "question", 2)) ||
|
||||||
(((IS_JDOSV && c != 932) || (IS_PDOSV && c != 936) ||
|
(((IS_JDOSV && c != 932) || (IS_PDOSV && c != 936) ||
|
||||||
(IS_KDOSV && c != 949) || (IS_TDOSV && c != 950 && c != 951)) &&
|
(IS_KDOSV && c != 949) || (IS_TDOSV && c != 950 && c != 951)) &&
|
||||||
c != 437 &&
|
c != 437 &&
|
||||||
!systemmessagebox("DOSBox-X language file",
|
!systemmessagebox("DOSBox-X language file",
|
||||||
"You have specified a language file which uses a code page incompatible with the current DOS/V system.\n\nAre you sure to use the language file for this system type?",
|
MSG_Get("LANG_DOSV_INCOMPATIBLE"),
|
||||||
"yesno", "question", 2))) {
|
"yesno", "question", 2))) {
|
||||||
fclose(mfile);
|
fclose(mfile);
|
||||||
dos.loaded_codepage = cp;
|
dos.loaded_codepage = cp;
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
std::string msg = "The specified language file uses code page " + std::to_string(c) + ". Do you want to change to this code page accordingly?";
|
std::string msg = formatString(MSG_Get("LANG_CHANGE_CP"), c);
|
||||||
if(c == dos.loaded_codepage) {
|
if(c == dos.loaded_codepage) {
|
||||||
msgcodepage = c;
|
msgcodepage = c;
|
||||||
lastmsgcp = msgcodepage;
|
lastmsgcp = msgcodepage;
|
||||||
|
Reference in New Issue
Block a user