All files / src/util language.tsx

0% Statements 0/3
100% Branches 0/0
100% Functions 0/0
0% Lines 0/3

Press n or j to go to the next uncovered block, b, p or k for the previous block.

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28                                                       
import languageData from "cldr-localenames-full/main/en/languages.json";
import territoryData from "cldr-localenames-full/main/en/territories.json";
import availableLocales from "cldr-core/availableLocales.json";
 
// type LanguageCountry = {
//   code: string;
//   language: string;
//   country: string;
// };
 
export const langNames = languageData.main.en.localeDisplayNames.languages;
export const territoryNames =
  territoryData.main.en.localeDisplayNames.territories;
export const locales: string[] = availableLocales.availableLocales.full;
 
// export const languageCountries: LanguageCountry[] = locales
//   .filter((tag) => tag.includes("-"))
//   .map((tag) => {
//     const [lang, region] = tag.split("-");
//     const language = langNames[lang] || lang;
//     const country = territoryNames[region] || region;
//     return {
//       code: tag,
//       language,
//       country,
//     };
//   });