mirror of
https://github.com/stoatchat/for-legacy-web.git
synced 2026-03-07 01:15:28 +00:00
fix: filter alt langs when selecting by navigator
This commit is contained in:
@@ -1,4 +1,4 @@
|
|||||||
import { Language } from "../../context/Locale";
|
import { Language, Languages } from "../../context/Locale";
|
||||||
|
|
||||||
import type { SyncUpdateAction } from "./sync";
|
import type { SyncUpdateAction } from "./sync";
|
||||||
|
|
||||||
@@ -25,6 +25,10 @@ export function findLanguage(lang?: string): Language {
|
|||||||
const values = [];
|
const values = [];
|
||||||
for (const key in Language) {
|
for (const key in Language) {
|
||||||
const value = Language[key as keyof typeof Language];
|
const value = Language[key as keyof typeof Language];
|
||||||
|
|
||||||
|
// Skip alternative/joke languages
|
||||||
|
if (Languages[value].cat === "alt") continue;
|
||||||
|
|
||||||
values.push(value);
|
values.push(value);
|
||||||
if (value.startsWith(code)) {
|
if (value.startsWith(code)) {
|
||||||
return value as Language;
|
return value as Language;
|
||||||
|
|||||||
Reference in New Issue
Block a user