2022-06-15 13:25:51 +00:00
|
|
|
const packs = {
|
2022-06-22 05:24:06 +00:00
|
|
|
bulgarian: require("./languages/bulgarian"),
|
|
|
|
english: require("./languages/english"),
|
|
|
|
"french-fr": require("./languages/french-fr"),
|
|
|
|
german: require("./languages/german"),
|
|
|
|
italian: require("./languages/italian"),
|
|
|
|
macedonian: require("./languages/macedonian"),
|
|
|
|
malay: require("./languages/malay"),
|
|
|
|
dutch: require("./languages/dutch"),
|
|
|
|
polish: require("./languages/polish"),
|
|
|
|
spanish: require("./languages/spanish"),
|
|
|
|
"chinese-traditional": require("./languages/chinese-traditional"),
|
|
|
|
"chinese-simplified": require("./languages/chinese-simplified"),
|
|
|
|
"brazilian-portuguese": require("./languages/brazilian-portuguese"),
|
|
|
|
indonesian: require("./languages/indonesian"),
|
|
|
|
};
|
2022-06-15 13:25:51 +00:00
|
|
|
|
2022-06-18 00:04:33 +00:00
|
|
|
function module(subPack, listPacks) {
|
2022-06-15 13:25:51 +00:00
|
|
|
//--- List All Packs ---//
|
2022-06-15 13:40:13 +00:00
|
|
|
if (listPacks === true) return packs;
|
2022-06-15 13:25:51 +00:00
|
|
|
|
|
|
|
//--- Return Language Pack ---//
|
2022-06-15 00:55:45 +00:00
|
|
|
const selectedLanguage = localStorage.getItem("language") || "english";
|
2022-06-18 00:04:33 +00:00
|
|
|
const languagePack = packs[selectedLanguage];
|
2022-05-06 03:11:28 +00:00
|
|
|
|
2022-06-18 00:04:33 +00:00
|
|
|
if (!subPack) return languagePack;
|
|
|
|
return languagePack[subPack];
|
2022-05-06 03:11:28 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
export default ({ app }, inject) => {
|
|
|
|
inject("lang", module);
|
|
|
|
};
|