wikimedia / stylelint-config-wikimedia

CSS/Less Stylelint configuration according to CSS coding conventions for Wikimedia.
https://www.mediawiki.org/wiki/Manual:Coding_conventions/CSS
MIT License
14 stars 9 forks source link

Disallow `text-transform: capitalize` #211

Closed jhsoby closed 1 year ago

jhsoby commented 1 year ago

This rule invariably leads to bad/incorrect results in many non-English languages. See rationale in linked issue.

This fixes #210

jhsoby commented 1 year ago

For anything that's translatable (including non-MediaWiki) using this is a bad idea. If it's not translatable, why would one need to transform text with CSS instead of just changing the text directly?

edg2s commented 1 year ago

For anything that's translatable (including non-MediaWiki) using this is a bad idea. If it's not translatable, why would one need to transform text with CSS instead of just changing the text directly?

Well that's an argument against the rule entirely. Clearly people in monolingual contexts do find a use for it, hence its existence. The question then becomes if the basic config-wikimedia is just stylistic, or opinionated about how you build software.

jhsoby commented 1 year ago

For anything that's translatable (including non-MediaWiki) using this is a bad idea. If it's not translatable, why would one need to transform text with CSS instead of just changing the text directly?

Well that's an argument against the rule entirely. Clearly people in monolingual contexts do find a use for it, hence its existence. The question then becomes if the basic config-wikimedia is just stylistic, or opinionated about how you build software.

Yes, I do think it's an unnecessary rule to begin with. :-) However, the point I'm trying to make is that for an ecosystem that is as multilingual as Wikimedia's, it's not just an unnecessary rule, but actually a harmful one, since it leads to correctly translated text appearing incorrectly. Whenever I see stuff like this in Norwegian, I automatically assume it was written by someone who doesn't have a grasp of even the basics of Norwegian spelling rules, and thus I immediately lose a lot of trust in that website/publication. And that's something we ought to avoid IMO.

Volker-E commented 1 year ago

I agree. In any multilingual context this rule seems possibly harmful. In a specific language context it could be still allowed via override, but you should inform yourself before doing so.

jdlrobson commented 1 year ago

I think forcing people to write a lint disable rule for this one is enough friction to ensure people inform themselves so I am in favor of us adding this rule. I think it makes sense in sites that do not support multiple languages but clearly that doesn't apply in Wikimedia sites.

jdforrester commented 1 year ago

Yeah, I think we should in general ban text-transform, not just text-transform: capitalize. It's not safe to apply to any general Wikimedia content.

jdlrobson commented 1 year ago

Yeah, I think we should in general ban text-transform, not just text-transform: capitalize. It's not safe to apply to any general Wikimedia content.

I'd rather we did this in a follow up issue as this is more debatable (e.g. usage for acronyms) and we have a LOT of these rules in our existing codebases.

I'd rather not delay something we know is very problematic for something which is more questionable.

jdforrester commented 1 year ago

Yeah, I think we should in general ban text-transform, not just text-transform: capitalize. It's not safe to apply to any general Wikimedia content.

I'd rather we did this in a follow up issue as this is more debatable (e.g. usage for acronyms) and we have a LOT of these rules in our existing codebases.

I'd rather not delay something we know is very problematic for something which is more questionable.

The bot auto-disables the rule every time it fails, so your claim that this would be work work seems odd?