mirror of
https://github.com/movie-web/movie-web.git
synced 2024-11-13 13:55:07 +01:00
Merge pull request #599 from movie-web/dev
Add new languages to language options
This commit is contained in:
commit
a2ec9ff4c4
@ -2,6 +2,8 @@ import ar from "@/assets/locales/ar.json";
|
||||
import cs from "@/assets/locales/cs.json";
|
||||
import de from "@/assets/locales/de.json";
|
||||
import en from "@/assets/locales/en.json";
|
||||
import es from "@/assets/locales/es.json";
|
||||
import et from "@/assets/locales/et.json";
|
||||
import fr from "@/assets/locales/fr.json";
|
||||
import he from "@/assets/locales/he.json";
|
||||
import it from "@/assets/locales/it.json";
|
||||
@ -13,6 +15,7 @@ import pirate from "@/assets/locales/pirate.json";
|
||||
import pl from "@/assets/locales/pl.json";
|
||||
import sv from "@/assets/locales/sv.json";
|
||||
import th from "@/assets/locales/th.json";
|
||||
import tok from "@/assets/locales/tok.json";
|
||||
import tr from "@/assets/locales/tr.json";
|
||||
import vi from "@/assets/locales/vi.json";
|
||||
import zh from "@/assets/locales/zh.json";
|
||||
@ -36,6 +39,9 @@ export const locales = {
|
||||
th,
|
||||
ne,
|
||||
ar,
|
||||
es,
|
||||
et,
|
||||
tok,
|
||||
};
|
||||
export type Locales = keyof typeof locales;
|
||||
|
||||
|
@ -17,22 +17,34 @@ i18n.use(initReactI18next).init({
|
||||
},
|
||||
});
|
||||
|
||||
export const appLanguageOptions = langCodes.map((lang) => {
|
||||
if (lang === "pirate") {
|
||||
return {
|
||||
code: "pirate",
|
||||
name: "Pirate",
|
||||
nativeName: "Pirate Tongue",
|
||||
};
|
||||
const extraLanguages: Record<
|
||||
string,
|
||||
{
|
||||
code: string;
|
||||
name: string;
|
||||
nativeName: string;
|
||||
}
|
||||
> = {
|
||||
pirate: {
|
||||
code: "pirate",
|
||||
name: "Pirate",
|
||||
nativeName: "Pirate Tongue",
|
||||
},
|
||||
minion: {
|
||||
code: "minion",
|
||||
name: "Minion",
|
||||
nativeName: "Minionese",
|
||||
},
|
||||
tok: {
|
||||
code: "tok",
|
||||
name: "Toki pona",
|
||||
nativeName: "Toki pona",
|
||||
},
|
||||
};
|
||||
|
||||
if (lang === "minion") {
|
||||
return {
|
||||
code: "minion",
|
||||
name: "Minion",
|
||||
nativeName: "Minionese",
|
||||
};
|
||||
}
|
||||
export const appLanguageOptions = langCodes.map((lang) => {
|
||||
const extraLang = extraLanguages[lang];
|
||||
if (extraLang) return extraLang;
|
||||
|
||||
const [langObj] = ISO6391.getLanguages([lang]);
|
||||
if (!langObj)
|
||||
|
Loading…
Reference in New Issue
Block a user