0
0
Fork 0
mirror of https://github.com/VueTubeApp/VueTube synced 2024-12-01 07:33:07 +00:00
VueTube/NUXT/plugins/language.js
deepsource-autofix[bot] b252fa79c0
Format code with prettier
This commit fixes the style issues introduced in 38b0de7 according to the output
from prettier.

Details: https://deepsource.io/gh/VueTubeApp/VueTube/transform/9d827cbf-455d-44d1-b340-8f6b1836b896/
2022-06-22 05:24:06 +00:00

32 lines
1.1 KiB
JavaScript

const packs = {
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"),
};
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);
};