Localization improvements and fixes (#956)

This commit is contained in:
Francesco Saltori 2023-09-08 02:09:03 +02:00 committed by GitHub
parent 4d1864c8a1
commit c16e258c93
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
34 changed files with 229 additions and 356 deletions

View file

@ -638,7 +638,7 @@ void MainWindow::OnFileMenu(wxCommandEvent& event)
const auto menuId = event.GetId();
if (menuId == MAINFRAME_MENU_ID_FILE_LOAD)
{
const auto wildcard = wxStringFormat2(
const auto wildcard = formatWxString(
"{}|*.wud;*.wux;*.wua;*.iso;*.rpx;*.elf"
"|{}|*.wud;*.wux;*.iso"
"|{}|*.wua"
@ -648,7 +648,7 @@ void MainWindow::OnFileMenu(wxCommandEvent& event)
_("Wii U image (*.wud, *.wux, *.iso, *.wad)"),
_("Wii U archive (*.wua)"),
_("Wii U executable (*.rpx, *.elf)"),
_("All files (*.*)")
_("All files (*.*)")
);
wxFileDialog openFileDialog(this, _("Open file to launch"), wxEmptyString, wxEmptyString, wildcard, wxFD_OPEN | wxFD_FILE_MUST_EXIST);
@ -706,7 +706,7 @@ void MainWindow::OnInstallUpdate(wxCommandEvent& event)
{
if (!fs::exists(dirPath.parent_path() / "code") || !fs::exists(dirPath.parent_path() / "content") || !fs::exists(dirPath.parent_path() / "meta"))
{
wxMessageBox(wxStringFormat2(_("The (parent) folder of the title you selected is missing at least one of the required subfolders (\"code\", \"content\" and \"meta\")\nMake sure that the files are complete."), dirPath.filename().string()));
wxMessageBox(formatWxString(_("The (parent) folder of the title you selected is missing at least one of the required subfolders (\"code\", \"content\" and \"meta\")\nMake sure that the files are complete."), dirPath.filename().string()));
continue;
}
else
@ -1837,7 +1837,7 @@ public:
void AddHeaderInfo(wxWindow* parent, wxSizer* sizer)
{
auto versionString = fmt::format(fmt::runtime(_("Cemu\nVersion {0}\nCompiled on {1}\nOriginal authors: {2}").ToStdString()), BUILD_VERSION_STRING, BUILD_DATE, "Exzap, Petergov");
auto versionString = formatWxString(_("Cemu\nVersion {0}\nCompiled on {1}\nOriginal authors: {2}"), BUILD_VERSION_STRING, BUILD_DATE, "Exzap, Petergov");
sizer->Add(new wxStaticText(parent, wxID_ANY, versionString), wxSizerFlags().Border(wxALL, 3).Border(wxTOP, 10));
sizer->Add(new wxHyperlinkCtrl(parent, -1, "https://cemu.info", "https://cemu.info"), wxSizerFlags().Expand().Border(wxTOP | wxBOTTOM, 3));
@ -2287,57 +2287,6 @@ void MainWindow::RecreateMenu()
SetMenuVisible(false);
}
void MainWindow::OnAfterCallShowErrorDialog()
{
//wxMessageBox((const wxString&)dialogText, (const wxString&)dialogTitle, wxICON_INFORMATION);
//wxDialog* dialog = new wxDialog(NULL,wxID_ANY,(const wxString&)dialogTitle,wxDefaultPosition,wxSize(310,170));
//dialog->ShowModal();
//dialogState = 1;
}
bool MainWindow::EnableOnlineMode() const
{
// TODO: not used anymore
//
// if enabling online mode, check if all requirements are met
std::wstring additionalErrorInfo;
const sint32 onlineReqError = iosuCrypt_checkRequirementsForOnlineMode(additionalErrorInfo);
bool enableOnline = false;
if (onlineReqError == IOS_CRYPTO_ONLINE_REQ_OTP_MISSING)
{
wxMessageBox(_("otp.bin could not be found"), _("Error"), wxICON_ERROR);
}
else if (onlineReqError == IOS_CRYPTO_ONLINE_REQ_OTP_CORRUPTED)
{
wxMessageBox(_("otp.bin is corrupted or has invalid size"), _("Error"), wxICON_ERROR);
}
else if (onlineReqError == IOS_CRYPTO_ONLINE_REQ_SEEPROM_MISSING)
{
wxMessageBox(_("seeprom.bin could not be found"), _("Error"), wxICON_ERROR);
}
else if (onlineReqError == IOS_CRYPTO_ONLINE_REQ_SEEPROM_CORRUPTED)
{
wxMessageBox(_("seeprom.bin is corrupted or has invalid size"), _("Error"), wxICON_ERROR);
}
else if (onlineReqError == IOS_CRYPTO_ONLINE_REQ_MISSING_FILE)
{
std::wstring errorMessage = fmt::format(L"Unable to load a necessary file:\n{}", additionalErrorInfo);
wxMessageBox(errorMessage.c_str(), _("Error"), wxICON_ERROR);
}
else if (onlineReqError == IOS_CRYPTO_ONLINE_REQ_OK)
{
enableOnline = true;
}
else
{
wxMessageBox(_("Unknown error occured"), _("Error"), wxICON_ERROR);
}
//config_get()->enableOnlineMode = enableOnline;
return enableOnline;
}
void MainWindow::RestoreSettingsAfterGameExited()
{
RecreateMenu();