facebook / facebook/docusaurus

Add an Option of Showing Flags in Locale dropdown

Offen
#7,566 12 Kommentare 1 Reaktion 0 zugewiesene Personen Auf GitHub ansehen
domain: theme feature
Vorherrschende Sprache
TypeScript
Sterne
66.2k
Forks
10k
Ø Merge
1 T. 3 Std.
Gemergte PRs (30 T.)
52

Beschreibung

### Have you read the Contributing Guidelines on issues?

- [X] I have read the [Contributing Guidelines on issues](https://github.com/facebook/docusaurus/blob/main/CONTRIBUTING.md#reporting-new-issues).

### Description

![image](https://user-images.githubusercontent.com/18216265/172035062-fc9505c8-b648-432d-92d0-a4b0cb46e017.png)

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.

Beitragsleitfaden

Beitragsleitfaden öffnen

Bewertung

Dieses Issue wurde noch nicht bewertet.

Neue Issues direkt in Ihr Postfach

Eine kurze Übersicht über anfängerfreundliche GitHub-Issues.