・言語切り替え時にカルチャを起動時のものに戻すことにした。これによって、Windowsが勝手に出すダイアログの文字化けがなくなる。

・自分で出すMessageBoxの言語選択を日本語が選択されているかどうかでなく、デフォルトのカルチャが日本かどうかで判定することにした。これによってMessageBoxの文字化けがなくなる。

git-svn-id: file:///Users/lillianskinner/Downloads/platinum/twl/TwlToolsRED@421 7061adef-622a-194b-ae81-725974e89856
This commit is contained in:
nishikawa_takeshi 2009-10-28 02:53:42 +00:00
parent 33379d1c69
commit feb96dcca1
7 changed files with 14 additions and 2 deletions

View File

@ -69,6 +69,9 @@ namespace MasterEditorTWL {
// ミドルウェア名称リスト
RCMiddlewareNameList ^hMiddlewareNameList;
// デフォルト(起動時)のロケール名
System::String ^hDefaultCultureName;
/////////////////////////////////////////////
// VC自動追加フィールド
/////////////////////////////////////////////
@ -4927,7 +4930,8 @@ private: System::Windows::Forms::RadioButton^ rPurposeZone;
System::String^ makeMsg( System::String ^tag, ... cli::array<System::String^> ^args )
{
System::String ^lang;
if( this->isJapanese() )
//if( this->isJapanese() )
if( this->hDefaultCultureName && this->hDefaultCultureName->StartsWith("ja") ) // 日本版Windowsのみ日本語メッセージにする
{
lang = "J";
}

View File

@ -27,6 +27,10 @@ using namespace MasterEditorTWL;
// ----------------------------------------------
void Form1::construct(void)
{
// 言語切り替えで一時的にカルチャを変更するのでデフォルトのカルチャを取得して戻せるようにしておく
// これを取得しておかないとエラーメッセージを出せないので一番最初に取得しておく
this->hDefaultCultureName = System::Threading::Thread::CurrentThread->CurrentUICulture->Name;
// フィールド初期化
this->hSrl = gcnew RCSrl( this->getMrcMessageFileJ(), this->getMrcMessageFileE() );
this->hDeliv = gcnew RCDeliverable;
@ -87,7 +91,7 @@ void Form1::construct(void)
this->tboxGuideErrorInfo->Text = this->tboxGuideErrorInfo->Text->Replace( "<newline>", "\r\n" );
// システムの言語バージョンにあわせて言語切り替え
if( System::Threading::Thread::CurrentThread->CurrentUICulture->Name->StartsWith( "ja" ) )
if( this->hDefaultCultureName->StartsWith( "ja" ) )
{
this->stripItemJapanese->Checked = true;
this->stripItemEnglish->Checked = false;

View File

@ -108,6 +108,7 @@ void MasterEditorTWL::Form1::changeLanguage( System::String ^langname )
{
//int index;
// リソース切り替えのために一時的にカルチャを切り替え
System::Threading::Thread::CurrentThread->CurrentUICulture = gcnew System::Globalization::CultureInfo(langname,true);
System::ComponentModel::ComponentResourceManager^ resources = (gcnew System::ComponentModel::ComponentResourceManager(Form1::typeid));
@ -538,6 +539,9 @@ void MasterEditorTWL::Form1::changeLanguage( System::String ^langname )
{
this->Text += " [ Supported App: " + appstr + "User ]";
}
// カルチャを戻す
System::Threading::Thread::CurrentThread->CurrentUICulture = gcnew System::Globalization::CultureInfo(this->hDefaultCultureName,true);
}
// end of file