2018-03-31 03:30:30 +08:00
|
|
|
import {ProjectPath} from '../ProjectPath';
|
2018-05-13 00:19:51 +08:00
|
|
|
import * as fs from 'fs';
|
|
|
|
import * as path from 'path';
|
2018-03-31 03:30:30 +08:00
|
|
|
import {Config} from '../../common/config/private/Config';
|
2017-12-25 07:42:25 +08:00
|
|
|
|
|
|
|
export class Localizations {
|
|
|
|
|
|
|
|
constructor() {
|
|
|
|
}
|
|
|
|
|
|
|
|
public static init() {
|
|
|
|
const notLanguage = ['assets'];
|
2018-05-13 00:19:51 +08:00
|
|
|
const dirCont = fs.readdirSync(ProjectPath.FrontendFolder)
|
|
|
|
.filter(f => fs.statSync(path.resolve(ProjectPath.FrontendFolder, f)).isDirectory());
|
|
|
|
Config.Client.languages = dirCont.filter(d => notLanguage.indexOf(d) === -1);
|
2018-03-31 03:30:30 +08:00
|
|
|
Config.Client.languages.push('en');
|
2017-12-25 07:42:25 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
}
|