Closed Bug 1812011 Opened 3 years ago Closed 3 years ago

Fluent linter: warn when a string has placeables but no comments

Categories

(Core :: Internationalization: Localization, enhancement)

enhancement

Tracking

()

RESOLVED FIXED
111 Branch
Tracking Status
firefox111 --- fixed

People

(Reporter: flod, Assigned: flod)

References

Details

Attachments

(2 files)

Strings with placeables (e.g. { $somevar }) should have comments explaining what replaces the variables (comment can be either a group-level comment or individual comment).

The linter should warn when that's not the case.

A basic approach would be to just check for comments associated to the string, a more refined one to check for each placeable in the comment. The former is probably not as effective, as there might be even a file-level comment with no information.

Assignee: nobody → francesco.lodolo
Status: NEW → ASSIGNED
Pushed by flodolo@mozilla.com: https://hg.mozilla.org/integration/autoland/rev/3de1dd005c43 Add check for missing variable comments, r=gregtatum,eemeli https://hg.mozilla.org/integration/autoland/rev/4a016b402eff Fix missing variable comments and consistency, r=fluent-reviewers,Gijs
Status: ASSIGNED → RESOLVED
Closed: 3 years ago
Resolution: --- → FIXED
Target Milestone: --- → 111 Branch

@rob
Heads up, I assume this will impact Thunderbird (I haven't looked at the FTL files though).

This expects any Fluent string with a variable to have a comment referencing the variable. Ideally, it should be in the form of

# Variables:
#   $somevar (type) - Description

So far, type has been something in: string, number, boolean, date.

Flags: needinfo?(rob)
See Also: → 1812553
Depends on: 1812568

Thanks Martin!

Flags: needinfo?(rob)
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: