Skip to content

Commit

Permalink
XLIFF: Fix bogus error if translation omits markup
Browse files Browse the repository at this point in the history
Don't show bogus markup error if translation of a translation with XLIFF
markup doesn't contain any (possibly yet).
  • Loading branch information
vslavik committed Sep 24, 2019
1 parent 87dd506 commit 70c2079
Showing 1 changed file with 10 additions and 1 deletion.
11 changes: 10 additions & 1 deletion src/catalog_xliff.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,16 @@ bool set_node_text(xml_node node, const std::string& text, bool isPlainText)
{
remove_all_children(node);
auto result = node.append_buffer(text.c_str(), text.size(), parse_default, encoding_utf8);
return result.status == status_ok;
switch (result.status)
{
case status_no_document_element:
node.text() = s.c_str();
return true;
case status_ok:
return true;
default:
return false;
}
}
}

Expand Down

0 comments on commit 70c2079

Please sign in to comment.