0
0
Fork 0
mirror of https://github.com/VueTubeApp/VueTube synced 2024-11-01 17:32:39 +00:00
VueTube/NUXT/plugins/language.js

41 lines
1.4 KiB
JavaScript
Raw Normal View History

const packs = {
2022-07-01 06:27:34 +00:00
azerbaijan: require("./languages/azerbaijan"),
"brazilian-portuguese": require("./languages/brazilian-portuguese"),
2022-07-01 06:27:34 +00:00
bulgarian: require("./languages/bulgarian"),
"chinese-simplified": require("./languages/chinese-simplified"),
"chinese-traditional": require("./languages/chinese-traditional"),
dutch: require("./languages/dutch"),
english: require("./languages/english"),
estonian: require("./languages/estonian"),
2022-07-01 06:27:34 +00:00
"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"),
ukrainian: require("./languages/ukrainian"),
};
function module(subPack, listPacks) {
//--- List All Packs ---//
2022-06-15 13:40:13 +00:00
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);
};