Merge pull request #696 from pokej6/windows_hide_country_flags
Hiding language preference flags while on Windows platforms.
This commit is contained in:
commit
7c1d892779
1 changed files with 11 additions and 2 deletions
|
@ -436,10 +436,19 @@ const Appearance = () => {
|
||||||
const Language = () => {
|
const Language = () => {
|
||||||
const { t, i18n } = useTranslation();
|
const { t, i18n } = useTranslation();
|
||||||
const labelId = "prefLanguage";
|
const labelId = "prefLanguage";
|
||||||
const randomFlags = shuffle(["🇬🇧", "🇺🇸", "🇪🇸", "🇫🇷", "🇧🇬", "🇨🇿", "🇩🇪", "🇵🇱", "🇺🇦", "🇨🇳", "🇮🇹", "🇭🇺", "🇧🇷", "🇳🇱", "🇮🇩", "🇯🇵", "🇷🇺", "🇹🇷"]).slice(0, 3);
|
|
||||||
const title = t("prefs_appearance_language_title") + " " + randomFlags.join(" ");
|
|
||||||
const lang = i18n.language ?? "en";
|
const lang = i18n.language ?? "en";
|
||||||
|
|
||||||
|
// Country flags are displayed using emoji. Emoji rendereing is handled by platform fonts.
|
||||||
|
// Windows in particular does not yet play nicely with flag emoji so for now, hide flags on Windows.
|
||||||
|
// Note: There are ways around this by using custom fonts. This appears to be implemented in Firefox...
|
||||||
|
// Not worth the hassle.
|
||||||
|
const randomFlags = shuffle(["🇬🇧", "🇺🇸", "🇪🇸", "🇫🇷", "🇧🇬", "🇨🇿", "🇩🇪", "🇵🇱", "🇺🇦", "🇨🇳", "🇮🇹", "🇭🇺", "🇧🇷", "🇳🇱", "🇮🇩", "🇯🇵", "🇷🇺", "🇹🇷"]).slice(0, 3);
|
||||||
|
const showFlags = !navigator.userAgent.includes("Windows");
|
||||||
|
let title = t("prefs_appearance_language_title");
|
||||||
|
if (showFlags === true) {
|
||||||
|
title += " " + randomFlags.join(" ");
|
||||||
|
}
|
||||||
|
|
||||||
const handleChange = async (ev) => {
|
const handleChange = async (ev) => {
|
||||||
await i18n.changeLanguage(ev.target.value);
|
await i18n.changeLanguage(ev.target.value);
|
||||||
await maybeUpdateAccountSettings({
|
await maybeUpdateAccountSettings({
|
||||||
|
|
Loading…
Reference in a new issue