1
0
mirror of https://github.com/xuthus83/pigallery2.git synced 2024-11-03 21:04:03 +08:00
pigallery2/src/backend/model/Localizations.ts

20 lines
575 B
TypeScript
Raw Normal View History

2018-03-31 03:30:30 +08:00
import {ProjectPath} from '../ProjectPath';
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';
export class Localizations {
constructor() {
}
public static init(): void {
const notLanguage = ['assets'];
const dirCont = fs.readdirSync(ProjectPath.FrontendFolder)
.filter((f): any => fs.statSync(path.join(ProjectPath.FrontendFolder, f)).isDirectory());
Config.Client.languages = dirCont.filter((d): boolean => notLanguage.indexOf(d) === -1);
Config.Client.languages.sort();
}
}