-
Notifications
You must be signed in to change notification settings - Fork 165
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
新規インストール時に言語設定に英語を適用する処理方法の変更 #749
Changes from 1 commit
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -68,7 +68,6 @@ void CShareData_IO::SaveShareData() | |
|
||
@param[in] bRead true: 読み込み / false: 書き込み | ||
@return 設定データの読み込み/保存が成功したかどうか | ||
@note 読み込みの場合、言語設定切り替え後にMRUエントリが無い場合は新規インストール後とみなし false を返す事で初期設定を適用させる | ||
|
||
@date 2004-01-11 D.S.Koba CProfile変更によるコード簡略化 | ||
@date 2005-04-05 D.S.Koba 各セクションの入出力を関数として分離 | ||
|
@@ -96,6 +95,15 @@ bool CShareData_IO::ShareData_IO_2( bool bRead ) | |
if( bRead ){ | ||
if( !cProfile.ReadProfile( szIniFileName ) ){ | ||
/* 設定ファイルが存在しない */ | ||
LANGID langId = GetUserDefaultUILanguage(); | ||
// Windowsの表示言語が日本語でない場合は言語設定を英語にする | ||
if (langId != 0x0411) { | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 他言語DLLの対応状況からして、 つまり 英語(0x409)は以下のように指定します。 There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. その方が判定としては素直だとは思います。しかし現状言語として設定出来るのが日本語と英語だけなので、日本語使わない人には英語にしとこう、という考え方です。
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. それも考えましたが有る事が前提にしても良いのではないかと考えて記述しませんでした。 |
||
DLLSHAREDATA* pShareData = &GetDllShareData(); | ||
_tcscpy(pShareData->m_Common.m_sWindow.m_szLanguageDll, L"sakura_lang_en_US.dll"); | ||
cProfile.IOProfileData( L"Common", L"szLanguageDll", MakeStringBufferT( pShareData->m_Common.m_sWindow.m_szLanguageDll ) ); | ||
CSelectLang::ChangeLang( pShareData->m_Common.m_sWindow.m_szLanguageDll ); | ||
pcShare->RefreshString(); | ||
} | ||
return false; | ||
} | ||
|
||
|
@@ -126,14 +134,6 @@ bool CShareData_IO::ShareData_IO_2( bool bRead ) | |
cProfile.IOProfileData( L"Common", L"szLanguageDll", MakeStringBufferT( pShareData->m_Common.m_sWindow.m_szLanguageDll ) ); | ||
CSelectLang::ChangeLang( pShareData->m_Common.m_sWindow.m_szLanguageDll ); | ||
pcShare->RefreshString(); | ||
|
||
// 新規インストール後の設定ファイルは言語設定しか存在しない | ||
// MRUのエントリが無い場合は新規と判断 | ||
int _MRU_Counts = 0; | ||
if (!cProfile.IOProfileData( LTEXT("MRU"), LTEXT("_MRU_Counts"), _MRU_Counts )){ | ||
// 言語設定の切り替えだけして false を返す事で初期設定を適用させる | ||
return false; | ||
} | ||
} | ||
|
||
// Feb. 12, 2006 D.S.Koba | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
wLangId の値はWindows SDKのMAKELANGIDマクロを使って書くものと思っています。
MAKELANGID( LANG_JAPANESE, SUBLANG_JAPANESE_JAPAN )
ただし、このマクロが他で使われているのを見たことはほとんどないっす 😄
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
マジックナンバー埋め込むよりマクロ使うべきですね、指摘ありがとうございます。
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
3b0f5e0 で対処しました。