Skip to content

Commit

Permalink
update internationalization module
Browse files Browse the repository at this point in the history
add a crowdsourcing internationlization module for GeoDa
see https://github.com/GeoDaCenter/geoda/wiki/GeoDa-Internationalization-Project
  • Loading branch information
lixun910 committed May 14, 2019
1 parent caa29af commit 111237c
Show file tree
Hide file tree
Showing 22 changed files with 17,701 additions and 281 deletions.
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -102,3 +102,6 @@ BuildTools/macosx/temp1/boost_1_57_0/b2
BuildTools/temp/CLAPACK-3.1.1-VisualStudio/BLAS/blas.vcproj
*.sqlite-journal
osm/
internationalization/.vscode/launch.json
*.swo
internationalization/pofiles/new_zh_CN.mo
12 changes: 6 additions & 6 deletions DataViewer/TableBase.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,7 @@ void wxGridCellInt64Editor::BeginEdit(int row, int col, wxGrid* grid)
const wxString value = table->GetValue(row, col);
if ( !value.empty() ) {
if ( !value.ToLongLong(&m_value) ) {
wxFAIL_MSG( wxT("this cell doesn't have int64 value") );
wxFAIL_MSG("this cell doesn't have int64 value");
return;
}
DoBeginEdit(value);
Expand Down Expand Up @@ -229,7 +229,7 @@ wxString wxGridCellDoubleRenderer::GetString(const wxGrid& grid, int row, int co
sscanf(text.c_str(), "%Lf", &v);

wxString format;
format.Printf(wxT("%%%d.%dLf"), m_width, m_precision);
format.Printf("%%%d.%dLf", m_width, m_precision);
text.Printf(format, v);
LOG_MSG(text);
}
Expand Down Expand Up @@ -303,7 +303,7 @@ bool wxGridCellDoubleEditor::IsAcceptedKey(wxKeyEvent& event)
const wxString decimalPoint =
wxLocale::GetInfo(wxLOCALE_DECIMAL_POINT, wxLOCALE_CAT_NUMBER);
#else
const wxString decimalPoint(wxT('.'));
const wxString decimalPoint('.');
#endif
// accept digits, 'e' as in '1e+6', also '-', '+', and '.'
if ( wxIsdigit(keycode) ||
Expand All @@ -330,7 +330,7 @@ void wxGridCellDoubleEditor::BeginEdit(int row, int col, wxGrid* grid)
const wxString value = table->GetValue(row, col);
if ( !value.empty() ) {
if ( !value.ToDouble(&v) ) {
wxFAIL_MSG( wxT("this cell doesn't have float value") );
wxFAIL_MSG("this cell doesn't have float value");
return;
}
sscanf(value.c_str(), "%Lf", &m_value);
Expand Down Expand Up @@ -399,7 +399,7 @@ void wxGridCellDoubleEditor::StartingKey(wxKeyEvent& event)
bool is_decimal_point = ( strbuf ==
wxLocale::GetInfo(wxLOCALE_DECIMAL_POINT, wxLOCALE_CAT_NUMBER) );
#else
bool is_decimal_point = ( strbuf == wxT(".") );
bool is_decimal_point = ( strbuf == "." );
#endif

if ( wxIsdigit(keycode) || keycode == '+' || keycode == '-'
Expand All @@ -422,7 +422,7 @@ wxString wxGridCellDoubleEditor::GetValue() const
wxString wxGridCellDoubleEditor::GetString()
{
wxString format;
format.Printf(wxT("%%%d.%dLf"), m_width-m_precision-1, m_precision);
format.Printf("%%%d.%dLf", m_width-m_precision-1, m_precision);
wxString val = wxString::Format(format, m_value);
return val;
}
Expand Down
2 changes: 1 addition & 1 deletion DataViewer/TableBase.h
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@ class wxGridCellInt64Editor : public wxGridCellTextEditor
protected:
// string representation of our value
wxString GetString()
{ return wxString::Format(wxT("%lld"), m_value); }
{ return wxString::Format("%lld", m_value); }

private:
int m_width;
Expand Down
2 changes: 1 addition & 1 deletion internationalization/gen_po_from_xrc.py
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ def create_po(txtfiles):
o.flush()
o.close()

xrcfiles = ['../rc/menus.xrc', '../rc/dialogs.xrc', '../rc/data_viewer_dialogs.xrc', '../rc/panel.xrc', '../rc/toolbar.xrc']
xrcfiles = ['../rc/menus.xrc', '../rc/dialogs.xrc', '../rc/data_viewer_dialogs.xrc', '../rc/toolbar.xrc']

txtfiles = [process_xrc(xrcfile) for xrcfile in xrcfiles]
create_po(txtfiles)
Loading

0 comments on commit 111237c

Please sign in to comment.