From a916ebb3b1c91f8e96680293cb07bb79cf32e5df Mon Sep 17 00:00:00 2001 From: rohit Date: Sun, 20 Jul 2025 16:13:04 +0530 Subject: [PATCH] fix(i18n): finalize localization setup for Regional Market Cluster Risks - Renamed regionClusterRisk to regionalClusterRisk across rule files - Fixed placeholder ordering and removed redundant lines - Corrected translation texts and cleaned up i18n files - Followed reviewer suggestions in PR #5145a --- .../asia-pacific.ts | 11 ++--- .../emerging-markets.ts | 11 ++--- .../regional-market-cluster-risk/europe.ts | 11 ++--- .../regional-market-cluster-risk/japan.ts | 11 ++--- .../north-america.ts | 11 ++--- apps/client/src/app/pages/i18n/i18n-page.html | 47 ++++++++++--------- 6 files changed, 51 insertions(+), 51 deletions(-) diff --git a/apps/api/src/models/rules/regional-market-cluster-risk/asia-pacific.ts b/apps/api/src/models/rules/regional-market-cluster-risk/asia-pacific.ts index 813e9479b..616a56b78 100644 --- a/apps/api/src/models/rules/regional-market-cluster-risk/asia-pacific.ts +++ b/apps/api/src/models/rules/regional-market-cluster-risk/asia-pacific.ts @@ -33,8 +33,8 @@ export class RegionalMarketClusterRiskAsiaPacific extends Rule { if (asiaPacificMarketValueRatio > ruleSettings.thresholdMax) { return { evaluation: this.i18nService.getTranslation({ - id: 'rule.regionClusterRiskAsiaPacific.false.max', languageCode: this.getLanguageCode(), + id: 'rule.regionalMarketClusterRiskAsiaPacific.false.max', placeholders: { valueRatio: (asiaPacificMarketValueRatio * 100).toPrecision(3), thresholdMax: (ruleSettings.thresholdMax * 100).toPrecision(3) @@ -45,8 +45,8 @@ export class RegionalMarketClusterRiskAsiaPacific extends Rule { } else if (asiaPacificMarketValueRatio < ruleSettings.thresholdMin) { return { evaluation: this.i18nService.getTranslation({ - id: 'rule.regionClusterRiskAsiaPacific.false.min', languageCode: this.getLanguageCode(), + id: 'rule.regionalMarketClusterRiskAsiaPacific.false.min', placeholders: { valueRatio: (asiaPacificMarketValueRatio * 100).toPrecision(3), thresholdMin: (ruleSettings.thresholdMin * 100).toPrecision(3) @@ -58,8 +58,8 @@ export class RegionalMarketClusterRiskAsiaPacific extends Rule { return { evaluation: this.i18nService.getTranslation({ - id: 'rule.regionClusterRiskAsiaPacific.true', languageCode: this.getLanguageCode(), + id: 'rule.regionalMarketClusterRiskAsiaPacific.true', placeholders: { valueRatio: (asiaPacificMarketValueRatio * 100).toPrecision(3), thresholdMin: (ruleSettings.thresholdMin * 100).toPrecision(3), @@ -89,10 +89,9 @@ export class RegionalMarketClusterRiskAsiaPacific extends Rule { public getName() { return this.i18nService.getTranslation({ - id: 'rule.regionClusterRiskAsiaPacific', - languageCode: this.getLanguageCode() + languageCode: this.getLanguageCode(), + id: 'rule.regionalMarketClusterRiskAsiaPacific' }); - return 'Asia-Pacific'; } public getSettings({ baseCurrency, xRayRules }: UserSettings): Settings { diff --git a/apps/api/src/models/rules/regional-market-cluster-risk/emerging-markets.ts b/apps/api/src/models/rules/regional-market-cluster-risk/emerging-markets.ts index f25bee18a..6b164603d 100644 --- a/apps/api/src/models/rules/regional-market-cluster-risk/emerging-markets.ts +++ b/apps/api/src/models/rules/regional-market-cluster-risk/emerging-markets.ts @@ -35,8 +35,8 @@ export class RegionalMarketClusterRiskEmergingMarkets extends Rule { if (emergingMarketsValueRatio > ruleSettings.thresholdMax) { return { evaluation: this.i18nService.getTranslation({ - id: 'rule.regionClusterRiskEmergingMarkets.false.max', languageCode: this.getLanguageCode(), + id: 'rule.regionalMarketClusterRiskEmergingMarkets.false.max', placeholders: { valueRatio: (emergingMarketsValueRatio * 100).toPrecision(3), thresholdMax: (ruleSettings.thresholdMax * 100).toPrecision(3) @@ -47,8 +47,8 @@ export class RegionalMarketClusterRiskEmergingMarkets extends Rule { } else if (emergingMarketsValueRatio < ruleSettings.thresholdMin) { return { evaluation: this.i18nService.getTranslation({ - id: 'rule.regionClusterRiskEmergingMarkets.false.min', languageCode: this.getLanguageCode(), + id: 'rule.regionalMarketClusterRiskEmergingMarkets.false.min', placeholders: { valueRatio: (emergingMarketsValueRatio * 100).toPrecision(3), thresholdMin: (ruleSettings.thresholdMin * 100).toPrecision(3) @@ -60,8 +60,8 @@ export class RegionalMarketClusterRiskEmergingMarkets extends Rule { return { evaluation: this.i18nService.getTranslation({ - id: 'rule.regionClusterRiskEmergingMarkets.true', languageCode: this.getLanguageCode(), + id: 'rule.regionalMarketClusterRiskEmergingMarkets.true', placeholders: { valueRatio: (emergingMarketsValueRatio * 100).toPrecision(3), thresholdMin: (ruleSettings.thresholdMin * 100).toPrecision(3), @@ -91,10 +91,9 @@ export class RegionalMarketClusterRiskEmergingMarkets extends Rule { public getName() { return this.i18nService.getTranslation({ - id: 'rule.regionClusterRiskEmergingMarkets', - languageCode: this.getLanguageCode() + languageCode: this.getLanguageCode(), + id: 'rule.regionalMarketClusterRiskEmergingMarkets' }); - return 'Emerging Markets'; } public getSettings({ baseCurrency, xRayRules }: UserSettings): Settings { diff --git a/apps/api/src/models/rules/regional-market-cluster-risk/europe.ts b/apps/api/src/models/rules/regional-market-cluster-risk/europe.ts index f4e1cc6f6..55ac3ffb2 100644 --- a/apps/api/src/models/rules/regional-market-cluster-risk/europe.ts +++ b/apps/api/src/models/rules/regional-market-cluster-risk/europe.ts @@ -33,8 +33,8 @@ export class RegionalMarketClusterRiskEurope extends Rule { if (europeMarketValueRatio > ruleSettings.thresholdMax) { return { evaluation: this.i18nService.getTranslation({ - id: 'rule.regionClusterRiskEurope.false.max', languageCode: this.getLanguageCode(), + id: 'rule.regionalMarketClusterRiskEurope.false.max', placeholders: { valueRatio: (europeMarketValueRatio * 100).toPrecision(3), thresholdMax: (ruleSettings.thresholdMax * 100).toPrecision(3) @@ -45,8 +45,8 @@ export class RegionalMarketClusterRiskEurope extends Rule { } else if (europeMarketValueRatio < ruleSettings.thresholdMin) { return { evaluation: this.i18nService.getTranslation({ - id: 'rule.regionClusterRiskEurope.false.min', languageCode: this.getLanguageCode(), + id: 'rule.regionalMarketClusterRiskEurope.false.min', placeholders: { valueRatio: (europeMarketValueRatio * 100).toPrecision(3), thresholdMin: (ruleSettings.thresholdMin * 100).toPrecision(3) @@ -58,8 +58,8 @@ export class RegionalMarketClusterRiskEurope extends Rule { return { evaluation: this.i18nService.getTranslation({ - id: 'rule.regionClusterRiskEurope.true', languageCode: this.getLanguageCode(), + id: 'rule.regionalMarketClusterRiskEurope.true', placeholders: { valueRatio: (europeMarketValueRatio * 100).toPrecision(3), thresholdMin: (ruleSettings.thresholdMin * 100).toPrecision(3), @@ -89,10 +89,9 @@ export class RegionalMarketClusterRiskEurope extends Rule { public getName() { return this.i18nService.getTranslation({ - id: 'rule.regionClusterRiskEurope', - languageCode: this.getLanguageCode() + languageCode: this.getLanguageCode(), + id: 'rule.regionalMarketClusterRiskEurope' }); - return 'Europe'; } public getSettings({ baseCurrency, xRayRules }: UserSettings): Settings { diff --git a/apps/api/src/models/rules/regional-market-cluster-risk/japan.ts b/apps/api/src/models/rules/regional-market-cluster-risk/japan.ts index f6d3d1145..6107a4826 100644 --- a/apps/api/src/models/rules/regional-market-cluster-risk/japan.ts +++ b/apps/api/src/models/rules/regional-market-cluster-risk/japan.ts @@ -33,8 +33,8 @@ export class RegionalMarketClusterRiskJapan extends Rule { if (japanMarketValueRatio > ruleSettings.thresholdMax) { return { evaluation: this.i18nService.getTranslation({ - id: 'rule.regionClusterRiskJapan.false.max', languageCode: this.getLanguageCode(), + id: 'rule.regionalMarketClusterRiskJapan.false.max', placeholders: { valueRatio: (japanMarketValueRatio * 100).toPrecision(3), thresholdMax: (ruleSettings.thresholdMax * 100).toPrecision(3) @@ -45,8 +45,8 @@ export class RegionalMarketClusterRiskJapan extends Rule { } else if (japanMarketValueRatio < ruleSettings.thresholdMin) { return { evaluation: this.i18nService.getTranslation({ - id: 'rule.regionClusterRiskJapan.false.min', languageCode: this.getLanguageCode(), + id: 'rule.regionalMarketClusterRiskJapan.false.min', placeholders: { valueRatio: (japanMarketValueRatio * 100).toPrecision(3), thresholdMin: (ruleSettings.thresholdMin * 100).toPrecision(3) @@ -58,8 +58,8 @@ export class RegionalMarketClusterRiskJapan extends Rule { return { evaluation: this.i18nService.getTranslation({ - id: 'rule.regionClusterRiskJapan.true', languageCode: this.getLanguageCode(), + id: 'rule.regionalMarketClusterRiskJapan.true', placeholders: { valueRatio: (japanMarketValueRatio * 100).toPrecision(3), thresholdMin: (ruleSettings.thresholdMin * 100).toPrecision(3), @@ -89,10 +89,9 @@ export class RegionalMarketClusterRiskJapan extends Rule { public getName() { return this.i18nService.getTranslation({ - id: 'rule.regionClusterRiskJapan', - languageCode: this.getLanguageCode() + languageCode: this.getLanguageCode(), + id: 'rule.regionalMarketClusterRiskJapan' }); - return 'Japan'; } public getSettings({ baseCurrency, xRayRules }: UserSettings): Settings { diff --git a/apps/api/src/models/rules/regional-market-cluster-risk/north-america.ts b/apps/api/src/models/rules/regional-market-cluster-risk/north-america.ts index cc52179b1..62dd197cd 100644 --- a/apps/api/src/models/rules/regional-market-cluster-risk/north-america.ts +++ b/apps/api/src/models/rules/regional-market-cluster-risk/north-america.ts @@ -33,8 +33,8 @@ export class RegionalMarketClusterRiskNorthAmerica extends Rule { if (northAmericaMarketValueRatio > ruleSettings.thresholdMax) { return { evaluation: this.i18nService.getTranslation({ - id: 'rule.regionClusterRiskNorthAmerica.false.max', languageCode: this.getLanguageCode(), + id: 'rule.regionalMarketClusterRiskNorthAmerica.false.max', placeholders: { valueRatio: (northAmericaMarketValueRatio * 100).toPrecision(3), thresholdMax: (ruleSettings.thresholdMax * 100).toPrecision(3) @@ -45,8 +45,8 @@ export class RegionalMarketClusterRiskNorthAmerica extends Rule { } else if (northAmericaMarketValueRatio < ruleSettings.thresholdMin) { return { evaluation: this.i18nService.getTranslation({ - id: 'rule.regionClusterRiskNorthAmerica.false.min', languageCode: this.getLanguageCode(), + id: 'rule.regionalMarketClusterRiskNorthAmerica.false.min', placeholders: { valueRatio: (northAmericaMarketValueRatio * 100).toPrecision(3), thresholdMin: (ruleSettings.thresholdMin * 100).toPrecision(3) @@ -58,8 +58,8 @@ export class RegionalMarketClusterRiskNorthAmerica extends Rule { return { evaluation: this.i18nService.getTranslation({ - id: 'rule.regionClusterRiskNorthAmerica.true', languageCode: this.getLanguageCode(), + id: 'rule.regionalMarketClusterRiskNorthAmerica.true', placeholders: { valueRatio: (northAmericaMarketValueRatio * 100).toPrecision(3), thresholdMin: (ruleSettings.thresholdMin * 100).toPrecision(3), @@ -89,10 +89,9 @@ export class RegionalMarketClusterRiskNorthAmerica extends Rule { public getName() { return this.i18nService.getTranslation({ - id: 'rule.regionClusterRiskNorthAmerica', - languageCode: this.getLanguageCode() + languageCode: this.getLanguageCode(), + id: 'rule.regionalMarketClusterRiskNorthAmerica' }); - return 'North America'; } public getSettings({ baseCurrency, xRayRules }: UserSettings): Settings { diff --git a/apps/client/src/app/pages/i18n/i18n-page.html b/apps/client/src/app/pages/i18n/i18n-page.html index 0d521d836..4f153490b 100644 --- a/apps/client/src/app/pages/i18n/i18n-page.html +++ b/apps/client/src/app/pages/i18n/i18n-page.html @@ -12,73 +12,78 @@
  • My Account
  • Account Cluster Risks
  • -
  • Asia-Pacific
  • -
  • +
  • Asia-Pacific
  • +
  • The Asia-Pacific market contribution of your current investment - (${valueRatio}%) is exceeds ${thresholdMax}% + (${valueRatio}%) exceeds ${thresholdMax}%
  • -
  • +
  • The Asia-Pacific market contribution of your current investment (${valueRatio}%) is below ${thresholdMin}%
  • -
  • +
  • The Asia-Pacific market contribution of your current investment (${valueRatio}%) is within the range of ${thresholdMin}% and ${thresholdMax}%
  • -
  • Emerging Markets
  • -
  • + +
  • + Emerging Markets +
  • +
  • The Emerging Markets contribution of your current investment (${valueRatio}%) exceeds ${thresholdMax}%
  • -
  • +
  • The Emerging Markets contribution of your current investment (${valueRatio}%) is below ${thresholdMin}%
  • -
  • +
  • The Emerging Markets contribution of your current investment (${valueRatio}%) is within the range of ${thresholdMin}% and ${thresholdMax}%
  • -
  • Europe
  • -
  • +
  • Europe
  • +
  • The Europe market contribution of your current investment (${valueRatio}%) exceeds ${thresholdMax}%
  • -
  • +
  • The Europe market contribution of your current investment (${valueRatio}%) is below ${thresholdMin}%
  • -
  • +
  • The Europe market contribution of your current investment (${valueRatio}%) is within the range of ${thresholdMin}% and ${thresholdMax}%
  • -
  • Japan
  • -
  • + +
  • Japan
  • +
  • The Japan market contribution of your current investment (${valueRatio}%) exceeds ${thresholdMax}%
  • -
  • +
  • The Japan market contribution of your current investment (${valueRatio}%) is below ${thresholdMin}%
  • -
  • +
  • The Japan market contribution of your current investment (${valueRatio}%) is within the range of ${thresholdMin}% and ${thresholdMax}%
  • -
  • North America
  • -
  • + +
  • North America
  • +
  • The North America market contribution of your current investment (${valueRatio}%) exceeds ${thresholdMax}%
  • -
  • +
  • The North America market contribution of your current investment (${valueRatio}%) is below ${thresholdMin}%
  • -
  • +
  • The North America market contribution of your current investment (${valueRatio}%) is within the range of ${thresholdMin}% and ${thresholdMax}%