Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

No lang attribute #286

Closed
Heydon opened this issue Feb 19, 2017 · 17 comments
Closed

No lang attribute #286

Heydon opened this issue Feb 19, 2017 · 17 comments

Comments

@Heydon
Copy link

Heydon commented Feb 19, 2017

The <html> element in default.hbs should have a default language set on it. E.g.

<html lang="en">
@JohnONolan
Copy link
Member

No, it shouldn't.

@jkva
Copy link

jkva commented Feb 23, 2017

Yes, it should. Please see http://w3c.github.io/html/dom.html#lang-warning.

@isellsoap
Copy link

Yes, it should. Beyond reasons like SEO, accessibility and, well, common sense, this also enables things like correct CSS hyphenation.

@jkva
Copy link

jkva commented Feb 23, 2017

An even better writeup on this by Adrian Roselli: http://adrianroselli.com/2015/01/on-use-of-lang-attribute.html

@KittyGiraudel
Copy link

KittyGiraudel commented Feb 23, 2017

Ohai.

Alright, so here are a few things. I understand Casper is an open-source project, maintained on good will and everything, but when someone comes in with a suggestion to improve it, I’d argue replying constructively would be a Good Thing™.

Heydon is an accessibility expert, and I sincerely hope he has better things to do than coming here for nitpicking on some irrelevant details. And while he could have certainly spent more time explaining why the html element should have a lang attribute, I feel like you could have spent more time explaining why you think it should not.

I’ll say no more on the communication side of things here and move onto the actual topic of this ticket: the lang attribute on the html element. It should have a lang attribute. It’s part of the W3C specifications:

Incorrect or absent lang attributes can produce unexpected results in other circumstances, as they are also used to determine quotation marks for q elements, styling such as hyphenation, case conversion, line-breaking, and spell-checking in some editors, etc.

There is no inferred default value for this attribute. Not providing it can cause quite critical accessibility issues for screen-reader users as a lot of tools rely on it to define the used dictionary and voice. Other tools —some about accessibility, some not— also use this attribute for different purposes.

All that being said, could you please reconsider your position? :)

@hteumeuleu
Copy link

I am French. My computer is set up by default in french, and so is my screen reader. When I go to a web page that doesn't have a lang attribute, my screen reader will use its default setting and read the page with a french voice.

If you've never heard a robot speak english with a french accent, here's your chance.

A video of VoiceOver in french reading english text

Setting the lang attribute helps screen readers pick the right voice. Do it.

@gnclmorais
Copy link

@hteumeuleu, thank you for providing that video! 👌 Useful stuff.

@hteumeuleu
Copy link

To be totally fair, as someone pointed out on Twitter, adding the lang attribute wouldn't make a difference in my video example because VoiceOver on macOS doesn't (yet) acknowledge the attribute. But VoiceOver on iOS does. So here is another video example, this time with no lang attribute, and lang="en" added halfway in the video.

A video of VoiceOver on iOS in french reading english text

@JohnONolan
Copy link
Member

JohnONolan commented Feb 23, 2017

Wow, this has turned into a fun issue, hasn't it? Let's get this straightened out.

Hayden started tweeting last week about our mis-use of the role="presentation" attribute in Casper. Choosing that as your first point of communication is slightly lame and certainly doesn't endear you to any new community, but to his credit he did eventually open an issue, which I have already committed a fix for 68e48cf

He then went on to open multiple other issues criticising trivial things which have no bearing on anything - which I also closed - #287

and this one.

To be clear, and in direct response to @hugogiraudel

I feel like you could have spent more time explaining

The effort and time taken in my response was precisely proportional to the effort and time taken in the issue description. Open source 101: You are entitled to exactly as much detail and civility as you yourself bring to any conversation. If you show up and say nothing more than "x should be y" - with nothing whatsoever to back it up - then don't be surprised when your issue gets closed.

You are not automatically entitled to my time, nor anyone else's, just because you spent all of 5 seconds opening an issue.

So let's talk about the issue itself then.

It's a huge mistake to show up in a repository, ask no questions, and automatically assume that the people who have been maintaining a codebase for 4 years must be too dumb to have ever thought about this before or have any valid reason for their approach.

Casper is a default theme for a publishing platform which is used by hundreds of thousands of people in, at the last count, over 176 countries in the world. More than 50% of our users (which is to say: the majority) do not speak English as a first language.

So while not-setting a language attribute does cause minor accessibility issues for a minority of users, it is still preferable to actively setting a definitively wrong language attribute for literally the majority of users.

The correct way to solve this issue is with a {{lang}} helper in Ghost core to dynamically set HTML lang attribute on a per-site basis, which is part of larger i18n work that has been ongoing for a long time: TryGhost/Ghost#3801 - all of which is eminently available to be worked on.

While we're exchanging notes on open source etiquette, let me add a few of my own:

  1. If you don't put any effort into an issue, expect the same in return
  2. Don't assume maintainers are morons. This attitude of "uh, I think you'll find I know best" backfires the majority of the time
  3. For the love of christ, get over your ego and stop with the Twitter lynch mob behaviour. It's so poisonous. As if getting a bunch of your friends to all go and shout really loud is going to make you more right.

