diff --git a/.gitignore b/.gitignore index 626bae32..c6967444 100644 --- a/.gitignore +++ b/.gitignore @@ -1,6 +1,6 @@ build/ dist/ -config.json +/config.json memo.txt VRCT.spec *.pyc @@ -8,4 +8,4 @@ logs/ .venv/ weight/ .vscode -error.log \ No newline at end of file +error.log diff --git a/installer/config/English/config.json b/installer/config/English/config.json new file mode 100644 index 00000000..ba9bd8de --- /dev/null +++ b/installer/config/English/config.json @@ -0,0 +1,3 @@ +{ + "UI_LANGUAGE": "en" +} \ No newline at end of file diff --git a/installer/config/Japanese/config.json b/installer/config/Japanese/config.json new file mode 100644 index 00000000..d670ee58 --- /dev/null +++ b/installer/config/Japanese/config.json @@ -0,0 +1,3 @@ +{ + "UI_LANGUAGE": "ja" +} \ No newline at end of file diff --git a/installer/config/Korean/config.json b/installer/config/Korean/config.json new file mode 100644 index 00000000..619536dc --- /dev/null +++ b/installer/config/Korean/config.json @@ -0,0 +1,3 @@ +{ + "UI_LANGUAGE": "ko" +} \ No newline at end of file diff --git a/installer/installer.nsi b/installer/installer.nsi index f02335ee..53084928 100644 --- a/installer/installer.nsi +++ b/installer/installer.nsi @@ -61,12 +61,15 @@ Var Dialog_Options Var InstallDocs Var InstallShortcut Var Label_DescriptionOptions +Var Label_DescriptionComboBox +Var ComboBox_Language ; 初期化時コールバック Function .onInit ; オプション値を初期化します。 StrCpy $InstallDocs ${BST_CHECKED} StrCpy $InstallShortcut ${BST_CHECKED} + StrCpy $ComboBox_Language "Japanese" FunctionEnd ; オプション ページ @@ -92,6 +95,18 @@ Function OptionPage ${NSD_CreateCheckbox} 0 26u 100% 12u "デスクトップにショートカットを作成(&D)" Pop $Checkbox_InstallShortcut + ; ComboBoxを作成します。 + ${NSD_CreateLabel} 0 42u 100% 12u "UIの言語を設定してください。" + ; ラベルを変数に代入します。 + Pop $Label_DescriptionComboBox + + ${NSD_CreateComboBox} 0 55u 100% 12u "" + Pop $ComboBox_Language + + ${NSD_CB_AddString} $ComboBox_Language "English" + ${NSD_CB_AddString} $ComboBox_Language "日本語" + ${NSD_CB_AddString} $ComboBox_Language "한국어" + ${If} $InstallDocs == ${BST_CHECKED} ; チェックが入力済の場合、チェックボックスにチェックを入れます。 ${NSD_Check} $Checkbox_InstallDocs @@ -100,6 +115,7 @@ Function OptionPage ; チェックが入力済の場合、チェックボックスにチェックを入れます。 ${NSD_Check} $Checkbox_InstallShortcut ${EndIf} + ${NSD_CB_SelectString} $ComboBox_Language "English" nsDialogs::Show FunctionEnd @@ -107,6 +123,7 @@ FunctionEnd Function OptionPageLeave ${NSD_GetState} $Checkbox_InstallDocs $InstallDocs ${NSD_GetState} $Checkbox_InstallShortcut $InstallShortcut + ${NSD_GetText} $ComboBox_Language $ComboBox_Language FunctionEnd ; デフォルト セクション @@ -150,6 +167,18 @@ Section CreateShortCut "$DESKTOP\VRCT.lnk" "$INSTDIR\VRCT.exe" ${EndIf} + ; ComboBoxの選択値から言語を判定しinstaller\config\***\config.jsonを$INSTDIRにコピー + ${If} $ComboBox_Language == "English" + SetOutPath "$INSTDIR" + File "..\installer\config\English\config.json" + ${ElseIf} $ComboBox_Language == "日本語" + SetOutPath "$INSTDIR" + File "..\installer\config\Japanese\config.json" + ${ElseIf} $ComboBox_Language == "한국어" + SetOutPath "$INSTDIR" + File "..\installer\config\Korean\config.json" + ${EndIf} + ; スタート メニューにショートカットを登録 CreateDirectory "$SMPROGRAMS\VRCT" SetOutPath "$INSTDIR"