Fixing wxString::Format encoding mismatches (part 2)

This commit is contained in:
Lukas Matena 2020-03-02 11:48:31 +01:00
parent 8b16b2c12e
commit bcd3842183
7 changed files with 39 additions and 39 deletions

View file

@ -172,7 +172,7 @@ void Field::get_value_by_opt_type(wxString& str, const bool check_value/* = true
if (label.Last() == '\n') label.RemoveLast();
while (label.Last() == ' ') label.RemoveLast();
if (label.Last() == ':') label.RemoveLast();
show_error(m_parent, wxString::Format(_(L("%s doesn't support percentage")), label));
show_error(m_parent, from_u8((boost::format(_utf8(L("%s doesn't support percentage"))) % label).str()));
set_value(double_to_string(m_opt.min), true);
m_value = double(m_opt.min);
break;
@ -237,12 +237,12 @@ void Field::get_value_by_opt_type(wxString& str, const bool check_value/* = true
const std::string sidetext = m_opt.sidetext.rfind("mm/s") != std::string::npos ? "mm/s" : "mm";
const wxString stVal = double_to_string(val, 2);
const wxString msg_text = wxString::Format(_(L("Do you mean %s%% instead of %s %s?\n"
const wxString msg_text = from_u8((boost::format(_utf8(L("Do you mean %s%% instead of %s %s?\n"
"Select YES if you want to change this value to %s%%, \n"
"or NO if you are sure that %s %s is a correct value.")), stVal, stVal, sidetext, stVal, stVal, sidetext);
"or NO if you are sure that %s %s is a correct value."))) % stVal % stVal % sidetext % stVal % stVal % sidetext).str());
wxMessageDialog dialog(m_parent, msg_text, _(L("Parameter validation")) + ": " + m_opt_id , wxICON_WARNING | wxYES | wxNO);
if (dialog.ShowModal() == wxID_YES) {
set_value(wxString::Format("%s%%", stVal), false/*true*/);
set_value(from_u8((boost::format("%s%%") % stVal).str()), false/*true*/);
str += "%%";
}
else