Browse Source

add missing info

pull/1291/head
m11tch 3 years ago
parent
commit
9c26c7cac5
  1. 9
      angular.json
  2. 14
      apps/api/src/app/frontend.middleware.ts
  3. 2
      apps/client/src/app/pages/account/account-page.component.ts
  4. 2
      apps/client/src/locales/messages.nl.xlf
  5. 4
      libs/common/src/lib/helper.ts

9
angular.json

@ -205,7 +205,11 @@
"browserTarget": "client:build", "browserTarget": "client:build",
"includeContext": true, "includeContext": true,
"outputPath": "src/locales", "outputPath": "src/locales",
"targetFiles": ["messages.de.xlf", "messages.it.xlf", "messages.nl.xlf"] "targetFiles": [
"messages.de.xlf",
"messages.it.xlf",
"messages.nl.xlf"
]
} }
}, },
"lint": { "lint": {
@ -375,8 +379,5 @@
"tags": [], "tags": [],
"implicitDependencies": ["ui"] "implicitDependencies": ["ui"]
} }
},
"cli": {
"analytics": false
} }
} }

14
apps/api/src/app/frontend.middleware.ts

@ -12,6 +12,7 @@ export class FrontendMiddleware implements NestMiddleware {
public indexHtmlDe = ''; public indexHtmlDe = '';
public indexHtmlEn = ''; public indexHtmlEn = '';
public indexHtmlIt = ''; public indexHtmlIt = '';
public indexHtmlNl = '';
public isProduction: boolean; public isProduction: boolean;
public constructor( public constructor(
@ -37,6 +38,10 @@ export class FrontendMiddleware implements NestMiddleware {
this.getPathOfIndexHtmlFile('it'), this.getPathOfIndexHtmlFile('it'),
'utf8' 'utf8'
); );
this.indexHtmlNl = fs.readFileSync(
this.getPathOfIndexHtmlFile('nl'),
'utf8'
);
} catch {} } catch {}
} }
@ -75,6 +80,15 @@ export class FrontendMiddleware implements NestMiddleware {
rootUrl: this.configurationService.get('ROOT_URL') rootUrl: this.configurationService.get('ROOT_URL')
}) })
); );
} else if (req.path === '/nl' || req.path.startsWith('/nl/')) {
res.send(
this.interpolate(this.indexHtmlIt, {
featureGraphicPath,
languageCode: 'nl',
path: req.path,
rootUrl: this.configurationService.get('ROOT_URL')
})
);
} else { } else {
res.send( res.send(
this.interpolate(this.indexHtmlEn, { this.interpolate(this.indexHtmlEn, {

2
apps/client/src/app/pages/account/account-page.component.ts

@ -54,7 +54,7 @@ export class AccountPageComponent implements OnDestroy, OnInit {
public hasPermissionToUpdateViewMode: boolean; public hasPermissionToUpdateViewMode: boolean;
public hasPermissionToUpdateUserSettings: boolean; public hasPermissionToUpdateUserSettings: boolean;
public language = document.documentElement.lang; public language = document.documentElement.lang;
public locales = ['de', 'de-CH', 'en-GB', 'en-US', 'it']; public locales = ['de', 'de-CH', 'en-GB', 'en-US', 'it', 'nl'];
public price: number; public price: number;
public priceId: string; public priceId: string;
public snackBarRef: MatSnackBarRef<TextOnlySnackBar>; public snackBarRef: MatSnackBarRef<TextOnlySnackBar>;

2
apps/client/src/locales/messages.nl.xlf

@ -3,7 +3,7 @@
<body> <body>
<trans-unit id="e19fcf996343543e13789f17b550ab0c08124b5c" datatype="html"> <trans-unit id="e19fcf996343543e13789f17b550ab0c08124b5c" datatype="html">
<source>Create Account</source> <source>Create Account</source>
<target state="translated">Account aanmaken</target> <target state="translated">Account aanmaken</target>
<context-group purpose="location"> <context-group purpose="location">
<context context-type="sourcefile">apps/client/src/app/pages/register/register-page.html</context> <context context-type="sourcefile">apps/client/src/app/pages/register/register-page.html</context>
<context context-type="linenumber">27,29</context> <context context-type="linenumber">27,29</context>

4
libs/common/src/lib/helper.ts

@ -1,7 +1,7 @@
import * as currencies from '@dinero.js/currencies'; import * as currencies from '@dinero.js/currencies';
import { DataSource } from '@prisma/client'; import { DataSource } from '@prisma/client';
import { getDate, getMonth, getYear, parse, subDays } from 'date-fns'; import { getDate, getMonth, getYear, parse, subDays } from 'date-fns';
import { de, it } from 'date-fns/locale'; import { de, it, nl } from 'date-fns/locale';
import { ghostfolioScraperApiSymbolPrefix, locale } from './config'; import { ghostfolioScraperApiSymbolPrefix, locale } from './config';
import { Benchmark } from './interfaces'; import { Benchmark } from './interfaces';
@ -77,6 +77,8 @@ export function getDateFnsLocale(aLanguageCode: string) {
return de; return de;
} else if (aLanguageCode === 'it') { } else if (aLanguageCode === 'it') {
return it; return it;
} else if (aLanguageCode === 'nl') {
return nl;
} }
return undefined; return undefined;

Loading…
Cancel
Save