ESNext: Get localized language, currency, and region names with Intl.DisplayNames

An ECMAScript Language Feature that currently is in Stage-3 and that has already landed in V8 version 8.1 is Intl.DisplayNames. It’s a way to get localized display names for languages, scripts, regions and others. Stage-3? 💁‍♂️ The TC39 Committee has a 5 stage process in place, ranging from stage-0 to stage-4, by which it develops […]

ESNext: Relatively format time with Intl.RelativeTimeFormat

An ECMAScript Language Feature that just moved to Stage-4, and thus will be part of ES2020, is Intl.RelativeTimeFormat. It’s a way to format time in a relative manner – such as “10 minutes ago” or “in 3 quarters” – while also keeping a language into account. Stage-4? 💁‍♂️ The TC39 Committee has a 5 stage […]

Multilingual Sites: Styling translated text

Ire Aderinokun on why you should use the :lang pseudo-class over the lang attribute selector (e.g. [lang]) for language-specific styles: The problem with having language-specific styles based on the [lang] attribute selector is that the selector isn’t actually aware of the language of the element. It’s just like any other “dumb” attribute selector. This can […]