From c73d745245eebb174bb3b48c3963dc56a323cd77 Mon Sep 17 00:00:00 2001 From: David Capello Date: Sat, 4 Apr 2020 17:33:23 -0300 Subject: [PATCH] Don't show warning for untranslated text that start with '!' on widgets --- data/widgets/options.xml | 8 ++++---- src/app/i18n/xml_translator.cpp | 4 +++- src/gen/check_strings.cpp | 3 ++- 3 files changed, 9 insertions(+), 6 deletions(-) diff --git a/data/widgets/options.xml b/data/widgets/options.xml index 1dbae829c..eea4d2f2d 100644 --- a/data/widgets/options.xml +++ b/data/widgets/options.xml @@ -418,10 +418,10 @@ pref="scripts.show_run_script_alert" /> diff --git a/src/app/i18n/xml_translator.cpp b/src/app/i18n/xml_translator.cpp index 487d26aa5..f724567fa 100644 --- a/src/app/i18n/xml_translator.cpp +++ b/src/app/i18n/xml_translator.cpp @@ -21,12 +21,14 @@ std::string XmlTranslator::operator()(const TiXmlElement* elem, const char* value = elem->Attribute(attrName); if (!value) return std::string(); - else if (value[0] == '@') { + else if (value[0] == '@') { // Translate string if (value[1] == '.') return Strings::instance()->translate((m_stringIdPrefix + (value+1)).c_str()); else return Strings::instance()->translate(value+1); } + else if (value[0] == '!') // Raw string + return std::string(value+1); else return std::string(value); } diff --git a/src/gen/check_strings.cpp b/src/gen/check_strings.cpp index 1dbd5dfd0..50d91dc99 100644 --- a/src/gen/check_strings.cpp +++ b/src/gen/check_strings.cpp @@ -210,7 +210,8 @@ public: } } } - else if (has_alpha_char(text) && + else if (text[0] != '!' && + has_alpha_char(text) && !is_email(text)) { std::cerr << elem->GetDocument()->Value() << ":" << elem->Row() << ":"