Skip to content

Commit

Permalink
add menu option for French language
Browse files Browse the repository at this point in the history
  • Loading branch information
lixun910 committed Jun 26, 2023
1 parent d6783d3 commit 0ff5d47
Show file tree
Hide file tree
Showing 8 changed files with 62 additions and 13 deletions.
4 changes: 4 additions & 0 deletions BuildTools/macosx/install_name.py
Original file line number Diff line number Diff line change
Expand Up @@ -31,12 +31,16 @@ def ProcessDependency(dir_path, dylib_name):
copyitem = '/usr/local/opt/icu4c/lib/libicuuc.71.dylib'
if item == '@loader_path/libicuuc.72.dylib':
copyitem = '/usr/local/opt/icu4c/lib/libicuuc.72.dylib'
if item == '@loader_path/libicuuc.73.dylib':
copyitem = '/usr/local/opt/icu4c/lib/libicuuc.73.dylib'
if item == '@loader_path/libicudata.70.dylib':
copyitem = '/usr/local/opt/icu4c/lib/libicudata.70.dylib'
if item == '@loader_path/libicudata.71.dylib':
copyitem = '/usr/local/opt/icu4c/lib/libicudata.71.dylib'
if item == '@loader_path/libicudata.72.dylib':
copyitem = '/usr/local/opt/icu4c/lib/libicudata.72.dylib'
if item == '@loader_path/libicudata.73.dylib':
copyitem = '/usr/local/opt/icu4c/lib/libicudata.73.dylib'
if item == '@loader_path/libbrotlicommon.1.dylib':
copyitem = '/usr/local/opt/brotli/lib/libbrotlicommon.1.dylib'
if item == '@rpath/libIlmThread-3_1.30.dylib':
Expand Down
6 changes: 6 additions & 0 deletions BuildTools/windows/installer/32bit/GeoDa-win7+.iss
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ Name: "en"; MessagesFile: "compiler:Default.isl"
Name: "spanish"; MessagesFile: "compiler:Languages\Spanish.isl"
Name: "russian"; MessagesFile: "compiler:Languages\Russian.isl"
Name: "portuguese"; MessagesFile: "compiler:Languages\Portuguese.isl"
Name: "french"; MessagesFile: "compiler:Languages\French.isl"

[dirs]
Name: "{app}"; Check: InitializeSetup
Expand Down Expand Up @@ -202,6 +203,10 @@ begin
begin
langCode := '153'; // Portuguese
end;
5:
begin
langCode := '79'; // French
end;
end;
end;
Expand All @@ -228,6 +233,7 @@ begin
ComboBox.Items.Add('Spanish');
ComboBox.Items.Add('Russian');
ComboBox.Items.Add('Portuguese');
ComboBox.Items.Add('French');
ComboBox.ItemIndex := 0;
ComboBox.OnChange := @ComboBoxChange;
langCode := '58';
Expand Down
6 changes: 6 additions & 0 deletions BuildTools/windows/installer/32bit/GeoDa.iss
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ Name: "en"; MessagesFile: "compiler:Default.isl"
Name: "spanish"; MessagesFile: "compiler:Languages\Spanish.isl"
Name: "russian"; MessagesFile: "compiler:Languages\Russian.isl"
Name: "portuguese"; MessagesFile: "compiler:Languages\Portuguese.isl"
Name: "french"; MessagesFile: "compiler:Languages\French.isl"

[dirs]
Name: "{app}"; Permissions: everyone-full; Check: InitializeSetup
Expand Down Expand Up @@ -201,6 +202,10 @@ begin
begin
langCode := '153'; // Portuguese
end;
5:
begin
langCode := '79'; // French
end;
end;
end;
Expand All @@ -227,6 +232,7 @@ begin
ComboBox.Items.Add('Spanish');
ComboBox.Items.Add('Russian');
ComboBox.Items.Add('Portuguese');
ComboBox.Items.Add('French');
ComboBox.ItemIndex := 0;
ComboBox.OnChange := @ComboBoxChange;
langCode := '58';
Expand Down
7 changes: 7 additions & 0 deletions BuildTools/windows/installer/64bit/GeoDa-win7+.iss
Original file line number Diff line number Diff line change
Expand Up @@ -36,9 +36,11 @@ ShowLanguageDialog=yes

[Languages]
Name: "english"; MessagesFile: "compiler:Default.isl"
Name: "french"; MessagesFile: "compiler:Languages\French.isl"
Name: "spanish"; MessagesFile: "compiler:Languages\Spanish.isl"
Name: "russian"; MessagesFile: "compiler:Languages\Russian.isl"
Name: "portuguese"; MessagesFile: "compiler:Languages\Portuguese.isl"
Name: "french"; MessagesFile: "compiler:Languages\French.isl"

[dirs]
Name: "{app}"; Check: InitializeSetup
Expand Down Expand Up @@ -215,6 +217,10 @@ begin
begin
langCode := '153'; // Portuguese
end;
5:
begin
langCode := '79'; // French
end;
end;
end;
Expand All @@ -241,6 +247,7 @@ begin
ComboBox.Items.Add('Spanish');
ComboBox.Items.Add('Russian');
ComboBox.Items.Add('Portuguese');
ComboBox.Items.Add('French');
ComboBox.ItemIndex := 0;
ComboBox.OnChange := @ComboBoxChange;
langCode := '58';
Expand Down
6 changes: 6 additions & 0 deletions BuildTools/windows/installer/64bit/GeoDa.iss
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@ Name: "english"; MessagesFile: "compiler:Default.isl"
Name: "spanish"; MessagesFile: "compiler:Languages\Spanish.isl"
Name: "russian"; MessagesFile: "compiler:Languages\Russian.isl"
Name: "portuguese"; MessagesFile: "compiler:Languages\Portuguese.isl"
Name: "french"; MessagesFile: "compiler:Languages\French.isl"

