18 lines
497 B
TypeScript

import _LANG_FLAGS from "@/langs-flags-list/lang-flags.json"
import _LANGUAGES from "@/assets/languages.min.json"
export const LANG_FLAGS = _LANG_FLAGS
export function longLang(shortLang : string) {
const obj = LANG_FLAGS[shortLang];
if (!obj) return undefined;
return obj["name"] as string;
}
export function lang_a3_a2(a3 : string) {
return _LANGUAGES.find(l => l.alpha3 === a3);
}
export function lang_a2_a3(a2 : string) {
return _LANGUAGES.find(l => l.alpha2 === a2);
}