Skip to content

Add the fmt_country() function; update fmt_flag() #1645

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 19 commits into from
Apr 30, 2024
Merged

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
12 checks passed
@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.

1 participant