Skip to content

Commit

Permalink
hopefully fix kbd control translation issues
Browse files Browse the repository at this point in the history
Add missing gettext calls for the game controls code.

Seems to work correctly in the Russian locale with special keys.

Also add CLion files to `.gitignore`.

Signed-off-by: Rafael Kitover <rkitover@gmail.com>
  • Loading branch information
rkitover committed Jul 1, 2019
1 parent 90b3f35 commit 30b9272
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 4 deletions.
2 changes: 2 additions & 0 deletions .gitignore
Expand Up @@ -7,9 +7,11 @@ src/wx/wxvbam.xrs
build/*
build32/*
vsbuild/*
cmake-build*
dependencies/*
vcpkg/*
.vs/*
.idea
*.o
*.so
*.dll
Expand Down
8 changes: 4 additions & 4 deletions src/wx/widgets/keyedit.cpp
Expand Up @@ -124,8 +124,8 @@ wxString wxKeyTextCtrl::ToString(int mod, int key)

#endif

if (s.empty() || (key != wxT('-') && s[s.size() - 1] == wxT('-') && s != wxT("Num -"))
|| (key != wxT('+') && s[s.size() - 1] == wxT('+') && s != wxT("Num +")))
if (s.empty() || (key != wxT('-') && s[s.size() - 1] == wxT('-') && s != _("Num") + wxT(" -"))
|| (key != wxT('+') && s[s.size() - 1] == wxT('+') && s != _("Num") + wxT(" +")))
{
// bad key combo; probably also generates an assertion in wx
return wxEmptyString;
Expand All @@ -138,8 +138,8 @@ wxString wxKeyTextCtrl::ToString(int mod, int key)
int keys_el_size = sizeof(keys_with_display_names)/sizeof(keys_with_display_names[0]);

for (int i = 0; i < keys_el_size; i++) {
wxString name(keys_with_display_names[i].name);
wxString display_name(keys_with_display_names[i].display_name);
wxString name(_(keys_with_display_names[i].name));
wxString display_name(_(keys_with_display_names[i].display_name));
name.MakeUpper();
display_name.MakeUpper();

Expand Down

0 comments on commit 30b9272

Please sign in to comment.