Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(#6614): fix translation of FromUTF8 strings #6615

Merged
merged 1 commit into from
Mar 27, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/attachmentdialog.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ mmAttachmentDialog::mmAttachmentDialog (wxWindow* parent, const wxString& RefTyp
if (AttachmentsFolder == wxEmptyString)
{
wxString msgStr = wxString() << _("Attachment folder not defined.") << "\n"
<< wxString::FromUTF8(_("Please set it in Tools → Options → Attachments").ToStdString()) << "\n";
<< wxGetTranslation(wxString::FromUTF8(wxTRANSLATE("Please set it in Tools → Options → Attachments"))) << "\n";
wxMessageBox(msgStr, _("Attachment folder not defined"), wxICON_ERROR);
}
else if (!wxDirExists(AttachmentsFolder))
Expand Down
2 changes: 1 addition & 1 deletion src/categdialog.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -472,7 +472,7 @@ void mmCategDialog::showCategDialogDeleteError(bool category)
deleteCategoryErrMsg << "\n\n" << _("Tip: Change all transactions using this Subcategory to\n"
"another Category using the merge command:");

deleteCategoryErrMsg << "\n\n" << wxString::FromUTF8(_("Tools → Merge → Categories").ToStdString());
deleteCategoryErrMsg << "\n\n" << wxGetTranslation(wxString::FromUTF8(wxTRANSLATE("Tools → Merge → Categories")));

wxMessageBox(deleteCategoryErrMsg, _("Category Manager: Delete Error"), wxOK | wxICON_ERROR);
}
Expand Down
2 changes: 1 addition & 1 deletion src/dbupgrade.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -118,7 +118,7 @@ bool dbUpgrade::UpgradeDB(wxSQLite3Database * db, const wxString& DbFileName)
}

wxMessageBox(wxString::Format(_("MMEX database succesfully upgraded to version %i"), ver) + "\n\n"
+ wxString::FromUTF8(_("We suggest a database optimization under Tools → Database → Optimize").ToStdString())
+ wxGetTranslation(wxString::FromUTF8(wxTRANSLATE("We suggest a database optimization under Tools → Database → Optimize")))
, _("MMEX database upgrade"), wxOK | wxICON_INFORMATION);

return true;
Expand Down
7 changes: 3 additions & 4 deletions src/mmcheckingpanel.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -677,10 +677,9 @@ void mmCheckingPanel::showTips()
{
if (Option::instance().getShowMoneyTips())
m_info_panel->SetLabelText(
wxString::FromUTF8(
wxGetTranslation(
TIPS[rand() % (sizeof(TIPS) / sizeof(wxString))]
).ToStdString()
wxGetTranslation(wxString::FromUTF8(
TIPS[rand() % (sizeof(TIPS) / sizeof(wxString))]
.ToStdString())
)
);
else
Expand Down
6 changes: 3 additions & 3 deletions src/mmframe.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2154,7 +2154,7 @@ bool mmGUIFrame::createDataStore(const wxString& fileName, const wxString& pwd,
}

wxButton* next = static_cast<wxButton*>(wizard->FindWindow(wxID_FORWARD)); //FIXME:
if (next) next->SetLabel(wxString::FromUTF8(_("&Next →").ToStdString()));
if (next) next->SetLabel(wxGetTranslation(wxString::FromUTF8(wxTRANSLATE("&Next →"))));

SetDataBaseParameters(fileName);
/* Jump to new account creation screen */
Expand Down Expand Up @@ -2658,14 +2658,14 @@ void mmGUIFrame::OnNewAccount(wxCommandEvent& /*event*/)

if (account->ACCOUNTTYPE == Model_Account::all_type()[Model_Account::SHARES])
{
wxMessageBox(wxString::FromUTF8(_(
wxMessageBox(wxGetTranslation(wxString::FromUTF8(wxTRANSLATE(
"Share Accounts hold Share transactions\n\n"
"Share transactions are created within the Stock Portfolio View\n"
"after the selection of the Company Stock within the associated view.\n\n"
"These accounts only become visible after associating a Stock to the Share Account\n"
"Or by using the Menu View → 'Display Share Accounts'\n"
"Share Accounts can also hold normal transactions to regular account."
).ToStdString()), _("Share Account Creation"));
))), _("Share Account Creation"));
}

RefreshNavigationTree();
Expand Down
2 changes: 1 addition & 1 deletion src/payeedialog.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -742,7 +742,7 @@ void mmPayeeDialog::DeletePayee()
<< "\n\n"
<< _("Tip: Change all transactions using this Payee to another Payee"
" using the merge command:")
<< "\n\n" << wxString::FromUTF8(_("Tools → Merge → Payees").ToStdString());
<< "\n\n" << wxGetTranslation(wxString::FromUTF8(wxTRANSLATE("Tools → Merge → Payees")));
wxMessageBox(deletePayeeErrMsg, _("Payee Manager: Delete Error"), wxOK | wxICON_ERROR);
continue;
}
Expand Down
2 changes: 1 addition & 1 deletion src/reports/bugreport.h
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ wxString mmBugReport::getHTMLText()
wxURI req = mmex::weblink::BugReport + "/new?body=" + info + "\n<hr>" + diag;

const wxString texts[] = {
wxString::FromUTF8(_("Use Help → Check for Updates in MMEX to get latest version, where your problem might be already fixed.").ToStdString()),
wxGetTranslation(wxString::FromUTF8(wxTRANSLATE("Use Help → Check for Updates in MMEX to get latest version, where your problem might be already fixed."))),
wxString::Format(_("Search <a href='%s'>a list of known issues</a> for similar problem. If so, update existing issue instead of creating a new one.")
, do_href_wrap(mmex::weblink::BugReport)),
wxString::Format(_("As you know, <a href='%s'>a forum</a> for users is available where you can discuss problems and find solutions.") , do_href_wrap(mmex::weblink::Forum)),
Expand Down