Skip to content

Open Source Wealth Management Software. Angular + NestJS + Prisma + Nx + TypeScript 🤍

Feature/support translated tags (#1600)

Thomas Kaul0878941c4fdd
diff --git a/CHANGELOG.md b/CHANGELOG.md
index 950048731b..0ba82f65b2 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -7,6 +7,10 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
## Unreleased
+### Added
+
+- Added support for translated tags
+
### Changed
- Improved the logo alignment
diff --git a/apps/client/src/app/components/position/position-detail-dialog/position-detail-dialog.component.ts b/apps/client/src/app/components/position/position-detail-dialog/position-detail-dialog.component.ts
index 8d19b846e6..870971cbc7 100644
--- a/apps/client/src/app/components/position/position-detail-dialog/position-detail-dialog.component.ts
+++ b/apps/client/src/app/components/position/position-detail-dialog/position-detail-dialog.component.ts
@@ -125,7 +125,12 @@ export class PositionDetailDialog implements OnDestroy, OnInit {
this.quantity = quantity;
this.sectors = {};
this.SymbolProfile = SymbolProfile;
- this.tags = tags;
+ this.tags = tags.map(({ id, name }) => {
+ return {
+ id,
+ name: translate(name)
+ };
+ });
this.transactionCount = transactionCount;
this.value = value;
diff --git a/apps/client/src/app/pages/portfolio/activities/create-or-update-activity-dialog/create-or-update-activity-dialog.component.ts b/apps/client/src/app/pages/portfolio/activities/create-or-update-activity-dialog/create-or-update-activity-dialog.component.ts
index d4a876bc73..f9f5a595f3 100644
--- a/apps/client/src/app/pages/portfolio/activities/create-or-update-activity-dialog/create-or-update-activity-dialog.component.ts
+++ b/apps/client/src/app/pages/portfolio/activities/create-or-update-activity-dialog/create-or-update-activity-dialog.component.ts
@@ -83,7 +83,12 @@ export class CreateOrUpdateActivityDialog implements OnDestroy {
this.currencies = currencies;
this.platforms = platforms;
- this.tags = tags;
+ this.tags = tags.map(({ id, name }) => {
+ return {
+ id,
+ name: translate(name)
+ };
+ });
this.activityForm = this.formBuilder.group({
accountId: [this.data.activity?.accountId, Validators.required],
@@ -114,7 +119,14 @@ export class CreateOrUpdateActivityDialog implements OnDestroy {
},
Validators.required
],
- tags: [this.data.activity?.tags],
+ tags: [
+ this.data.activity?.tags.map(({ id, name }) => {
+ return {
+ id,
+ name: translate(name)
+ };
+ })
+ ],
type: [undefined, Validators.required], // Set after value changes subscription
unitPrice: [this.data.activity?.unitPrice, Validators.required]
});
diff --git a/apps/client/src/app/pages/portfolio/allocations/allocations-page.component.ts b/apps/client/src/app/pages/portfolio/allocations/allocations-page.component.ts
index 16cad4a907..6a5a57c823 100644
--- a/apps/client/src/app/pages/portfolio/allocations/allocations-page.component.ts
+++ b/apps/client/src/app/pages/portfolio/allocations/allocations-page.component.ts
@@ -183,7 +183,7 @@ export class AllocationsPageComponent implements OnDestroy, OnInit {
const tagFilters: Filter[] = this.user.tags.map(({ id, name }) => {
return {
id,
- label: name,
+ label: translate(name),
type: 'TAG'
};
});
diff --git a/apps/client/src/app/pages/portfolio/analysis/analysis-page.component.ts b/apps/client/src/app/pages/portfolio/analysis/analysis-page.component.ts
index 84a0be896b..e91c13a11c 100644
--- a/apps/client/src/app/pages/portfolio/analysis/analysis-page.component.ts
+++ b/apps/client/src/app/pages/portfolio/analysis/analysis-page.component.ts
@@ -159,7 +159,7 @@ export class AnalysisPageComponent implements OnDestroy, OnInit {
const tagFilters: Filter[] = this.user.tags.map(({ id, name }) => {
return {
id,
- label: name,
+ label: translate(name),
type: 'TAG'
};
});
diff --git a/apps/client/src/app/pages/portfolio/holdings/holdings-page.component.ts b/apps/client/src/app/pages/portfolio/holdings/holdings-page.component.ts
index 16f96a7009..64fe3d7c52 100644
--- a/apps/client/src/app/pages/portfolio/holdings/holdings-page.component.ts
+++ b/apps/client/src/app/pages/portfolio/holdings/holdings-page.component.ts
@@ -138,7 +138,7 @@ export class HoldingsPageComponent implements OnDestroy, OnInit {
const tagFilters: Filter[] = this.user.tags.map(({ id, name }) => {
return {
id,
- label: name,
+ label: translate(name),
type: 'TAG'
};
});
diff --git a/libs/ui/src/lib/i18n.ts b/libs/ui/src/lib/i18n.ts
index 58021d194f..d0f913abc7 100644
--- a/libs/ui/src/lib/i18n.ts
+++ b/libs/ui/src/lib/i18n.ts
@@ -4,8 +4,14 @@ const locales = {
ACCOUNT: $localize`Account`,
ASSET_CLASS: $localize`Asset Class`,
ASSET_SUB_CLASS: $localize`Asset Sub Class`,
+ CORE: $localize`Core`,
EMERGENCY_FUND: $localize`Emergency Fund`,
+ GRANT: $localize`Grant`,
+ HIGHER_RISK: $localize`Higher Risk`,
+ LOWER_RISK: $localize`Lower Risk`,
OTHER: $localize`Other`,
+ RETIREMENT_PROVISION: $localize`Retirement Provision`,
+ SATELLITE: $localize`Satellite`,
SECURITIES: $localize`Securities`,
SYMBOL: $localize`Symbol`,
TAG: $localize`Tag`,