fix: filter alt langs when selecting by navigator

pull/1049/head
goat 2021-09-07 01:31:16 +02:00
parent 7fc830eacf
commit e3ce71ee92
1 changed files with 5 additions and 1 deletions

View File

@ -1,4 +1,4 @@
import { Language } from "../../context/Locale";
import { Language, Languages } from "../../context/Locale";
import type { SyncUpdateAction } from "./sync";
@ -25,6 +25,10 @@ export function findLanguage(lang?: string): Language {
const values = [];
for (const key in Language) {
const value = Language[key as keyof typeof Language];
// Skip alternative/joke languages
if (Languages[value].cat === "alt") continue;
values.push(value);
if (value.startsWith(code)) {
return value as Language;