Skip to content

Commit

Permalink
正規表現コンパイルエラー時の日本語エラーメッセージ追加 (#1935)
Browse files Browse the repository at this point in the history
* 正規表現コンパイルエラー時のエラーメッセージ追加

* 英訳の追加
  • Loading branch information
tats-u committed Sep 16, 2023
1 parent 1e920c7 commit d083650
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 2 deletions.
3 changes: 2 additions & 1 deletion sakura_core/String_define.h
Original file line number Diff line number Diff line change
Expand Up @@ -1326,5 +1326,6 @@
#define STR_FILEDIALOG_MRU 35040
#define STR_FILEDIALOG_OPENFOLDER 35041
#define STR_GSTR_APPNAME 35047
#define STR_REGEX_COMPILE_ERR_PREAMBLE 35048

// Now using max number 35047 by STR_GSTR_APPNAME
// Now using max number 35048 by STR_REGEX_COMPILE_ERR_PREAMBLE
4 changes: 3 additions & 1 deletion sakura_core/extmodule/CBregexp.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -675,7 +675,9 @@ bool CheckRegexpSyntax(
}
if( !cRegexp.Compile( szPattern, NULL, nOption, bKakomi ) ){ // 2002/2/1 hor追加
if( bShowMessage ){
::MessageBox( hWnd, cRegexp.GetLastMessage(),
std::wstring message(LS(STR_REGEX_COMPILE_ERR_PREAMBLE));
message += cRegexp.GetLastMessage();
::MessageBox( hWnd, message.c_str(),
LS(STR_BREGONIG_TITLE), MB_OK | MB_ICONEXCLAMATION );
}
return false;
Expand Down
1 change: 1 addition & 0 deletions sakura_core/sakura_rc.rc
Original file line number Diff line number Diff line change
Expand Up @@ -3161,6 +3161,7 @@ BEGIN
STR_DLGFNCLST_UNIFY "現在の画面のドッキング配置情報をすべての共通設定・タイプ別設定にコピーして統一します。\n(現在開いている他画面の状態も統一します。)\n"
STR_BREGONIG_ERROR "bregonig.dll のロードで予期せぬエラーが発生しました。"
STR_BREGONIG_TITLE "正規表現エラー"
STR_REGEX_COMPILE_ERR_PREAMBLE "正規表現の構文に誤りがあります。\n詳細:"
STR_ERR_CWSH09 "マクロの実行を中断しました。"
STR_ERR_DLGMACRO03_1 "入力改行コードが指定されていません."
STR_ERR_DLGMACRO16 "数値を指定してください."
Expand Down
1 change: 1 addition & 0 deletions sakura_lang_en_US/sakura_lang_rc.rc
Original file line number Diff line number Diff line change
Expand Up @@ -3199,6 +3199,7 @@ BEGIN
STR_DLGFNCLST_UNIFY "現在の画面のドッキング配置情報をすべての共通設定・タイプ別設定にコピーして統一します。\n(現在開いている他画面の状態も統一します。)\n"
STR_BREGONIG_ERROR "Failed to load bregonig.dll."
STR_BREGONIG_TITLE "Regular Expression Error"
STR_REGEX_COMPILE_ERR_PREAMBLE "The given regular expression is incorrect.\nDetails: "
STR_ERR_CWSH09 "Aborted execute macro."
STR_ERR_DLGMACRO03_1 "Line Break Code is not defined."
STR_ERR_DLGMACRO16 "Number is not defined."
Expand Down

0 comments on commit d083650

Please sign in to comment.