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) {
this.countries[code] = {
name,
name: translate(name),
value: weight
};
}

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

@ -269,7 +269,7 @@
i18n
size="medium"
[locale]="data.locale"
[value]="assetProfile?.countries[0].name"
[value]="translate(assetProfile?.countries[0].name)"
>Country</gf-value
>
</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) {
for (const country of SymbolProfile.countries) {
this.countries[country.code] = {
name: country.name,
name: translate(country.name),
value: country.weight
};
}

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

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

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

@ -363,7 +363,7 @@ export class GfAllocationsPageComponent implements OnInit {
: position.valueInPercentage);
} else {
this.continents[continent] = {
name: continent,
name: translate(continent),
value:
weight *
(isNumber(position.valueInBaseCurrency)
@ -380,7 +380,7 @@ export class GfAllocationsPageComponent implements OnInit {
: position.valueInPercentage);
} else {
this.countries[code] = {
name,
name: translate(name),
value:
weight *
(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);
} else {
this.continents[continent] = {
name: continent,
name: translate(continent),
value:
weight *
(this.publicPortfolioDetails.holdings[symbol]
@ -206,7 +206,7 @@ export class GfPublicPageComponent implements OnInit {
weight * (position.valueInBaseCurrency ?? 0);
} else {
this.countries[code] = {
name,
name: translate(name),
value:
weight *
(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 OpenColor from 'open-color';
import { translate } from '../i18n';
const {
blue,
cyan,
@ -390,7 +388,7 @@ export class GfPortfolioProportionChartComponent
return value > 0
? isUUID(symbol)
? (translate(this.data[symbol]?.name) ?? symbol)
? (this.data[symbol]?.name ?? symbol)
: symbol
: '';
},
@ -453,7 +451,7 @@ export class GfPortfolioProportionChartComponent
symbol = $localize`No data available`;
}
const name = translate(this.data[symbol]?.name);
const name = this.data[symbol]?.name;
let sum = 0;

Loading…
Cancel
Save