Feature/setup pt (#1439)

* Setup pt

* Update changelog
This commit is contained in:
Thomas Kaul
2023-01-02 20:52:48 +01:00
committed by GitHub
parent d321d56dee
commit c4765e31cd
7 changed files with 43 additions and 4 deletions

View File

@@ -16,6 +16,7 @@ export class FrontendMiddleware implements NestMiddleware {
public indexHtmlEs = '';
public indexHtmlIt = '';
public indexHtmlNl = '';
public indexHtmlPt = '';
public isProduction: boolean;
public constructor(
@@ -49,6 +50,10 @@ export class FrontendMiddleware implements NestMiddleware {
this.getPathOfIndexHtmlFile('nl'),
'utf8'
);
this.indexHtmlPt = fs.readFileSync(
this.getPathOfIndexHtmlFile('pt'),
'utf8'
);
} catch {}
}
@@ -126,6 +131,15 @@ export class FrontendMiddleware implements NestMiddleware {
rootUrl: this.configurationService.get('ROOT_URL')
})
);
} else if (request.path === '/pt' || request.path.startsWith('/pt/')) {
response.send(
this.interpolate(this.indexHtmlPt, {
featureGraphicPath,
languageCode: 'pt',
path: request.path,
rootUrl: this.configurationService.get('ROOT_URL')
})
);
} else {
response.send(
this.interpolate(this.indexHtmlEn, {