Closed Bug 1599056 Opened 5 years ago Closed 4 years ago

Check on new-lines for gettext-based content

Categories

(Webtools Graveyard :: Pontoon, enhancement, P3)

enhancement

Tracking

(Not tracked)

RESOLVED FIXED

People

(Reporter: theo, Assigned: mathjazz)

Details

Attachments

(1 file)

Not sure if we already have some gettext checks in place, but would it be possible to prevent adding new lines when the source string doesn’t end with one in the .pot file? And similarly, to force adding a new line if the source ends with one?

compilemessages throws a fatal msgfmt error if the source/translation are not matching new lines:

Execution of msgfmt failed: /app/donate/locale/pt_BR/LC_MESSAGES/django.po:165: 'msgid' and 'msgstr' entries do not both end with '\n'
msgfmt: found 1 fatal error
CommandError: compilemessages generated one or more errors.

This fixed the error above: https://github.com/mozilla/donate-wagtail/commit/586a6a098b144e92d638e9b9f223afaa47baf423

We already warn about newlines.

But I guess we should prevent overriding the check, like we do for .lang files?
https://github.com/mozilla/pontoon/blob/master/pontoon/checks/libraries/pontoon_db.py#L42-L47

Assignee: nobody → m
Priority: -- → P3

Or we hand-craft a check like we do for .lang. The caveat about the TT check is that it also enforces in-content differences in newlines, not only end-of-content ones. Which is what we need here, AFAICT.

Status: NEW → RESOLVED
Closed: 4 years ago
Resolution: --- → FIXED
Product: Webtools → Webtools Graveyard
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: