2018-03-31 03:30:30 +08:00
|
|
|
import {ProjectPath} from '../ProjectPath';
|
|
|
|
import * as fs from 'fs';
|
|
|
|
import * as path from 'path';
|
|
|
|
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'];
|
|
|
|
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
|
|
|
}
|
|
|
|
|
|
|
|
}
|