pontoon icon indicating copy to clipboard operation
pontoon copied to clipboard

Leading/following whitespace is stripped from translations, allowing entering duplicates

Open gregdan3 opened this issue 3 years ago • 1 comments

Circumstances

This was observed on the tok localization project for Mozilla Common Voice here.

Expected Behavior

Inputting a translation to Pontoon should compare the final string, with stripped leading and following whitespace, against existing translated strings and reject a duplicate.

Actual Behavior

It is possible to enter duplicate translations by inputting a string that contains leading or following whitespace.

Reproducing

  1. Enter a translation.
  2. Copy and paste the same translation into the suggestion box.
  3. Add whitespace to the beginning or end of the translation.
  4. Suggest the translation.

This will enter the same translation again, even though the translation is identical after stripping the spare whitespace.

gregdan3 avatar Feb 11 '22 15:02 gregdan3

Update: this only seems to apply when the input strings are multiline, such as if there are multiple substitution strings. I cannot replicate it for any particular string, only the case I gave.

gregdan3 avatar Feb 16 '22 00:02 gregdan3

This should no longer be possible, as Fluent translations are now normalised before storing or comparing them. The translations in the given example are about two years old, before the current behaviour was implemented.

eemeli avatar Jan 19 '24 08:01 eemeli