mirror of
https://github.com/revoltchat/revite.git
synced 2024-12-25 07:02:10 -05:00
fix: filter alt langs when selecting by navigator
This commit is contained in:
parent
4787a2166f
commit
ef1a6a4454
1 changed files with 5 additions and 1 deletions
|
@ -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;
|
||||
|
|
Loading…
Reference in a new issue