-
-
Notifications
You must be signed in to change notification settings - Fork 7
/
Copy pathlanguage.js
45 lines (35 loc) · 1.32 KB
/
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
38
39
40
41
42
43
44
45
const Config = require('./config');
const fs = require('fs');
const chalk = require('chalk');
console.log(chalk.green.bold('Loading ' + Config.LANG + ' language...🎀🎀'));
console.log(chalk.red.bold('You entered an eny language. English language was chosen.'));
var json = JSON.parse(fs.readFileSync('./JS Object Notation/language/EN.json'));
function getString(file) {
return json['STRINGS'][file];
}
module.exports = {
language: json,
getString: getString
}
// ===============================================Comment====================================================================
// const Config = require('./config');
// const fs = require('fs');
// const chalk = require('chalk');
// if (fs.existsSync('./DataBase/language/' + Config.LANG + '.json')) {
// console.log(
// chalk.green.bold('Loading ' + Config.LANG + ' language...🎀🎀')
// );
// var json = JSON.parse(fs.readFileSync('./DataBase/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('./DataBase/language/EN.json'));
// }
// function getString(file) {
// return json['STRINGS'][file];
// }
// module.exports = {
// language: json,
// getString: getString
// }