parent
d321d56dee
commit
c4765e31cd
@ -5,6 +5,12 @@ All notable changes to this project will be documented in this file.
|
|||||||
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
|
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
|
||||||
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
|
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
|
||||||
|
|
||||||
|
## Unreleased
|
||||||
|
|
||||||
|
### Added
|
||||||
|
|
||||||
|
- Set up the language localization for Português (`pt`)
|
||||||
|
|
||||||
## 1.223.0 - 2023-01-01
|
## 1.223.0 - 2023-01-01
|
||||||
|
|
||||||
### Added
|
### Added
|
||||||
|
@ -16,6 +16,7 @@ export class FrontendMiddleware implements NestMiddleware {
|
|||||||
public indexHtmlEs = '';
|
public indexHtmlEs = '';
|
||||||
public indexHtmlIt = '';
|
public indexHtmlIt = '';
|
||||||
public indexHtmlNl = '';
|
public indexHtmlNl = '';
|
||||||
|
public indexHtmlPt = '';
|
||||||
public isProduction: boolean;
|
public isProduction: boolean;
|
||||||
|
|
||||||
public constructor(
|
public constructor(
|
||||||
@ -49,6 +50,10 @@ export class FrontendMiddleware implements NestMiddleware {
|
|||||||
this.getPathOfIndexHtmlFile('nl'),
|
this.getPathOfIndexHtmlFile('nl'),
|
||||||
'utf8'
|
'utf8'
|
||||||
);
|
);
|
||||||
|
this.indexHtmlPt = fs.readFileSync(
|
||||||
|
this.getPathOfIndexHtmlFile('pt'),
|
||||||
|
'utf8'
|
||||||
|
);
|
||||||
} catch {}
|
} catch {}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -126,6 +131,15 @@ export class FrontendMiddleware implements NestMiddleware {
|
|||||||
rootUrl: this.configurationService.get('ROOT_URL')
|
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 {
|
} else {
|
||||||
response.send(
|
response.send(
|
||||||
this.interpolate(this.indexHtmlEn, {
|
this.interpolate(this.indexHtmlEn, {
|
||||||
|
@ -97,6 +97,10 @@
|
|||||||
"baseHref": "/nl/",
|
"baseHref": "/nl/",
|
||||||
"localize": ["nl"]
|
"localize": ["nl"]
|
||||||
},
|
},
|
||||||
|
"development-pt": {
|
||||||
|
"baseHref": "/pt/",
|
||||||
|
"localize": ["pt"]
|
||||||
|
},
|
||||||
"production": {
|
"production": {
|
||||||
"fileReplacements": [
|
"fileReplacements": [
|
||||||
{
|
{
|
||||||
@ -150,6 +154,9 @@
|
|||||||
"development-nl": {
|
"development-nl": {
|
||||||
"browserTarget": "client:build:development-nl"
|
"browserTarget": "client:build:development-nl"
|
||||||
},
|
},
|
||||||
|
"development-pt": {
|
||||||
|
"browserTarget": "client:build:development-pt"
|
||||||
|
},
|
||||||
"production": {
|
"production": {
|
||||||
"browserTarget": "client:build:production"
|
"browserTarget": "client:build:production"
|
||||||
}
|
}
|
||||||
@ -165,7 +172,8 @@
|
|||||||
"messages.de.xlf",
|
"messages.de.xlf",
|
||||||
"messages.es.xlf",
|
"messages.es.xlf",
|
||||||
"messages.it.xlf",
|
"messages.it.xlf",
|
||||||
"messages.nl.xlf"
|
"messages.nl.xlf",
|
||||||
|
"messages.pt.xlf"
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
@ -201,6 +209,10 @@
|
|||||||
"nl": {
|
"nl": {
|
||||||
"baseHref": "/nl/",
|
"baseHref": "/nl/",
|
||||||
"translation": "apps/client/src/locales/messages.nl.xlf"
|
"translation": "apps/client/src/locales/messages.nl.xlf"
|
||||||
|
},
|
||||||
|
"pt": {
|
||||||
|
"baseHref": "/pt/",
|
||||||
|
"translation": "apps/client/src/locales/messages.pt.xlf"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"sourceLocale": "en"
|
"sourceLocale": "en"
|
||||||
|
@ -55,7 +55,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', 'es', 'it', 'nl'];
|
public locales = ['de', 'de-CH', 'en-GB', 'en-US', 'es', 'it', 'nl', 'pt'];
|
||||||
public price: number;
|
public price: number;
|
||||||
public priceId: string;
|
public priceId: string;
|
||||||
public snackBarRef: MatSnackBarRef<TextOnlySnackBar>;
|
public snackBarRef: MatSnackBarRef<TextOnlySnackBar>;
|
||||||
|
@ -143,6 +143,10 @@
|
|||||||
>Nederlands (<ng-container i18n>Community</ng-container
|
>Nederlands (<ng-container i18n>Community</ng-container
|
||||||
>)</mat-option
|
>)</mat-option
|
||||||
>
|
>
|
||||||
|
<!--<mat-option value="pt"
|
||||||
|
>Português (<ng-container i18n>Community</ng-container
|
||||||
|
>)</mat-option
|
||||||
|
>-->
|
||||||
</mat-select>
|
</mat-select>
|
||||||
</mat-form-field>
|
</mat-form-field>
|
||||||
</div>
|
</div>
|
||||||
|
@ -198,7 +198,8 @@
|
|||||||
<h4>Multi-Language</h4>
|
<h4>Multi-Language</h4>
|
||||||
<p class="m-0">
|
<p class="m-0">
|
||||||
Use Ghostfolio in multiple languages: English, Dutch, German,
|
Use Ghostfolio in multiple languages: English, Dutch, German,
|
||||||
Italian and Spanish are currently supported.
|
Italian<ng-container *ngIf="false">, Portuguese</ng-container>
|
||||||
|
and Spanish are currently supported.
|
||||||
</p>
|
</p>
|
||||||
</div>
|
</div>
|
||||||
</mat-card>
|
</mat-card>
|
||||||
|
@ -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, es, it, nl } from 'date-fns/locale';
|
import { de, es, it, nl, pt } from 'date-fns/locale';
|
||||||
|
|
||||||
import { ghostfolioScraperApiSymbolPrefix, locale } from './config';
|
import { ghostfolioScraperApiSymbolPrefix, locale } from './config';
|
||||||
import { Benchmark } from './interfaces';
|
import { Benchmark } from './interfaces';
|
||||||
@ -83,6 +83,8 @@ export function getDateFnsLocale(aLanguageCode: string) {
|
|||||||
return it;
|
return it;
|
||||||
} else if (aLanguageCode === 'nl') {
|
} else if (aLanguageCode === 'nl') {
|
||||||
return nl;
|
return nl;
|
||||||
|
} else if (aLanguageCode === 'pt') {
|
||||||
|
return pt;
|
||||||
}
|
}
|
||||||
|
|
||||||
return undefined;
|
return undefined;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user