Closed Bug 1716551 Opened 3 years ago Closed 3 years ago

Fluent linter: improve detection of apostrophes and double quotes

Categories

(Core :: Internationalization: Localization, defect)

defect

Tracking

()

RESOLVED FIXED
91 Branch
Tracking Status
firefox91 --- fixed

People

(Reporter: flod, Assigned: flod)

Details

Attachments

(1 file)

Currently, the linter will throw with a string like this

this-message-has-html-quotes = This is a test <a href="{$url}">link</a>

The first textElement ends with a double quote, triggering TE04. Right now, the regex only searches for a single occurrence of ", we should look for ".+" instead (like we do for single quotes).

On the other hand, an apostrophe used as genitive at the end of a word like in functions' time won't be caught, because we look for `\w'\w'. I can't figure out how to solve this with a regex, but we can clean up the string before checking for this specific rule.

  • Don't throw when a placeable is enclosed in double straight quotes
  • Catch single quotes used as genitive on plural nouns
Pushed by flodolo@mozilla.com:
https://hg.mozilla.org/integration/autoland/rev/6fddf3227367
Improve Fluent linter behavior with single and double quotes, r=dminor
Status: NEW → RESOLVED
Closed: 3 years ago
Resolution: --- → FIXED
Target Milestone: --- → 91 Branch
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: