diff options
author | Daiki Ueno <ueno@gnu.org> | 2014-06-02 18:04:41 +0900 |
---|---|---|
committer | Daiki Ueno <ueno@gnu.org> | 2014-06-02 19:27:37 +0900 |
commit | 317449061ac9b2ed2a24fa51de1bc75278ae8497 (patch) | |
tree | a3c4a0b9a274c0362798b6ea2bd68a3dfc1aab62 /gettext-tools/src | |
parent | 2899ed4475842a39b93a295628d6c2936074c777 (diff) | |
download | external_gettext-317449061ac9b2ed2a24fa51de1bc75278ae8497.zip external_gettext-317449061ac9b2ed2a24fa51de1bc75278ae8497.tar.gz external_gettext-317449061ac9b2ed2a24fa51de1bc75278ae8497.tar.bz2 |
msgl-check: Treat missing header errors as warnings
Problem reported by Richard Hughes at
<https://lists.fedoraproject.org/pipermail/devel/2014-June/199539.html>.
After <https://savannah.gnu.org/bugs/?40262>, "msgfmt -c" reports
error on missing PO headers. However, it turned out to be too strict
for the projects using Launchpad Translations. Let's relax the check
for the moment and wait for one or two release cycles.
* gettext-tools/src/msgl-check.c (check_header_entry): Report missing
required headers as warning, instead of error.
Diffstat (limited to 'gettext-tools/src')
-rw-r--r-- | gettext-tools/src/ChangeLog | 12 | ||||
-rw-r--r-- | gettext-tools/src/msgl-check.c | 16 |
2 files changed, 26 insertions, 2 deletions
diff --git a/gettext-tools/src/ChangeLog b/gettext-tools/src/ChangeLog index c8948f3..b82ca69 100644 --- a/gettext-tools/src/ChangeLog +++ b/gettext-tools/src/ChangeLog @@ -1,5 +1,17 @@ 2014-06-02 Daiki Ueno <ueno@gnu.org> + msgl-check: Treat missing header errors as warnings + Problem reported by Richard Hughes at + <https://lists.fedoraproject.org/pipermail/devel/2014-June/199539.html>. + After <https://savannah.gnu.org/bugs/?40262>, "msgfmt -c" reports + error on missing PO headers. However, it turned out to be too strict + for the projects using Launchpad Translations. Let's relax the check + for the moment and wait for one or two release cycles. + * msgl-check.c (check_header_entry): Report missing + required headers as warning, instead of error. + +2014-06-02 Daiki Ueno <ueno@gnu.org> + * gettext 0.19 released. 2014-05-31 Daiki Ueno <ueno@gnu.org> diff --git a/gettext-tools/src/msgl-check.c b/gettext-tools/src/msgl-check.c index ee68ae4..64a68f6 100644 --- a/gettext-tools/src/msgl-check.c +++ b/gettext-tools/src/msgl-check.c @@ -777,8 +777,18 @@ check_header_entry (const message_ty *mp, const char *msgstr_string) for (cnt = 0; cnt < nfields; ++cnt) { + /* 0.19 change: It would better report error if a required + header field is missing. However, traditionally we didn't + treat it as error. Let's wait for one or two cycles until we + can assume the required header fields are always + available in practical PO files. */ +#if 0 int severity = (cnt < nrequiredfields ? PO_SEVERITY_ERROR : PO_SEVERITY_WARNING); +#else + int severity = + PO_SEVERITY_WARNING; +#endif const char *field = required_fields[cnt]; size_t len = strlen (field); const char *line; @@ -805,7 +815,8 @@ check_header_entry (const message_ty *mp, const char *msgstr_string) field); po_xerror (severity, mp, NULL, 0, 0, true, msg); free (msg); - seen_errors++; + if (severity == PO_SEVERITY_ERROR) + seen_errors++; } } break; @@ -821,7 +832,8 @@ check_header_entry (const message_ty *mp, const char *msgstr_string) field); po_xerror (severity, mp, NULL, 0, 0, true, msg); free (msg); - seen_errors++; + if (severity == PO_SEVERITY_ERROR) + seen_errors++; } } return seen_errors; |