Skip to content
Permalink
Browse files

Allow "Browse" to be translated.

wxWidgets fails to translate some internal strings due to locale issues.

It is not clear how the current locale is detected, but it fails for
cases when the system is different from the set by the user. Eg: the
system is using `en_US`, but the user sets `LANG=pt_BR.utf8` for an
application. Some internal strings are translated because of `LANG`,
while others remain the same because `en_US`.
  • Loading branch information
denisfa authored and rkitover committed Sep 6, 2019
1 parent d8c981f commit 528c37f9e01007806bb12d60c063a054928f0ae6
Showing with 13 additions and 0 deletions.
  1. +13 −0 src/wx/guiinit.cpp
@@ -2716,6 +2716,12 @@ void MainFrame::BindAppIcon() {
SetIcon(icon);
}

static void setCustomLabelForFilePicker(wxDirPickerCtrl* dp)
{
wxButton *pButt = static_cast<wxButton*>(dp->GetPickerCtrl());
if (pButt) pButt->SetLabel(_("Browse"));
}

// If there is a menubar, store all special menuitems
#define XRCITEM_I(id) menubar->FindItem(id, NULL)
#define XRCITEM_D(s) XRCITEM_I(XRCID_D(s))
@@ -3731,12 +3737,19 @@ bool MainFrame::BindControls()
d = LoadXRCDialog("DirectoriesConfig");
{
getdp("GBARoms", gopts.gba_rom_dir);
setCustomLabelForFilePicker(dp);
getdp("GBRoms", gopts.gb_rom_dir);
setCustomLabelForFilePicker(dp);
getdp("GBCRoms", gopts.gbc_rom_dir);
setCustomLabelForFilePicker(dp);
getdp("BatSaves", gopts.battery_dir);
setCustomLabelForFilePicker(dp);
getdp("StateSaves", gopts.state_dir);
setCustomLabelForFilePicker(dp);
getdp("Screenshots", gopts.scrshot_dir);
setCustomLabelForFilePicker(dp);
getdp("Recordings", gopts.recording_dir);
setCustomLabelForFilePicker(dp);
d->Fit();
}
wxDialog* joyDialog = LoadXRCropertySheetDialog("JoypadConfig");

0 comments on commit 528c37f

Please sign in to comment.
You can’t perform that action at this time.