en-US Spelling Conventions

(Bripmccann) #1

As I’ve gone through the introductory HTML lessons, I’ve noticed a few non-American spelling conventions. I’ve also learned about the lang attribute and seen <html lang=“en-US”> at the top of every page. Are these pages meant to conform to US spelling conventions? And if not, why not leave it at <html lang=“en”>?

(Bripmccann) #2

[As an aside, since this is MDN: The <html> tags on these pages contain other attributes. Is there a good way to indicate that I’ve made omissions here? Using an ellipsis (as in <html lang=“en-US”…>) doesn’t seem right.]

(Chris Mills) #3

Hi there,

The non-US spelling conventions are my fault, being an English native. I get it right most of the time :wink: If you spot any, feel free to fix them, or let us know so we can fix them.

You can write <html lang=“en”> rather than <html lang=“en-US”> (or <html lang=“en-GB”>, <html lang=“en-CA”>, etc.). This would just mean “English in general”, rather than a specific subdialect. But it is just an example, so it doesn’t necessarily need to make sense in terms of the page it appears on. It is usually better to give as much information as possible. You’ll see that on MDN pages, the language provided in the article URLs is en-US, which is usually to indicate that the pages should be written in US English.

When you say “indicate that I’ve made omissions”, I’m not 100% sure what you mean. Do you mean when writing your own web pages, or writing examples in tutorials, etc.?

It is not really an omission to not include all the attributes an element can have on it — in most cases it will still be valid HTML, although it might not do very much. For example, an <a> element will not do anything without an href attribute.

(Eric Shepherd) #4

All content on MDN is supposed to adhere to American English norms. We don’t crack skulls when there are deviations although we do try to fix them when we happen upon them during other work.

You can find the complete MDN writing style guide here: https://developer.mozilla.org/en-US/docs/MDN/Contribute/Guidelines/Writing_style_guide


(Bripmccann) #5

@sheppy, I should have known to check for something like that. Thanks!

@chrismills You’ve provided me with a free learning resource, so I’m not really concerned with assigning fault over a few spelling errors. Thank you. :slight_smile: I feel like an American chauvinist for treating them like “errors” though, so I wanted to ask about it.

Re my question about tagging: I meant that I’d viewed the sources of MDN pages and found lang=“en-US” in their <html> tags, along with other attributes which I didn’t include in my post. I wrote <html lang=“en-US”>, with the closing > directly after lang=“en-US”, which isn’t literally what’s in the page source, and I was wondering if there was a simple way to indicate that. (I imagine there probably isn’t, but I’m trying to learn best practices.)

(Chris Mills) #6

No, really, it’s fine; I didn’t take it like that at all. As an English writer who’s worked for US companies for years, I have a weird mutant sense of grammar/spelling. @sheppy finds it to be a constant source of amusement/confusion :wink: I’m just glad you’ve found it useful.

Yeah, not really. I’ve written down what I’ve learned as best practices in the course, but you’ll find all sorts of weird and wonderful uses of HTML as you go around the web looking at different page sources. Some of it is dynamically generated by server-side code, some is just plain bad, some is weird. A key consideration is that HTML is permissive, meaning that it won’t break and fall over if you include a couple of small errors. The browser will look at what you’ve written and work out how best to display it so that you still get the best rendered output possible.

(Eric Shepherd) #7

Not “confusion” exactly. Just “bemusement.” To be honest, I totally empathize with the non-US writers who have to cope with this issue. It’s hard to break the muscle memory of writing words the way you’re used to. Even as a native writer of US English, I have to struggle to avoid using regional idioms when I write, since I know these can make translation more difficult.

Most of my amusement comes from thinking about the little differences between en-US and en-GB. Mostly, I look at them and am grateful to Noah Webster for his simplifications and rationalization of spellings of words. :slight_smile: