mirror of
https://github.com/VueTubeApp/VueTube
synced 2024-11-26 21:23:02 +00:00
38d67fbf97
Performance Optimisations, Fix Plugin Loader Bugs, Add More Translations, Fix Translation Related Bugs
25 lines
681 B
JavaScript
25 lines
681 B
JavaScript
const packs = {
|
|
english: require('./languages/english'),
|
|
spanish: require('./languages/spanish'),
|
|
italian: require('./languages/italian'),
|
|
polish: require('./languages/polish'),
|
|
"chinese-traditional": require('./languages/chinese-traditional')
|
|
}
|
|
|
|
function module(text, listPacks) {
|
|
|
|
//--- List All Packs ---//
|
|
if (listPacks === true) return packs;
|
|
|
|
//--- Return Language Pack ---//
|
|
const selectedLanguage = localStorage.getItem("language") || "english";
|
|
const languagePack = require('./languages/'+selectedLanguage);
|
|
|
|
if (!text) return languagePack;
|
|
return languagePack[text];
|
|
|
|
}
|
|
|
|
export default ({ app }, inject) => {
|
|
inject("lang", module);
|
|
};
|