dotnet / roslyn-analyzers

MIT License
1.6k stars 468 forks source link

Feature request for CA1717: Make configurable the culture of the rule #2823

Open artberri opened 5 years ago

artberri commented 5 years ago

Analyzer package

Microsoft.CodeQuality.Analyzers

Package Version

Unreleased code in master

Diagnostic ID

CA1717

Repro steps

Recently (https://github.com/dotnet/roslyn-analyzers/pull/2809), the CA1717 rule has been modified to avoid checking for plurals conditionally based on the region settings of the the user's computer, while talking about it, this feature request come to our minds.

It happens that this check is done using only the English language, so, if your code base is written in other language this check will not be useful for you.

Feature request

Notes

This analyzer depends on Humanizer for detecting single/plural words. Humanizer supports multiple language packages. Right now the CA1717 rule is using only the English version but is supposed that we could add more to check other languages also.

Evangelink commented 5 years ago

It doesn't seem that complex to implement but I am wondering whether this is a good direction. I am not an expert of the topic but I think that lately there seems to be more of a consensus toward avoiding translations of developer oriented "elements" (I think there were some discussion about translations of exception messages...).

Just my 2cts

Evangelink commented 4 years ago

Any opinion here @mavasani

mavasani commented 4 years ago

Lets wait for more feedback here.