Skip to content
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

change: Language setting is now depend on OS setting at default. #3

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions BJD/option/OptionBasic.cs
Original file line number Diff line number Diff line change
Expand Up @@ -38,8 +38,8 @@ private OnePage Page1(string name, string title, Kernel kernel){
onePage.Add(new OneVal("serverName", "", Crlf.Nextline, new CtrlTextBox(IsJp() ? "サーバ名" : "Server Name", 20)));
onePage.Add(new OneVal("editBrowse", false, Crlf.Nextline,
new CtrlCheckBox(IsJp() ? "フォルダ・ファイル選択を編集にする" : "can edit browse control")));
onePage.Add(new OneVal("lang", 0, Crlf.Nextline,
new CtrlComboBox(IsJp() ? "言語" : "Language", new []{"Japanese", "English"}, 80)));
onePage.Add(new OneVal("lang", 2, Crlf.Nextline,
new CtrlComboBox(IsJp() ? "言語" : "Language", new []{"Japanese", "English", "Auto"}, 80)));
return onePage;
}

Expand Down
16 changes: 12 additions & 4 deletions BJD/util/IniDb.cs
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
using System.Collections.Generic;
using System.IO;
using System.Text;
using System.Threading;
using Bjd.ctrl;
using Bjd.option;

Expand Down Expand Up @@ -235,13 +236,20 @@ public void Save(String nameTag, ListVal listVal){
// 設定ファイルから"lang"の値を読み出す
public bool IsJp(){
var listVal = new ListVal{
new OneVal("lang", 0, Crlf.Nextline,
new CtrlComboBox("Language", new[]{"Japanese", "English"}, 80))
new OneVal("lang", 2, Crlf.Nextline,
new CtrlComboBox("Language", new[]{"Japanese", "English", "Auto"}, 80))
};
Read("Basic", listVal);
var oneVal = listVal.Search("lang");
return ((int) oneVal.Value == 0);

var bjdLangId = (int)oneVal.Value;
if (bjdLangId == 2/*Auto*/)
{
return (Thread.CurrentThread.CurrentUICulture.Name == "ja-JP");
}
else
{
return (bjdLangId == 0);
}
}
}
}
Expand Down