You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The nslocalizedstring_key rule requires static strings to be used as the key in calls to NSLocalizedString(...), but the comment field also has this same requirement. When a dynamic string is used, the exported strings/xliff files contain the comment, "No comment provided by engineer."
Since the rule implementation is likely very similar to the one for the existing nslocalizedstring_key rule, I believe it makes sense to extend this rule to include the comment check.
Non-triggering"
NSLocalizedString("key", comment: "my static comment")
New Issue Checklist
New rule request
The
nslocalizedstring_key
rule requires static strings to be used as the key in calls toNSLocalizedString(...)
, but thecomment
field also has this same requirement. When a dynamic string is used, the exported strings/xliff files contain the comment, "No comment provided by engineer."Since the rule implementation is likely very similar to the one for the existing
nslocalizedstring_key
rule, I believe it makes sense to extend this rule to include thecomment
check.Non-triggering"
NSLocalizedString("key", comment: "my static comment")
NSLocalizedString("key", comment: nil)
Triggering:
NSLocalizedString("key", comment: myVariable)
NSLocalizedString("key", comment: "interpolated \(param)")
The text was updated successfully, but these errors were encountered: