Improved wording of "reserved words in G-code" error message.

This commit is contained in:
Vojtech Bubnik 2021-08-20 16:47:43 +02:00
parent 07186dac99
commit f9af9aa907

View File

@ -1747,14 +1747,14 @@ bool Tab::validate_custom_gcode(const wxString& title, const std::string& gcode)
std::vector<std::string> tags;
bool invalid = GCodeProcessor::contains_reserved_tags(gcode, 5, tags);
if (invalid) {
wxString reports = _L_PLURAL("The following line", "The following lines", tags.size());
reports += ":\n";
for (const std::string& keyword : tags) {
reports += ";" + keyword + "\n";
}
reports += _L("contain reserved keywords.") + "\n";
reports += _L("Please remove them, as they may cause problems in g-code visualization and printing time estimation.");
std::string lines = ":\n";
for (const std::string& keyword : tags)
lines += ";" + keyword + "\n";
wxString reports = format_wxstr(
_L_PLURAL("The following line %s contains reserved keywords.\nPlease remove it, as it may cause problems in G-code visualization and printing time estimation.",
"The following lines %s contain reserved keywords.\nPlease remove them, as they may cause problems in G-code visualization and printing time estimation.",
tags.size()),
lines);
//wxMessageDialog dialog(wxGetApp().mainframe, reports, _L("Found reserved keywords in") + " " + _(title), wxICON_WARNING | wxOK);
MessageDialog dialog(wxGetApp().mainframe, reports, _L("Found reserved keywords in") + " " + _(title), wxICON_WARNING | wxOK);
dialog.ShowModal();