2022-06-15 13:25:51 +00:00
|
|
|
const packs = {
|
2022-06-16 17:56:24 +00:00
|
|
|
bulgarian: require('./languages/bulgarian'),
|
2022-06-15 13:25:51 +00:00
|
|
|
english: require('./languages/english'),
|
2022-06-16 23:47:52 +00:00
|
|
|
french: require('./languages/french'),
|
2022-06-16 16:56:19 +00:00
|
|
|
german: require('./languages/german'),
|
2022-06-15 13:25:51 +00:00
|
|
|
italian: require('./languages/italian'),
|
2022-06-16 03:26:46 +00:00
|
|
|
macedonian: require('./languages/macedonian'),
|
2022-06-16 16:56:19 +00:00
|
|
|
malay: require('./languages/malay'),
|
2022-06-16 17:56:24 +00:00
|
|
|
dutch: require('./languages/dutch'),
|
2022-06-15 19:00:26 +00:00
|
|
|
polish: require('./languages/polish'),
|
2022-06-16 03:26:46 +00:00
|
|
|
spanish: require('./languages/spanish'),
|
2022-06-16 16:56:19 +00:00
|
|
|
"chinese-traditional": require('./languages/chinese-traditional'),
|
|
|
|
"chinese-simplified": require('./languages/chinese-simplified'),
|
|
|
|
"brazilian-portuguese": require('./languages/brazilian-portuguese'),
|
2022-06-17 05:32:42 +00:00
|
|
|
indonesian: require('./languages/indonesian'),
|
2022-06-15 13:25:51 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
function module(text, listPacks) {
|
|
|
|
|
|
|
|
//--- 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-15 13:53:48 +00:00
|
|
|
const languagePack = require('./languages/'+selectedLanguage);
|
2022-05-06 03:11:28 +00:00
|
|
|
|
|
|
|
if (!text) return languagePack;
|
|
|
|
return languagePack[text];
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
export default ({ app }, inject) => {
|
|
|
|
inject("lang", module);
|
|
|
|
};
|