hopefully fix kbd control translation issues

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>
This commit is contained in:
Rafael Kitover 2019-07-01 07:53:23 +00:00
parent 90b3f35408
commit 30b9272412
No known key found for this signature in database
GPG Key ID: 08AB596679D86240
2 changed files with 6 additions and 4 deletions

2
.gitignore vendored
View File

@ -7,9 +7,11 @@ src/wx/wxvbam.xrs
build/* build/*
build32/* build32/*
vsbuild/* vsbuild/*
cmake-build*
dependencies/* dependencies/*
vcpkg/* vcpkg/*
.vs/* .vs/*
.idea
*.o *.o
*.so *.so
*.dll *.dll

View File

@ -124,8 +124,8 @@ wxString wxKeyTextCtrl::ToString(int mod, int key)
#endif #endif
if (s.empty() || (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 != wxT("Num +"))) || (key != wxT('+') && s[s.size() - 1] == wxT('+') && s != _("Num") + wxT(" +")))
{ {
// bad key combo; probably also generates an assertion in wx // bad key combo; probably also generates an assertion in wx
return wxEmptyString; return wxEmptyString;
@ -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]); int keys_el_size = sizeof(keys_with_display_names)/sizeof(keys_with_display_names[0]);
for (int i = 0; i < keys_el_size; i++) { for (int i = 0; i < keys_el_size; i++) {
wxString name(keys_with_display_names[i].name); wxString name(_(keys_with_display_names[i].name));
wxString display_name(keys_with_display_names[i].display_name); wxString display_name(_(keys_with_display_names[i].display_name));
name.MakeUpper(); name.MakeUpper();
display_name.MakeUpper(); display_name.MakeUpper();