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() {
|
|
|
|
}
|
|
|
|
|
2021-04-18 21:48:35 +08:00
|
|
|
public static init(): void {
|
2017-12-25 07:42:25 +08:00
|
|
|
const notLanguage = ['assets'];
|
2018-05-13 00:19:51 +08:00
|
|
|
const dirCont = fs.readdirSync(ProjectPath.FrontendFolder)
|
2021-04-18 21:48:35 +08:00
|
|
|
.filter((f): any => fs.statSync(path.join(ProjectPath.FrontendFolder, f)).isDirectory());
|
|
|
|
Config.Client.languages = dirCont.filter((d): boolean => notLanguage.indexOf(d) === -1);
|
2021-04-20 02:10:44 +08:00
|
|
|
Config.Client.languages.sort();
|
2017-12-25 07:42:25 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
}
|