More from The Changelog
As with my last post on AI, let me open with a statement: Just because most people hold AI a certain way, doesn’t mean that we always must, either now or in the future. As I noted in that piece, and my shades of gray post, I am well aware — and agree with — … Continue reading Must we always use LLMs this way? →
1981 was a different time for computing. It was expensive (both hardware and software), and it was far from a given that machines from one vendor would be able to talk to those from another. In fact, Columbia University had just such a problem, so in 1981, Frank da Cruz and Bill Catchings designed a … Continue reading Celebrating 45 Years of Kermit with the First New C-Kermit Release in 15 Years (and working with a decades-old C codebase) →
AI sure is a hot topic right now, and I see a lot of people arguing about it. To a lot of people around here, I’m the “computer person” they know and I get asked a lot about AI. I’m going to suggest a lot of things can be true at once. For instance: LLMs … Continue reading Artificial Intelligence: Shades of Gray →
I just made up a Debian trixie setup that has no need for a GUI. In fact, I rarely use the text console either. However, because the machine is dual boot and also serves another purpose, it’s connected to my main monitor and KVM switch. The monitor has three inputs, and when whatever display it’s … Continue reading Screen Power Saving in the Linux Console →
Like many, bot traffic has been causing significant issues for my hosted server recently. I’ve been noticing a dramatic increase in bots that do not respect robots.txt, especially the crawl-delay I have set there. Not only that, but many of them are sending user-agent strings that are quite precisely matching what desktop browsers send. That … Continue reading A Twisty Maze of Ill-Behaved Bots →
More in programming
The US is updating its primary spatial reference system, replacing NAD 83 with NATRF 2022 and other systems.
The new “corner-shape” CSS property is incredibly useful, but if we really want to get the most out of it, we need to use some surprisingly-sophisticated tricks. In this post, I’ll share how I’ve used this new property to create a retro-sci-fi aesthetic with diagonal corners everywhere. 📐
by Terence Eden Here's a fun little historic mystery for HTML nerds. Most websites report the language they're written in using the lang attribute. <html lang="en-GB"> But on the <meta> element, it's common to see: <meta content="en_GB" property="og:locale"> Why does that use an underscore rather than a hyphen? What is a language anyway? Here's how the lang attribute works: 3.2.6.2 The lang and xml:lang attributes OK, so what is a valid BCP 47 language tag? Language tags permit only the characters A-Z, a-z, 0-9, and HYPHEN-MINUS (%x2D). 6. Character Set Consideration For example, en is English. en-GB is British English and en-CA is Canadian English. The two parts are separated by a hyphen. Where else is language specificity useful? That's not the only way language tags can appear in HTML. If you want your web page to show a little preview when you share it - perhaps on social media or a messaging app - you can use Open Graph Protocol. og:locale - The locale these tags are marked up in. Of the format language_TERRITORY. Default is en_US. Optional Metadata - Open Graph Protocol (Hurrah for American hegemony!) Here's the example it gives: <meta property="og:description" content="Sean Connery found fame and fortune as the suave, sophisticated British agent, James Bond." /> <meta property="og:locale" content="en_GB" /> That says the locale of the tags, not the page, is British English. So you could have a page in the Japanese language but OGP tags written in Cherokee. Now I have two questions. Why doesn't this use the lang attribute? Why does this use an underscore rather than a hyphen? For example, this is valid HTML: <meta property="og:site_name" content="Les Misérables" lang="fr"> <meta property="og:description" content="A book by Victor Hugo." lang="en-GB"> That says the site's name is in French but the description is in English. That will parse perfectly. What's going on with OGP? As I've ranted before, development of Open Graph Protocol is dead. Facebook, who run it, recently reopened their GitHub repo - but only to add a proposed tag. Their discussion forum is full of spam. There's no history of the development, no rationale for why things were chosen, just Facebook's edict. The nearest I can find to an explanation is this Pull Request which references an obsolete page of Facebook's locales. Despite Facebook removing the page, it lives on! Take a look at the documentation for embedded posts. It says: When you load the SDK, change the value of js.src to use your locale. Replace en_US with your locale, e.g., fr_FR for French (France): 'https://connect.facebook.net/fr_FR/sdk.js Which, I think, leads us to the answer. An answer which was hidden in the question the whole time. A language is not the same as a locale. A language only tells you about the language. A locale, by contrast, tells you about the user's preferences. A locale comprises the language, territory, and code set combination used to identify a set of language conventions. These conventions include information on collation, case conversion, and character classification, the language of message catalogs, date-and-time representation, the monetary symbol, and numeric representation. Understanding locale - IBM Do you know if 10/08/12 is the 10th of August or the 8th of October? Is 5.99 describing the cost in a mark, a yen, a buck, or a pound? If you know the locale, you do. So a locale can be more useful than just a plain language. OK, but why does it use an underscore? As far as I can tell, POSIX standardised it in ISO/IEC 15897. It built on a number of older standards. And, for whatever reason, they used the underscore. My final question before I let you get on with your lives - is a locale useful? OGP defines several data types. The date is always in ISO8601 format, so no need for a locale there. Bools, strings, and enums don't benefit from a locale in any way that I can see. What about the new payment property? A locale might be useful there to show currency. Except the specification has: payment:currency - string - The currency code ISO 4217 of the payment. The only thing I can see a locale being useful for is numbers. The thousand separator and decimal mark are different depending on the locale. So it might be useful to display "5,99" or "10.000,32" depending on the page's intended audience. If Facebook were still interested in maintaining OGP, I think that asking them to deprecate og:locale and replace it with lang on specific meta elements would be sensible. So there you have it. A language is not the same as a locale, and an underscore is not the same as a hyphen, and a Facebook recommendation is not the same as a living standard. Right, that's enough yak shaving. I'm sure I was meant to be doing something important… Oh! Yes! Welcome to HTMHell 🎅
For many course creators, the Black Friday holiday period is when we offer the biggest discounts of the year, which means it’s a great time to pick up some of the web development courses you’ve had your eye on! This post is a quick round-up of my top 10 picks.