The world doesn't owe you anything, no matter how many entitlement-laden tweets you bash out. If you don't like Casper, or Ghost, or me, that's fine - it's open source so you can modify the code for your use-case.

Nobody is forcing you to be here, nor is there requirement for us to agree with each other. And if that's the case, then this keyboard war is really quite pointless — so if it's all the same to you, I'll get back to work, which is what I was doing before a demonstrably pointless mountain was made out of this already tenuous mole-hill.

@jkva
Copy link

jkva commented Feb 23, 2017

Thank you for the detailed explanation behind the earlier "no, it shouldn't".
Context is important. If you'd have instead said "Yes, we are aware of this and are working on it in a more robust way, see #3801", you'd have not gotten a slew of replies by well-meaning people trying to tell you what you already know.

@ryan-codingintrigue
Copy link

@JohnONolan Appreciate the detailed response, well articulated.

The correct way to solve this issue is with a {{lang}} helper in Ghost core to dynamically set HTML lang attribute on a per-site basis, which is part of larger i18n work that has been ongoing for a long time: TryGhost/Ghost#3801 - all of which is eminently available to be worked on.

Not saying anyone was owed it as such, but adding this to the original reply probably would have saved a lot of argument on both sides. Or at least led the topic to a more fact-based discussion.

@KittyGiraudel
Copy link

KittyGiraudel commented Feb 23, 2017

It's a huge mistake to show up in a repository, ask no questions, and automatically assume that the people who have been maintaining a codebase for 4 years must be too dumb to have ever thought about this before or have any valid reason for their approach.

Precisely why I feel like you should have taken more time to explain why you thought it should not be part of Casper. Again, that’s super fine to disagree with the feature request, but saying “No” is not helpful in anyway. You have the knowledge of the project, just use it for God’s sake.

“Yes, but defaulting to English is not ideal because half our user based is not English.” Here, there is a polite and informative way to reply to this issue. Was it really that hard to come up with that in the first place? That would have certainly saved you this whole thread, that’s for sure.

Anyway, thanks for clarifying why the issue is not as straight-forward as anyone initially thought anyway. Cheers.

Edit: linking #289 here so the conversation and reasons behind the declined PR are visible.

@Heydon
Copy link
Author

Heydon commented Feb 23, 2017

@JohnONolan

It's a huge mistake to show up in a repository, ask no questions, and automatically assume that the people who have been maintaining a codebase for 4 years must be too dumb to have ever thought about this before or have any valid reason for their approach.

I took the time to write an issue, albeit without providing an explanation. The reason I didn't is because I did not assume you were 'dumb'. You can't have it both ways. You didn't take the time to explain it wasn't applicable, so I asked users to provide context, because I thought you might need it after all. They took the time to provide it.

I'm not sure how this can be characterized as "lynch-mobbing". I'm sorry if the original mention on Twitter (about role="presentation") was galling; I didn't intend to denigrate — just to point out a common error that anyone can make, so that some followers would know to avoid it. I immediately (not eventually) filed the issue.

In any case, I appreciate the longer explanation you provided. I'm glad Ghost is taking the language issue into consideration.

As a side note on the continued discussion of etiquette, terms like "dumb" and "lame" are ableist. You might be in danger of putting off people who have cognitive or physical disabilities from engaging with Ghost.

@aardrian
Copy link

Quick note to point out that issue TryGhost/Ghost#3801 has been open since August 2014 with no activity since October 2016, and the last effort to change the lang attribute was shot down in 2015 (TryGhost/Ghost#160) because it triggered existing CSS for hyphenation.

To John's point, it is available to be worked on, but nobody is doing it.

Just wanted to close the loop on that is all.

@jdalton
Copy link

jdalton commented Feb 24, 2017

@JohnONolan
Copy link
Member

@aardrian To be clear: TryGhost/Ghost#160 is not an issue from 2015, nor is it anything at all to do with lang attributes. I assume you were trying to refer to TryGhost/Ghost#3890 - which is a copy of this issue where the exact same answer was given. Nothing was shot down.

To John's point, it is available to be worked on, but nobody is doing it.

This part is 100% true, which is because people such as the participants of this thread like to shout really loud on Twitter, but are rather averse to writing any actual code.

So to properly close the loop, let me just point out that when I linked to the issue where this can be fixed properly, your response was to make fun of it rather than to do anything to solve it. Which is fitting, because that behaviour is the exact reason that this issue has been open for 3 years.

If everyone who saw a long-running issue wrote 140 chars of code instead of 140 chars of snark, then we would already have a fully functioning, dynamic lang attribute.

I left this open for a while because I thought it was fair to give everyone a chance to respond, but I 100% agree with @jdalton -- the time has come.

@TryGhost TryGhost locked and limited conversation to collaborators Feb 24, 2017
@JohnONolan
Copy link
Member

Site language support added in https://github.com/TryGhost/Ghost/releases/tag/1.20.0
HTML lang attribute added in #429
Announcement - https://dev.ghost.org/theme-translations/
Documentation - https://themes.ghost.org/docs/i18n

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

10 participants