question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Add an Option of Showing Flags in Locale dropdown

See original GitHub issue

Have you read the Contributing Guidelines on issues?

Description

image

It can be an option in docusaurus.config.js to show the flags of each locale as emoji characters for better compatibility.

I have a dilemma for this feature though

  • Arguably, the flag of England is the most appropriate flag to represent the English language. But how recognizable is the English flag?
  • However, often the British flag is used to represent English. Within Britain, other languages other than English are spoken — including Welsh and Scottish Gaelic.
  • Often the United States flag is used to represent English — and while the USA has far more English speakers than Britain, English does not originate from the United States.

Maybe an optional Unicode character also can be embedded in the config like how it’s used in below :

https://www.npmjs.com/package/emoji-flags

{
    "code": "DK",
    "emoji": "🇩🇰",
    "unicode": "U+1F1E9 U+1F1F0",
    "name": "Denmark",
    "title": "flag for Denmark"
}

But it may help #7409 also.

Has this been requested on Canny?

No response

Motivation

To make an improvement in locale dropdown and #7409

API design

No response

Have you tried building it?

No response

Self-service

  • I’d be willing to contribute this feature to Docusaurus myself.

Issue Analytics

  • State:open
  • Created a year ago
  • Comments:12 (6 by maintainers)

github_iconTop GitHub Comments

2reactions
Josh-Cenacommented, Jun 5, 2022

Ah, that’s a construction barrier. And yes, if we make this an API it should be more easily portable.

Also, if we support this API, it should probably support strings, HTMLs, and images.

1reaction
slorbercommented, Jun 15, 2022

agree we should have this and make a poc

This post provides a very lightweight way to get an emoji from a country code:

https://dev.to/jorik/country-code-to-flag-emoji-a21

we can start with something opinionated and then see which options make sense?

Read more comments on GitHub >

github_iconTop Results From Across the Web

JSF RichFaces locale dropdown list with flag icons
I'm developing a JSF web appication using RichFaces library. Application supports different locales, and user is able to change them by ...
Read more >
Best practice for presenting languages
When presenting links to content in different languages, consider the following: Always use the name of the language in its local format.
Read more >
Replace the Magento language selector with flag icons - Atwix
Choose one of them, such as 'German'. Then, click on the 'General' tab. On the general setting page, expand the 'Locale Options' section....
Read more >
Choosing the Flags for Your Site's Languages - WPML
Adding Custom Languages for Countries that Speak the Same Language ... Now that we know how to select the flag, let's look at...
Read more >
How to flag, label, and rate photos in Lightroom Classic
To show flags and labels in the thumbnail cells of the Grid view, choose View > View ... select Show Rating Footer in...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found