Don't show warning for untranslated text that start with '!' on widgets

This commit is contained in:
David Capello 2020-04-04 17:33:23 -03:00
parent 9da4b76976
commit c73d745245
3 changed files with 9 additions and 6 deletions

View File

@ -418,10 +418,10 @@
pref="scripts.show_run_script_alert" /> pref="scripts.show_run_script_alert" />
<hbox> <hbox>
<label text="@.image_format_alerts" /> <label text="@.image_format_alerts" />
<check id="gif_options_alert" text="gif" pref="gif.show_alert" /> <check id="gif_options_alert" text="!gif" pref="gif.show_alert" />
<check id="jpeg_options_alert" text="jpeg" pref="jpeg.show_alert" /> <check id="jpeg_options_alert" text="!jpeg" pref="jpeg.show_alert" />
<check id="svg_options_alert" text="svg" pref="svg.show_alert" /> <check id="svg_options_alert" text="!svg" pref="svg.show_alert" />
<check id="tga_options_alert" text="tga" pref="tga.show_alert" /> <check id="tga_options_alert" text="!tga" pref="tga.show_alert" />
</hbox> </hbox>
<separator horizontal="true" /> <separator horizontal="true" />
<hbox> <hbox>

View File

@ -21,12 +21,14 @@ std::string XmlTranslator::operator()(const TiXmlElement* elem,
const char* value = elem->Attribute(attrName); const char* value = elem->Attribute(attrName);
if (!value) if (!value)
return std::string(); return std::string();
else if (value[0] == '@') { else if (value[0] == '@') { // Translate string
if (value[1] == '.') if (value[1] == '.')
return Strings::instance()->translate((m_stringIdPrefix + (value+1)).c_str()); return Strings::instance()->translate((m_stringIdPrefix + (value+1)).c_str());
else else
return Strings::instance()->translate(value+1); return Strings::instance()->translate(value+1);
} }
else if (value[0] == '!') // Raw string
return std::string(value+1);
else else
return std::string(value); return std::string(value);
} }

View File

@ -210,7 +210,8 @@ public:
} }
} }
} }
else if (has_alpha_char(text) && else if (text[0] != '!' &&
has_alpha_char(text) &&
!is_email(text)) { !is_email(text)) {
std::cerr << elem->GetDocument()->Value() << ":" std::cerr << elem->GetDocument()->Value() << ":"
<< elem->Row() << ":" << elem->Row() << ":"