djstevenson / songs-to-the-siren

A blog about songs
MIT License
0 stars 0 forks source link

Country-code (flag) simplifications #304

Closed djstevenson closed 4 years ago

djstevenson commented 4 years ago

Flags are made up of two "regional letter" Unicode symbols. e.g. the 2-letter international code for Iceland is IS, so the Iceland flag is 🇮 Regional Indicator Symbol Letter I and 🇸 Regional Indicator Symbol Letter S

The Union Flag is kinda an exception, it's the flag for the UK but it uses the code for GB.

But really, I could do away with the form for defining country flags, and just put IS for Iceland, and translate that to the emoji at runtime.

And we can do multiple countries, I'd just enter "UK US", say, and get "🇬🇧 🇺🇸"

Provided mapping the 'plain' chars to the regional indicators is easy, this will simplify things

djstevenson commented 4 years ago

^ Code for the union flag is actually based on GB rather than US, i.e. Regional Indicator Symbol Letter G and Regional Indicator Symbol Letter B