Closed Bug 1349330 Opened 3 years ago Closed 3 years ago

Prevent translations exceeding maximum length to be submitted

Categories

(Webtools :: Pontoon, enhancement, P2)

enhancement

Tracking

(Not tracked)

RESOLVED FIXED

People

(Reporter: mathjazz, Unassigned)

Details

The .lang file format uses a meta tag to specify a maximum length of the string:
https://github.com/mozilla-l10n/langchecker/wiki/.lang-files-format

We should acknowledge that and prevent users from submitting strings that are too long.

One possible UX for such strings would be to show a Twitter-like countdown instead of the standard "current-translation-length/original-string-length".

We should also remove the MAX_LENGTH tag from the string comment.
Priority: P3 → P2
Commit pushed to master at https://github.com/mozilla/pontoon

https://github.com/mozilla/pontoon/commit/1d005e43a9df0802778918f22611cc74cde98834
Fix bug 1349330: Prevent too long translation submissions (#607)

* Use string comments in .lang files to determine translation length limit
* If length limited, show character countdown
* If limit exceeded, prevent translation from being submitted
* Strip HTML tags when calculating string length
* Some code cleanups
Status: NEW → RESOLVED
Closed: 3 years ago
Resolution: --- → FIXED
You need to log in before you can comment on or make changes to this bug.