From b47dcbeff736c5a4d1a4a5c3f67764fd0bc31a96 Mon Sep 17 00:00:00 2001 From: Aria Moradi Date: Sat, 18 Sep 2021 00:48:48 +0430 Subject: [PATCH] play favorites with Local source --- src/util/language.tsx | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/util/language.tsx b/src/util/language.tsx index 5290145e..1a88e403 100644 --- a/src/util/language.tsx +++ b/src/util/language.tsx @@ -12,6 +12,8 @@ export const ISOLanguages = [ { code: 'other', name: 'other langs?', nativeName: 'Other' }, + { code: 'localsourcelang', name: 'Local source', nativeName: 'Other' }, + // full list: https://github.com/meikidd/iso-639-1/blob/master/src/data.js { code: 'en', name: 'English', nativeName: 'English' }, { code: 'ca', name: 'Catalan; Valencian', nativeName: 'CatalĂ ' }, @@ -95,6 +97,7 @@ export function defualtLangs() { return [ // todo: infer this from the browser 'en', + 'localSourceLang', ]; } @@ -105,5 +108,8 @@ export const langSortCmp = (a: string, b: string) => { if (a === 'en') return -1; if (b === 'en') return 1; + if (a === 'localSourceLang') return 1; + if (b === 'localSourceLang') return -1; + return aLang > bLang ? 1 : -1; };