0
0
Fork 0
mirror of https://github.com/VueTubeApp/VueTube synced 2024-11-22 19:25:16 +00:00
VueTube/NUXT/plugins/language.js
Kenny 93f297df85 refactor: Sort Language Pack Object + Include ALL Languages
Sorted `obj/packs` in `~/NUXT/plugins/language.js` and included all language packs because they weren't up to date
2022-06-28 12:01:47 -04:00

38 lines
1.6 KiB
JavaScript

const packs = {
azerbaijan: require("./languages/azerbaijan"),
"brazilian-portuguese": require("./languages/brazilian-portuguese"),
bulgarian: require("./languages/bulgarian"),
"chinese-simplified": require("./languages/chinese-simplified"),
"chinese-traditional": require("./languages/chinese-traditional"),
dutch: require("./languages/dutch"),
english: require("./languages/english"),
"french-fr": require("./languages/french-fr"),
german: require("./languages/german"),
indonesian: require("./languages/indonesian"),
italian: require("./languages/italian"),
korean: require("./languages/korean"),
macedonian: require("./languages/macedonian"),
malay: require("./languages/malay"),
polish: require("./languages/polish"),
romanian: require("./languages/romanian"),
russian: require("./languages/russian"),
spanish: require("./languages/spanish"),
tamil: require("./languages/tamil"),
turkish: require("./languages/turkish"),
};
function module(subPack, listPacks) {
//--- List All Packs ---//
if (listPacks === true) return packs;
//--- Return Language Pack ---//
const selectedLanguage = localStorage.getItem("language") || "english";
const languagePack = packs[selectedLanguage];
if (!subPack) return languagePack;
return languagePack[subPack];
}
export default ({ app }, inject) => {
inject("lang", module);
};