Using Gettext based translations in Node

When working with WordPress, one of the things I enjoyed was how easy it made it to use Gettext-based translation tooling and functionality to localize themes and plugins. I was thinking that it would be nice if there was an equivalent toolset for Javascript. node-gettext seems to fit the bill nicely. It provides facilities to load and work with existing PO files and it provides the basic tooling that we need to work directly with PO files generate with other tools. Even though Node now supports ESM and their related methods I’m sticking to CommonJS for a while longer so

Leveraging local fonts

Note This feature needs an Origin Trial Key for your origin. If you choose not to go for an Origin Trial then you and your users will need to enable the Font Access APIs flag (#font-access) in chrome://flags and restart the browser. The web has had custom font capabilities from very early on in the history of CSS. CSS introduced @font-face in 1998 as part of CSS 2. It allowed developers to link to font files and use them to display content on the web. As with many things in the early days of the web, different browser vendors decided

(Re)learning how to use VoiceOver

I was rereading I Used The Web For A Day Using A Screen Reader and realized that it’s been a while since I last used VoiceOver (the built-in screen reader for Mac) to proof the content of my posts and pages. I said “fine, let’s fire it up and listen to what the page I was reading sounds like”. It wasn’t as easy as I thought as I’ve forgotten most of the commands that I used to navigate content with Voiceover. So, rather than have to commit this to memory I’ll post it here and generate a PDF of the

CSS Media Queries in Javascript

Since a lot of work we do in CSS we actually do in Javascript, I thought it would be good to research how we can do media queries in JS too. There are two ways to work with media queries. The first one is to do something with the condition when the script first loads. In this example, create a media query using window.matchMedia to determine if the document matched the specified media query. // Define the query const mediaQuery = window.matchMedia(“(max-width: 768px)”); // Create a media condition that // targets smaller than 768px wide const mediumSizeQuery = window.matchMedia(“(max-width: 768px)”);

Writing topic-based content

Topic-based documentation is content broken down into topics; small reusable chunks of content that can be reused in multiple documents. I try my best to write as if the document was topic-based. Some of the advantages I see: Topic-based authoring makes you think about the content you write. The content is usually more focused Users can go straight to the section with the information they need, and it should make sense on its own with little or no outside references It allows you to tailor material for different audiences Most topic-based authoring tools let you use one source for multiple