Browse Source

Localize country names

pull/6995/head
Thomas Kaul 3 days ago
parent
commit
50289df129
  1. 2
      apps/client/src/app/components/admin-market-data/asset-profile-dialog/asset-profile-dialog.component.ts
  2. 2
      apps/client/src/app/components/admin-market-data/asset-profile-dialog/asset-profile-dialog.html
  3. 2
      apps/client/src/app/components/holding-detail-dialog/holding-detail-dialog.component.ts
  4. 2
      apps/client/src/app/components/holding-detail-dialog/holding-detail-dialog.html
  5. 4
      apps/client/src/app/pages/portfolio/allocations/allocations-page.component.ts
  6. 4
      apps/client/src/app/pages/public/public-page.component.ts
  7. 6
      libs/ui/src/lib/portfolio-proportion-chart/portfolio-proportion-chart.component.ts

2
apps/client/src/app/components/admin-market-data/asset-profile-dialog/asset-profile-dialog.component.ts

@ -371,7 +371,7 @@ export class GfAssetProfileDialogComponent implements OnInit {
) { ) {
for (const { code, name, weight } of this.assetProfile.countries) { for (const { code, name, weight } of this.assetProfile.countries) {
this.countries[code] = { this.countries[code] = {
name, name: translate(name),
value: weight value: weight
}; };
} }

2
apps/client/src/app/components/admin-market-data/asset-profile-dialog/asset-profile-dialog.html

@ -269,7 +269,7 @@
i18n i18n
size="medium" size="medium"
[locale]="data.locale" [locale]="data.locale"
[value]="assetProfile?.countries[0].name" [value]="translate(assetProfile?.countries[0].name)"
>Country</gf-value >Country</gf-value
> >
</div> </div>

2
apps/client/src/app/components/holding-detail-dialog/holding-detail-dialog.component.ts

@ -434,7 +434,7 @@ export class GfHoldingDetailDialogComponent implements OnInit {
if (SymbolProfile?.countries?.length > 0) { if (SymbolProfile?.countries?.length > 0) {
for (const country of SymbolProfile.countries) { for (const country of SymbolProfile.countries) {
this.countries[country.code] = { this.countries[country.code] = {
name: country.name, name: translate(country.name),
value: country.weight value: country.weight
}; };
} }

2
apps/client/src/app/components/holding-detail-dialog/holding-detail-dialog.html

@ -272,7 +272,7 @@
i18n i18n
size="medium" size="medium"
[locale]="data.locale" [locale]="data.locale"
[value]="SymbolProfile.countries[0].name" [value]="translate(SymbolProfile.countries[0].name)"
>Country</gf-value >Country</gf-value
> >
</div> </div>

4
apps/client/src/app/pages/portfolio/allocations/allocations-page.component.ts

@ -363,7 +363,7 @@ export class GfAllocationsPageComponent implements OnInit {
: position.valueInPercentage); : position.valueInPercentage);
} else { } else {
this.continents[continent] = { this.continents[continent] = {
name: continent, name: translate(continent),
value: value:
weight * weight *
(isNumber(position.valueInBaseCurrency) (isNumber(position.valueInBaseCurrency)
@ -380,7 +380,7 @@ export class GfAllocationsPageComponent implements OnInit {
: position.valueInPercentage); : position.valueInPercentage);
} else { } else {
this.countries[code] = { this.countries[code] = {
name, name: translate(name),
value: value:
weight * weight *
(isNumber(position.valueInBaseCurrency) (isNumber(position.valueInBaseCurrency)

4
apps/client/src/app/pages/public/public-page.component.ts

@ -193,7 +193,7 @@ export class GfPublicPageComponent implements OnInit {
weight * (position.valueInBaseCurrency ?? 0); weight * (position.valueInBaseCurrency ?? 0);
} else { } else {
this.continents[continent] = { this.continents[continent] = {
name: continent, name: translate(continent),
value: value:
weight * weight *
(this.publicPortfolioDetails.holdings[symbol] (this.publicPortfolioDetails.holdings[symbol]
@ -206,7 +206,7 @@ export class GfPublicPageComponent implements OnInit {
weight * (position.valueInBaseCurrency ?? 0); weight * (position.valueInBaseCurrency ?? 0);
} else { } else {
this.countries[code] = { this.countries[code] = {
name, name: translate(name),
value: value:
weight * weight *
(this.publicPortfolioDetails.holdings[symbol] (this.publicPortfolioDetails.holdings[symbol]

6
libs/ui/src/lib/portfolio-proportion-chart/portfolio-proportion-chart.component.ts

@ -37,8 +37,6 @@ import Color from 'color';
import { NgxSkeletonLoaderModule } from 'ngx-skeleton-loader'; import { NgxSkeletonLoaderModule } from 'ngx-skeleton-loader';
import OpenColor from 'open-color'; import OpenColor from 'open-color';
import { translate } from '../i18n';
const { const {
blue, blue,
cyan, cyan,
@ -390,7 +388,7 @@ export class GfPortfolioProportionChartComponent
return value > 0 return value > 0
? isUUID(symbol) ? isUUID(symbol)
? (translate(this.data[symbol]?.name) ?? symbol) ? (this.data[symbol]?.name ?? symbol)
: symbol : symbol
: ''; : '';
}, },
@ -453,7 +451,7 @@ export class GfPortfolioProportionChartComponent
symbol = $localize`No data available`; symbol = $localize`No data available`;
} }
const name = translate(this.data[symbol]?.name); const name = this.data[symbol]?.name;
let sum = 0; let sum = 0;

Loading…
Cancel
Save