[dirs]
Name: "{app}"; Permissions: everyone-full; Check: InitializeSetup
Expand Down Expand Up @@ -214,6 +215,10 @@ begin
begin
langCode := '153'; // Portuguese
end;
5:
begin
langCode := '79'; // French
end;
end;
end;
Expand All @@ -240,6 +245,7 @@ begin
ComboBox.Items.Add('Spanish');
ComboBox.Items.Add('Russian');
ComboBox.Items.Add('Portuguese');
ComboBox.Items.Add('French');
ComboBox.ItemIndex := 0;
ComboBox.OnChange := @ComboBoxChange;
langCode := '58';
Expand Down
31 changes: 18 additions & 13 deletions DialogTools/PreferenceDlg.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -270,12 +270,14 @@ void PreferenceDlg::Init()
wxStaticText* lbl_txt113 = new wxStaticText(vis_page, wxID_ANY, lbl113);
cmb113 = new wxComboBox(vis_page, wxID_ANY, "", pos, wxDefaultSize, 0,
NULL, wxCB_READONLY);
cmb113->Append("");
cmb113->Append("English");
cmb113->Append("Chinese (Simplified)");
cmb113->Append("Spanish");
cmb113->Append("Russian");
cmb113->Append("Portuguese");
cmb113->Append(wxEmptyString);
cmb113->Append(GdaConst::gda_lang_chinese);
cmb113->Append(GdaConst::gda_lang_english);
cmb113->Append(GdaConst::gda_lang_french);
cmb113->Append(GdaConst::gda_lang_portuguese);
cmb113->Append(GdaConst::gda_lang_russian);
cmb113->Append(GdaConst::gda_lang_spanish);

cmb113->Bind(wxEVT_COMBOBOX, &PreferenceDlg::OnChooseLanguage, this);
//cmb113->Disable();

Expand Down Expand Up @@ -940,17 +942,20 @@ void PreferenceDlg::OnChooseLanguage(wxCommandEvent& ev)
wxConfigBase * config = new wxFileConfig("GeoDa", wxEmptyString, configPath);

if (lan_sel > 0) {
wxString sel_lan_name = cmb113->GetString(lan_sel);
long language = wxLANGUAGE_UNKNOWN;
if (lan_sel == 1) {
if (sel_lan_name == GdaConst::gda_lang_english) {
language = wxLANGUAGE_ENGLISH + 1;
} else if (lan_sel == 2) {
} else if (sel_lan_name == GdaConst::gda_lang_chinese) {
language = 45;//wxLANGUAGE_CHINESE + 1;
} else if (lan_sel == 3) {
} else if (sel_lan_name == GdaConst::gda_lang_spanish) {
language = 179;//wxLANGUAGE_SPANISH;
} else if (lan_sel == 4) {
language = wxLANGUAGE_RUSSIAN;
} else if (lan_sel == 5) {
language = wxLANGUAGE_PORTUGUESE;
} else if (sel_lan_name == GdaConst::gda_lang_russian) {
language = wxLANGUAGE_RUSSIAN; // 159
} else if (sel_lan_name == GdaConst::gda_lang_portuguese) {
language = wxLANGUAGE_PORTUGUESE; // 153
} else if (sel_lan_name == GdaConst::gda_lang_french) {
language = wxLANGUAGE_FRENCH; // 79
}
config->DeleteEntry("Translation");
config->SetPath("Translation");
Expand Down
7 changes: 7 additions & 0 deletions GdaConst.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -428,6 +428,13 @@ const wxString GdaConst::gda_lbl_2sigma = "> 2Std";
const wxPen* GdaConst::default_myshape_pen=0;
const wxBrush* GdaConst::default_myshape_brush=0;

const wxString GdaConst::gda_lang_english = "English";
const wxString GdaConst::gda_lang_chinese = "Chinese (Simplified)";
const wxString GdaConst::gda_lang_french = "French";
const wxString GdaConst::gda_lang_portuguese = "Portuguese";
const wxString GdaConst::gda_lang_russian = "Russian";
const wxString GdaConst::gda_lang_spanish = "Spanish";

//background color -- this is light gray
const wxColour GdaConst::backColor(192, 192, 192);
// background color -- this is light gray
Expand Down
8 changes: 8 additions & 0 deletions GdaConst.h
Original file line number Diff line number Diff line change
Expand Up @@ -240,6 +240,14 @@ class GdaConst {
static const wxString gda_lbl_1sigma_2sigma;
static const wxString gda_lbl_2sigma;

// Languages
static const wxString gda_lang_english;
static const wxString gda_lang_chinese;
static const wxString gda_lang_french;
static const wxString gda_lang_portuguese;
static const wxString gda_lang_russian;
static const wxString gda_lang_spanish;

// Preferences
static double gda_autoweight_stop;
static bool gda_draw_map_labels;
Expand Down

0 comments on commit 0ff5d47

Please sign in to comment.