Menu

Reading a country out of a locale string is 16 lines, because de-DE-u-ca-gregory contains Canada and Intl.Locale throws on what Android hands you
📰

Reading a country out of a locale string is 16 lines, because de-DE-u-ca-gregory contains Canada and Intl.Locale throws on what Android hands you

DEV Community: typescript·Daniel Pertu·3 days ago
#TyW4Pf8h
#devtotypescript#devto#dev#region#locale
Reading 0:00
15s threshold

Munchable 's paywall has to print a price on its first frame. It is the screen you land on when you run out of free scans, and a spinner where the number should be is not a thing I am willing to ship. So the currency comes off the device, synchronously, before anything has been asked of any server. I have written about what happens when that guess disagrees with what checkout charges before. This post is about the sixteen lines underneath it, which I expected to be one line.

The one line is this, and I would bet it is in production somewhere near you:

const region = locale .…

Continue reading — create a free account

Join HashtagPLUS to read full articles, follow hashtags, vote, and join the conversation.