Semaphore/web/src/lang/index.js

9 lines
284 B
JavaScript
Raw Normal View History

2023-07-04 16:47:29 +02:00
const files = require.context('.', false, /\.js$/);
const messages = {};
files.keys().forEach((key) => {
if (key === './index.js') return;
messages[key.replace(/(\.\/|\.js)/g, '')] = files(key).default;
});
const languages = Object.keys(messages);
export { messages, languages };