-
Notifications
You must be signed in to change notification settings - Fork 10
/
language.js
37 lines (27 loc) · 862 Bytes
/
language.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
/* Copyright (C) 2022 Ber4tbey.
Licensed under the MIT License;
you may not use this file except in compliance with the License.
Lavanstax - Ber4tbey
*/
//THX YUSUFUSTA
const Config = require('./config');
const fs = require('fs');
const chalk = require('chalk');
if (fs.existsSync('./language/' + Config.LANG + '.json')) {
console.log(
chalk.green.bold('Loading ' + Config.LANG + ' language...')
);
var json = JSON.parse(fs.readFileSync('./language/' + Config.LANG + '.json'));
} else {
console.log(
chalk.red.bold('You entered an invalid language. English language was chosen.')
);
var json = JSON.parse(fs.readFileSync('./language/EN.json'));
}
function getString(file) {
return json['STRINGS'][file];
}
module.exports = {
language: json,
getString: getString
}