Skip to content

Conversation

@rich-iannone
Copy link
Member

The new fmt_country() function has been added here to help with making country names consistent and localizable. The user needs to target cells that contain 2- or 3-letter ISO 3166-1 country codes (same interface as in fmt_flag()). The resulting country names have been obtained from the Unicode CLDR (Common Locale Data Repository), which is a good source since all country names are agreed upon by consensus. Furthermore, the country names can be localized through the locale argument (either in this function or through the initial gt() call).

The fmt_flag() function was updated to gain a locale argument so that SVG title text displays country names in any locale language (plus there's full consistency in country names between the two functions). These functions pair well together when you need to display country flags along with the corresponding names.

@rich-iannone rich-iannone merged commit 731b8b1 into master Apr 30, 2024
@rich-iannone rich-iannone deleted the add-fmt-country branch April 30, 2024 03:46
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants