its: Do escape handling during msgfmt merge, not during xgettext. Off by default.
Reported by Samy Mahmoudi <samy.mahmoudi@gmail.com>
at <https://savannah.gnu.org/bugs/?58643>.
* gettext-tools/src/its.c (its_localization_note_rule_constructor): Don't do
escaping while extracting a localization note.
(its_rule_list_extract_text): New local variable do_escape_during_extract. Don't
do escaping while extracting.
(starts_with_character_reference, _its_encode_special_chars_for_merge): New
functions.
(its_merge_context_merge_node): New local variables do_escape_during_extract,
do_escape_during_merge. Don't do escaping while extracting. Conditionally do
escaping while merging.
* gettext-tools/src/its-extensions.xsd: Mention that escape="no" is now the
default.
* gettext-tools/its/glade1.its: Add a comment.
* gettext-tools/its/glade2.its: Likewise.
* gettext-tools/its/gsettings.its: Likewise.
* gettext-tools/its/gtkbuilder.its: Likewise.
* gettext-tools/its/metainfo.its: Add a <gt:escapeRule>.
* gettext-tools/tests/xgettext-appdata-1: Add comment.
* gettext-tools/tests/xgettext-appdata-2: New file, based on
gettext-tools/tests/msgfmt-xml-1.
* gettext-tools/tests/Makefile.am (TESTS): Add it.
* gettext-tools/tests/xgettext-its-1: Update expected results.
* gettext-tools/tests/msgfmt-xml-1: Test also character references and entity
references.
* gettext-tools/tests/msgfmt-xml-2: Likewise.
* gettext-tools/doc/gettext.texi (ITS Rules): Under "Escape Special Characters",
explain that it is no longer necessary to write a rule with escape="no".
Rewrite section "Two Use-cases of Translated Strings in XML".
* NEWS: Mention the changes.