Browse Source

feat(i18n): add localization for Regional Market Cluster Risks (#5107)

rohit 1 day ago
parent
commit
79fdea592a
  1. 18
      apps/api/src/models/rules/regional-market-cluster-risk/asia-pacific.ts
  2. 16
      apps/api/src/models/rules/regional-market-cluster-risk/emerging-markets.ts
  3. 16
      apps/api/src/models/rules/regional-market-cluster-risk/europe.ts
  4. 16
      apps/api/src/models/rules/regional-market-cluster-risk/japan.ts
  5. 16
      apps/api/src/models/rules/regional-market-cluster-risk/north-america.ts
  6. 3
      apps/client/src/app/pages/i18n/i18n-page.html

18
apps/api/src/models/rules/regional-market-cluster-risk/asia-pacific.ts

@ -33,23 +33,23 @@ export class RegionalMarketClusterRiskAsiaPacific extends Rule<Settings> {
if (asiaPacificMarketValueRatio > ruleSettings.thresholdMax) { if (asiaPacificMarketValueRatio > ruleSettings.thresholdMax) {
return { return {
evaluation: this.i18nService.getTranslation({ evaluation: this.i18nService.getTranslation({
languageCode: this.getLanguageCode(),
id: 'rule.regionalMarketClusterRiskAsiaPacific.false.max', id: 'rule.regionalMarketClusterRiskAsiaPacific.false.max',
languageCode: this.getLanguageCode(),
placeholders: { placeholders: {
thresholdMax: (ruleSettings.thresholdMax * 100).toPrecision(3),
valueRatio: (asiaPacificMarketValueRatio * 100).toPrecision(3), valueRatio: (asiaPacificMarketValueRatio * 100).toPrecision(3),
thresholdMax: (ruleSettings.thresholdMax * 100).toPrecision(3) },
}
}), }),
value: false value: false
}; };
} else if (asiaPacificMarketValueRatio < ruleSettings.thresholdMin) { } else if (asiaPacificMarketValueRatio < ruleSettings.thresholdMin) {
return { return {
evaluation: this.i18nService.getTranslation({ evaluation: this.i18nService.getTranslation({
languageCode: this.getLanguageCode(),
id: 'rule.regionalMarketClusterRiskAsiaPacific.false.min', id: 'rule.regionalMarketClusterRiskAsiaPacific.false.min',
languageCode: this.getLanguageCode(),
placeholders: { placeholders: {
thresholdMin: (ruleSettings.thresholdMin * 100).toPrecision(3),
valueRatio: (asiaPacificMarketValueRatio * 100).toPrecision(3), valueRatio: (asiaPacificMarketValueRatio * 100).toPrecision(3),
thresholdMin: (ruleSettings.thresholdMin * 100).toPrecision(3)
} }
}), }),
value: false value: false
@ -58,12 +58,12 @@ export class RegionalMarketClusterRiskAsiaPacific extends Rule<Settings> {
return { return {
evaluation: this.i18nService.getTranslation({ evaluation: this.i18nService.getTranslation({
languageCode: this.getLanguageCode(),
id: 'rule.regionalMarketClusterRiskAsiaPacific.true', id: 'rule.regionalMarketClusterRiskAsiaPacific.true',
languageCode: this.getLanguageCode(),
placeholders: { placeholders: {
valueRatio: (asiaPacificMarketValueRatio * 100).toPrecision(3), thresholdMax: (ruleSettings.thresholdMax * 100).toPrecision(3),
thresholdMin: (ruleSettings.thresholdMin * 100).toPrecision(3), thresholdMin: (ruleSettings.thresholdMin * 100).toPrecision(3),
thresholdMax: (ruleSettings.thresholdMax * 100).toPrecision(3) valueRatio: (asiaPacificMarketValueRatio * 100).toPrecision(3),
} }
}), }),
value: true value: true
@ -89,8 +89,8 @@ export class RegionalMarketClusterRiskAsiaPacific extends Rule<Settings> {
public getName() { public getName() {
return this.i18nService.getTranslation({ return this.i18nService.getTranslation({
id: 'rule.regionalMarketClusterRiskAsiaPacific',
languageCode: this.getLanguageCode(), languageCode: this.getLanguageCode(),
id: 'rule.regionalMarketClusterRiskAsiaPacific'
}); });
} }

16
apps/api/src/models/rules/regional-market-cluster-risk/emerging-markets.ts

@ -35,11 +35,11 @@ export class RegionalMarketClusterRiskEmergingMarkets extends Rule<Settings> {
if (emergingMarketsValueRatio > ruleSettings.thresholdMax) { if (emergingMarketsValueRatio > ruleSettings.thresholdMax) {
return { return {
evaluation: this.i18nService.getTranslation({ evaluation: this.i18nService.getTranslation({
languageCode: this.getLanguageCode(),
id: 'rule.regionalMarketClusterRiskEmergingMarkets.false.max', id: 'rule.regionalMarketClusterRiskEmergingMarkets.false.max',
languageCode: this.getLanguageCode(),
placeholders: { placeholders: {
thresholdMax: (ruleSettings.thresholdMax * 100).toPrecision(3),
valueRatio: (emergingMarketsValueRatio * 100).toPrecision(3), valueRatio: (emergingMarketsValueRatio * 100).toPrecision(3),
thresholdMax: (ruleSettings.thresholdMax * 100).toPrecision(3)
} }
}), }),
value: false value: false
@ -47,11 +47,11 @@ export class RegionalMarketClusterRiskEmergingMarkets extends Rule<Settings> {
} else if (emergingMarketsValueRatio < ruleSettings.thresholdMin) { } else if (emergingMarketsValueRatio < ruleSettings.thresholdMin) {
return { return {
evaluation: this.i18nService.getTranslation({ evaluation: this.i18nService.getTranslation({
languageCode: this.getLanguageCode(),
id: 'rule.regionalMarketClusterRiskEmergingMarkets.false.min', id: 'rule.regionalMarketClusterRiskEmergingMarkets.false.min',
languageCode: this.getLanguageCode(),
placeholders: { placeholders: {
thresholdMin: (ruleSettings.thresholdMin * 100).toPrecision(3),
valueRatio: (emergingMarketsValueRatio * 100).toPrecision(3), valueRatio: (emergingMarketsValueRatio * 100).toPrecision(3),
thresholdMin: (ruleSettings.thresholdMin * 100).toPrecision(3)
} }
}), }),
value: false value: false
@ -60,12 +60,12 @@ export class RegionalMarketClusterRiskEmergingMarkets extends Rule<Settings> {
return { return {
evaluation: this.i18nService.getTranslation({ evaluation: this.i18nService.getTranslation({
languageCode: this.getLanguageCode(),
id: 'rule.regionalMarketClusterRiskEmergingMarkets.true', id: 'rule.regionalMarketClusterRiskEmergingMarkets.true',
languageCode: this.getLanguageCode(),
placeholders: { placeholders: {
valueRatio: (emergingMarketsValueRatio * 100).toPrecision(3), thresholdMax: (ruleSettings.thresholdMax * 100).toPrecision(3),
thresholdMin: (ruleSettings.thresholdMin * 100).toPrecision(3), thresholdMin: (ruleSettings.thresholdMin * 100).toPrecision(3),
thresholdMax: (ruleSettings.thresholdMax * 100).toPrecision(3) valueRatio: (emergingMarketsValueRatio * 100).toPrecision(3),
} }
}), }),
value: true value: true
@ -91,8 +91,8 @@ export class RegionalMarketClusterRiskEmergingMarkets extends Rule<Settings> {
public getName() { public getName() {
return this.i18nService.getTranslation({ return this.i18nService.getTranslation({
id: 'rule.regionalMarketClusterRiskEmergingMarkets',
languageCode: this.getLanguageCode(), languageCode: this.getLanguageCode(),
id: 'rule.regionalMarketClusterRiskEmergingMarkets'
}); });
} }

16
apps/api/src/models/rules/regional-market-cluster-risk/europe.ts

@ -33,11 +33,11 @@ export class RegionalMarketClusterRiskEurope extends Rule<Settings> {
if (europeMarketValueRatio > ruleSettings.thresholdMax) { if (europeMarketValueRatio > ruleSettings.thresholdMax) {
return { return {
evaluation: this.i18nService.getTranslation({ evaluation: this.i18nService.getTranslation({
languageCode: this.getLanguageCode(),
id: 'rule.regionalMarketClusterRiskEurope.false.max', id: 'rule.regionalMarketClusterRiskEurope.false.max',
languageCode: this.getLanguageCode(),
placeholders: { placeholders: {
thresholdMax: (ruleSettings.thresholdMax * 100).toPrecision(3),
valueRatio: (europeMarketValueRatio * 100).toPrecision(3), valueRatio: (europeMarketValueRatio * 100).toPrecision(3),
thresholdMax: (ruleSettings.thresholdMax * 100).toPrecision(3)
} }
}), }),
value: false value: false
@ -45,11 +45,11 @@ export class RegionalMarketClusterRiskEurope extends Rule<Settings> {
} else if (europeMarketValueRatio < ruleSettings.thresholdMin) { } else if (europeMarketValueRatio < ruleSettings.thresholdMin) {
return { return {
evaluation: this.i18nService.getTranslation({ evaluation: this.i18nService.getTranslation({
languageCode: this.getLanguageCode(),
id: 'rule.regionalMarketClusterRiskEurope.false.min', id: 'rule.regionalMarketClusterRiskEurope.false.min',
languageCode: this.getLanguageCode(),
placeholders: { placeholders: {
thresholdMin: (ruleSettings.thresholdMin * 100).toPrecision(3),
valueRatio: (europeMarketValueRatio * 100).toPrecision(3), valueRatio: (europeMarketValueRatio * 100).toPrecision(3),
thresholdMin: (ruleSettings.thresholdMin * 100).toPrecision(3)
} }
}), }),
value: false value: false
@ -58,12 +58,12 @@ export class RegionalMarketClusterRiskEurope extends Rule<Settings> {
return { return {
evaluation: this.i18nService.getTranslation({ evaluation: this.i18nService.getTranslation({
languageCode: this.getLanguageCode(),
id: 'rule.regionalMarketClusterRiskEurope.true', id: 'rule.regionalMarketClusterRiskEurope.true',
languageCode: this.getLanguageCode(),
placeholders: { placeholders: {
valueRatio: (europeMarketValueRatio * 100).toPrecision(3), thresholdMax: (ruleSettings.thresholdMax * 100).toPrecision(3),
thresholdMin: (ruleSettings.thresholdMin * 100).toPrecision(3), thresholdMin: (ruleSettings.thresholdMin * 100).toPrecision(3),
thresholdMax: (ruleSettings.thresholdMax * 100).toPrecision(3) valueRatio: (europeMarketValueRatio * 100).toPrecision(3),
} }
}), }),
value: true value: true
@ -89,8 +89,8 @@ export class RegionalMarketClusterRiskEurope extends Rule<Settings> {
public getName() { public getName() {
return this.i18nService.getTranslation({ return this.i18nService.getTranslation({
id: 'rule.regionalMarketClusterRiskEurope',
languageCode: this.getLanguageCode(), languageCode: this.getLanguageCode(),
id: 'rule.regionalMarketClusterRiskEurope'
}); });
} }

16
apps/api/src/models/rules/regional-market-cluster-risk/japan.ts

@ -33,11 +33,11 @@ export class RegionalMarketClusterRiskJapan extends Rule<Settings> {
if (japanMarketValueRatio > ruleSettings.thresholdMax) { if (japanMarketValueRatio > ruleSettings.thresholdMax) {
return { return {
evaluation: this.i18nService.getTranslation({ evaluation: this.i18nService.getTranslation({
languageCode: this.getLanguageCode(),
id: 'rule.regionalMarketClusterRiskJapan.false.max', id: 'rule.regionalMarketClusterRiskJapan.false.max',
languageCode: this.getLanguageCode(),
placeholders: { placeholders: {
thresholdMax: (ruleSettings.thresholdMax * 100).toPrecision(3),
valueRatio: (japanMarketValueRatio * 100).toPrecision(3), valueRatio: (japanMarketValueRatio * 100).toPrecision(3),
thresholdMax: (ruleSettings.thresholdMax * 100).toPrecision(3)
} }
}), }),
value: false value: false
@ -45,11 +45,11 @@ export class RegionalMarketClusterRiskJapan extends Rule<Settings> {
} else if (japanMarketValueRatio < ruleSettings.thresholdMin) { } else if (japanMarketValueRatio < ruleSettings.thresholdMin) {
return { return {
evaluation: this.i18nService.getTranslation({ evaluation: this.i18nService.getTranslation({
languageCode: this.getLanguageCode(),
id: 'rule.regionalMarketClusterRiskJapan.false.min', id: 'rule.regionalMarketClusterRiskJapan.false.min',
languageCode: this.getLanguageCode(),
placeholders: { placeholders: {
thresholdMin: (ruleSettings.thresholdMin * 100).toPrecision(3),
valueRatio: (japanMarketValueRatio * 100).toPrecision(3), valueRatio: (japanMarketValueRatio * 100).toPrecision(3),
thresholdMin: (ruleSettings.thresholdMin * 100).toPrecision(3)
} }
}), }),
value: false value: false
@ -58,12 +58,12 @@ export class RegionalMarketClusterRiskJapan extends Rule<Settings> {
return { return {
evaluation: this.i18nService.getTranslation({ evaluation: this.i18nService.getTranslation({
languageCode: this.getLanguageCode(),
id: 'rule.regionalMarketClusterRiskJapan.true', id: 'rule.regionalMarketClusterRiskJapan.true',
languageCode: this.getLanguageCode(),
placeholders: { placeholders: {
valueRatio: (japanMarketValueRatio * 100).toPrecision(3), thresholdMax: (ruleSettings.thresholdMax * 100).toPrecision(3),
thresholdMin: (ruleSettings.thresholdMin * 100).toPrecision(3), thresholdMin: (ruleSettings.thresholdMin * 100).toPrecision(3),
thresholdMax: (ruleSettings.thresholdMax * 100).toPrecision(3) valueRatio: (japanMarketValueRatio * 100).toPrecision(3),
} }
}), }),
value: true value: true
@ -89,8 +89,8 @@ export class RegionalMarketClusterRiskJapan extends Rule<Settings> {
public getName() { public getName() {
return this.i18nService.getTranslation({ return this.i18nService.getTranslation({
id: 'rule.regionalMarketClusterRiskJapan',
languageCode: this.getLanguageCode(), languageCode: this.getLanguageCode(),
id: 'rule.regionalMarketClusterRiskJapan'
}); });
} }

16
apps/api/src/models/rules/regional-market-cluster-risk/north-america.ts

@ -33,11 +33,11 @@ export class RegionalMarketClusterRiskNorthAmerica extends Rule<Settings> {
if (northAmericaMarketValueRatio > ruleSettings.thresholdMax) { if (northAmericaMarketValueRatio > ruleSettings.thresholdMax) {
return { return {
evaluation: this.i18nService.getTranslation({ evaluation: this.i18nService.getTranslation({
languageCode: this.getLanguageCode(),
id: 'rule.regionalMarketClusterRiskNorthAmerica.false.max', id: 'rule.regionalMarketClusterRiskNorthAmerica.false.max',
languageCode: this.getLanguageCode(),
placeholders: { placeholders: {
thresholdMax: (ruleSettings.thresholdMax * 100).toPrecision(3),
valueRatio: (northAmericaMarketValueRatio * 100).toPrecision(3), valueRatio: (northAmericaMarketValueRatio * 100).toPrecision(3),
thresholdMax: (ruleSettings.thresholdMax * 100).toPrecision(3)
} }
}), }),
value: false value: false
@ -45,11 +45,11 @@ export class RegionalMarketClusterRiskNorthAmerica extends Rule<Settings> {
} else if (northAmericaMarketValueRatio < ruleSettings.thresholdMin) { } else if (northAmericaMarketValueRatio < ruleSettings.thresholdMin) {
return { return {
evaluation: this.i18nService.getTranslation({ evaluation: this.i18nService.getTranslation({
languageCode: this.getLanguageCode(),
id: 'rule.regionalMarketClusterRiskNorthAmerica.false.min', id: 'rule.regionalMarketClusterRiskNorthAmerica.false.min',
languageCode: this.getLanguageCode(),
placeholders: { placeholders: {
thresholdMin: (ruleSettings.thresholdMin * 100).toPrecision(3),
valueRatio: (northAmericaMarketValueRatio * 100).toPrecision(3), valueRatio: (northAmericaMarketValueRatio * 100).toPrecision(3),
thresholdMin: (ruleSettings.thresholdMin * 100).toPrecision(3)
} }
}), }),
value: false value: false
@ -58,12 +58,12 @@ export class RegionalMarketClusterRiskNorthAmerica extends Rule<Settings> {
return { return {
evaluation: this.i18nService.getTranslation({ evaluation: this.i18nService.getTranslation({
languageCode: this.getLanguageCode(),
id: 'rule.regionalMarketClusterRiskNorthAmerica.true', id: 'rule.regionalMarketClusterRiskNorthAmerica.true',
languageCode: this.getLanguageCode(),
placeholders: { placeholders: {
valueRatio: (northAmericaMarketValueRatio * 100).toPrecision(3), thresholdMax: (ruleSettings.thresholdMax * 100).toPrecision(3),
thresholdMin: (ruleSettings.thresholdMin * 100).toPrecision(3), thresholdMin: (ruleSettings.thresholdMin * 100).toPrecision(3),
thresholdMax: (ruleSettings.thresholdMax * 100).toPrecision(3) valueRatio: (northAmericaMarketValueRatio * 100).toPrecision(3),
} }
}), }),
value: true value: true
@ -89,8 +89,8 @@ export class RegionalMarketClusterRiskNorthAmerica extends Rule<Settings> {
public getName() { public getName() {
return this.i18nService.getTranslation({ return this.i18nService.getTranslation({
id: 'rule.regionalMarketClusterRiskNorthAmerica',
languageCode: this.getLanguageCode(), languageCode: this.getLanguageCode(),
id: 'rule.regionalMarketClusterRiskNorthAmerica'
}); });
} }

3
apps/client/src/app/pages/i18n/i18n-page.html

@ -26,7 +26,6 @@
($&#123;valueRatio&#125;%) is within the range of ($&#123;valueRatio&#125;%) is within the range of
$&#123;thresholdMin&#125;% and $&#123;thresholdMax&#125;% $&#123;thresholdMin&#125;% and $&#123;thresholdMax&#125;%
</li> </li>
<li i18n="@@rule.regionalMarketClusterRiskEmergingMarkets"> <li i18n="@@rule.regionalMarketClusterRiskEmergingMarkets">
Emerging Markets Emerging Markets
</li> </li>
@ -43,7 +42,6 @@
($&#123;valueRatio&#125;%) is within the range of ($&#123;valueRatio&#125;%) is within the range of
$&#123;thresholdMin&#125;% and $&#123;thresholdMax&#125;% $&#123;thresholdMin&#125;% and $&#123;thresholdMax&#125;%
</li> </li>
<li i18n="@@rule.regionalMarketClusterRiskEurope">Europe</li> <li i18n="@@rule.regionalMarketClusterRiskEurope">Europe</li>
<li i18n="@@rule.regionalMarketClusterRiskEurope.false.max"> <li i18n="@@rule.regionalMarketClusterRiskEurope.false.max">
The Europe market contribution of your current investment The Europe market contribution of your current investment
@ -58,7 +56,6 @@
($&#123;valueRatio&#125;%) is within the range of ($&#123;valueRatio&#125;%) is within the range of
$&#123;thresholdMin&#125;% and $&#123;thresholdMax&#125;% $&#123;thresholdMin&#125;% and $&#123;thresholdMax&#125;%
</li> </li>
<li i18n="@@rule.regionalMarketClusterRiskJapan">Japan</li> <li i18n="@@rule.regionalMarketClusterRiskJapan">Japan</li>
<li i18n="@@rule.regionalMarketClusterRiskJapan.false.max"> <li i18n="@@rule.regionalMarketClusterRiskJapan.false.max">
The Japan market contribution of your current investment The Japan market contribution of your current investment

Loading…
Cancel
Save