Browse Source

Feature/Set up language localization for Regional Market Cluster Risks

- Added i18n support setup for static X-ray rule: Regional Market
Cluster Risks
- Followed the approach in #4959 as guidance

Note:
I haven’t made changes to the `.xlf` files yet. I understand they can be
generated using `i18n-page.html`, but when I tried, the generated files
didn’t include the expected translation entries for this rule.

Should I manually update all `.xlf` files to add the translations?
rohit 2 weeks ago
parent
commit
73bc485184
  1. 10
      apps/api/src/app/portfolio/portfolio.service.ts
  2. 10
      apps/api/src/app/user/user.service.ts
  3. 44
      apps/api/src/models/rules/regional-market-cluster-risk/asia-pacific.ts
  4. 44
      apps/api/src/models/rules/regional-market-cluster-risk/emerging-markets.ts
  5. 44
      apps/api/src/models/rules/regional-market-cluster-risk/europe.ts
  6. 44
      apps/api/src/models/rules/regional-market-cluster-risk/japan.ts
  7. 44
      apps/api/src/models/rules/regional-market-cluster-risk/north-america.ts
  8. 71
      apps/client/src/app/pages/i18n/i18n-page.html

10
apps/api/src/app/portfolio/portfolio.service.ts

@ -1272,26 +1272,36 @@ export class PortfolioService {
[ [
new RegionalMarketClusterRiskAsiaPacific( new RegionalMarketClusterRiskAsiaPacific(
this.exchangeRateDataService, this.exchangeRateDataService,
this.i18nService,
userSettings.language,
marketsAdvancedTotalInBaseCurrency, marketsAdvancedTotalInBaseCurrency,
marketsAdvanced.asiaPacific.valueInBaseCurrency marketsAdvanced.asiaPacific.valueInBaseCurrency
), ),
new RegionalMarketClusterRiskEmergingMarkets( new RegionalMarketClusterRiskEmergingMarkets(
this.exchangeRateDataService, this.exchangeRateDataService,
this.i18nService,
userSettings.language,
marketsAdvancedTotalInBaseCurrency, marketsAdvancedTotalInBaseCurrency,
marketsAdvanced.emergingMarkets.valueInBaseCurrency marketsAdvanced.emergingMarkets.valueInBaseCurrency
), ),
new RegionalMarketClusterRiskEurope( new RegionalMarketClusterRiskEurope(
this.exchangeRateDataService, this.exchangeRateDataService,
this.i18nService,
userSettings.language,
marketsAdvancedTotalInBaseCurrency, marketsAdvancedTotalInBaseCurrency,
marketsAdvanced.europe.valueInBaseCurrency marketsAdvanced.europe.valueInBaseCurrency
), ),
new RegionalMarketClusterRiskJapan( new RegionalMarketClusterRiskJapan(
this.exchangeRateDataService, this.exchangeRateDataService,
this.i18nService,
userSettings.language,
marketsAdvancedTotalInBaseCurrency, marketsAdvancedTotalInBaseCurrency,
marketsAdvanced.japan.valueInBaseCurrency marketsAdvanced.japan.valueInBaseCurrency
), ),
new RegionalMarketClusterRiskNorthAmerica( new RegionalMarketClusterRiskNorthAmerica(
this.exchangeRateDataService, this.exchangeRateDataService,
this.i18nService,
userSettings.language,
marketsAdvancedTotalInBaseCurrency, marketsAdvancedTotalInBaseCurrency,
marketsAdvanced.northAmerica.valueInBaseCurrency marketsAdvanced.northAmerica.valueInBaseCurrency
) )

10
apps/api/src/app/user/user.service.ts

@ -329,28 +329,38 @@ export class UserService {
).getSettings(user.settings.settings), ).getSettings(user.settings.settings),
RegionalMarketClusterRiskAsiaPacific: RegionalMarketClusterRiskAsiaPacific:
new RegionalMarketClusterRiskAsiaPacific( new RegionalMarketClusterRiskAsiaPacific(
undefined,
undefined,
undefined, undefined,
undefined, undefined,
undefined undefined
).getSettings(user.settings.settings), ).getSettings(user.settings.settings),
RegionalMarketClusterRiskEmergingMarkets: RegionalMarketClusterRiskEmergingMarkets:
new RegionalMarketClusterRiskEmergingMarkets( new RegionalMarketClusterRiskEmergingMarkets(
undefined,
undefined,
undefined, undefined,
undefined, undefined,
undefined undefined
).getSettings(user.settings.settings), ).getSettings(user.settings.settings),
RegionalMarketClusterRiskEurope: new RegionalMarketClusterRiskEurope( RegionalMarketClusterRiskEurope: new RegionalMarketClusterRiskEurope(
undefined,
undefined,
undefined, undefined,
undefined, undefined,
undefined undefined
).getSettings(user.settings.settings), ).getSettings(user.settings.settings),
RegionalMarketClusterRiskJapan: new RegionalMarketClusterRiskJapan( RegionalMarketClusterRiskJapan: new RegionalMarketClusterRiskJapan(
undefined,
undefined,
undefined, undefined,
undefined, undefined,
undefined undefined
).getSettings(user.settings.settings), ).getSettings(user.settings.settings),
RegionalMarketClusterRiskNorthAmerica: RegionalMarketClusterRiskNorthAmerica:
new RegionalMarketClusterRiskNorthAmerica( new RegionalMarketClusterRiskNorthAmerica(
undefined,
undefined,
undefined, undefined,
undefined, undefined,
undefined undefined

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

@ -1,5 +1,6 @@
import { Rule } from '@ghostfolio/api/models/rule'; import { Rule } from '@ghostfolio/api/models/rule';
import { ExchangeRateDataService } from '@ghostfolio/api/services/exchange-rate-data/exchange-rate-data.service'; import { ExchangeRateDataService } from '@ghostfolio/api/services/exchange-rate-data/exchange-rate-data.service';
import { I18nService } from '@ghostfolio/api/services/i18n/i18n.service';
import { UserSettings } from '@ghostfolio/common/interfaces'; import { UserSettings } from '@ghostfolio/common/interfaces';
import { Settings } from './interfaces/rule-settings.interface'; import { Settings } from './interfaces/rule-settings.interface';
@ -10,10 +11,13 @@ export class RegionalMarketClusterRiskAsiaPacific extends Rule<Settings> {
public constructor( public constructor(
protected exchangeRateDataService: ExchangeRateDataService, protected exchangeRateDataService: ExchangeRateDataService,
private i18nService: I18nService,
languageCode: string,
currentValueInBaseCurrency: number, currentValueInBaseCurrency: number,
asiaPacificValueInBaseCurrency: number asiaPacificValueInBaseCurrency: number
) { ) {
super(exchangeRateDataService, { super(exchangeRateDataService, {
languageCode,
key: RegionalMarketClusterRiskAsiaPacific.name key: RegionalMarketClusterRiskAsiaPacific.name
}); });
@ -28,26 +32,40 @@ export class RegionalMarketClusterRiskAsiaPacific extends Rule<Settings> {
if (asiaPacificMarketValueRatio > ruleSettings.thresholdMax) { if (asiaPacificMarketValueRatio > ruleSettings.thresholdMax) {
return { return {
evaluation: `The Asia-Pacific market contribution of your current investment (${(asiaPacificMarketValueRatio * 100).toPrecision(3)}%) exceeds ${( evaluation: this.i18nService.getTranslation({
ruleSettings.thresholdMax * 100 id: 'rule.regionClusterRiskAsiaPacific.false.max',
).toPrecision(3)}%`, languageCode: this.getLanguageCode(),
placeholders: {
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: `The Asia-Pacific market contribution of your current investment (${(asiaPacificMarketValueRatio * 100).toPrecision(3)}%) is below ${( evaluation: this.i18nService.getTranslation({
ruleSettings.thresholdMin * 100 id: 'rule.regionClusterRiskAsiaPacific.false.min',
).toPrecision(3)}%`, languageCode: this.getLanguageCode(),
placeholders: {
valueRatio: (asiaPacificMarketValueRatio * 100).toPrecision(3),
thresholdMin: (ruleSettings.thresholdMin * 100).toPrecision(3)
}
}),
value: false value: false
}; };
} }
return { return {
evaluation: `The Asia-Pacific market contribution of your current investment (${(asiaPacificMarketValueRatio * 100).toPrecision(3)}%) is within the range of ${( evaluation: this.i18nService.getTranslation({
ruleSettings.thresholdMin * 100 id: 'rule.regionClusterRiskAsiaPacific.true',
).toPrecision( languageCode: this.getLanguageCode(),
3 placeholders: {
)}% and ${(ruleSettings.thresholdMax * 100).toPrecision(3)}%`, valueRatio: (asiaPacificMarketValueRatio * 100).toPrecision(3),
thresholdMin: (ruleSettings.thresholdMin * 100).toPrecision(3),
thresholdMax: (ruleSettings.thresholdMax * 100).toPrecision(3)
}
}),
value: true value: true
}; };
} }
@ -70,6 +88,10 @@ export class RegionalMarketClusterRiskAsiaPacific extends Rule<Settings> {
} }
public getName() { public getName() {
return this.i18nService.getTranslation({
id: 'rule.regionClusterRiskAsiaPacific',
languageCode: this.getLanguageCode()
});
return 'Asia-Pacific'; return 'Asia-Pacific';
} }

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

@ -1,5 +1,6 @@
import { Rule } from '@ghostfolio/api/models/rule'; import { Rule } from '@ghostfolio/api/models/rule';
import { ExchangeRateDataService } from '@ghostfolio/api/services/exchange-rate-data/exchange-rate-data.service'; import { ExchangeRateDataService } from '@ghostfolio/api/services/exchange-rate-data/exchange-rate-data.service';
import { I18nService } from '@ghostfolio/api/services/i18n/i18n.service';
import { UserSettings } from '@ghostfolio/common/interfaces'; import { UserSettings } from '@ghostfolio/common/interfaces';
import { Settings } from './interfaces/rule-settings.interface'; import { Settings } from './interfaces/rule-settings.interface';
@ -10,10 +11,13 @@ export class RegionalMarketClusterRiskEmergingMarkets extends Rule<Settings> {
public constructor( public constructor(
protected exchangeRateDataService: ExchangeRateDataService, protected exchangeRateDataService: ExchangeRateDataService,
private i18nService: I18nService,
languageCode: string,
currentValueInBaseCurrency: number, currentValueInBaseCurrency: number,
emergingMarketsValueInBaseCurrency: number emergingMarketsValueInBaseCurrency: number
) { ) {
super(exchangeRateDataService, { super(exchangeRateDataService, {
languageCode,
key: RegionalMarketClusterRiskEmergingMarkets.name key: RegionalMarketClusterRiskEmergingMarkets.name
}); });
@ -30,26 +34,40 @@ export class RegionalMarketClusterRiskEmergingMarkets extends Rule<Settings> {
if (emergingMarketsValueRatio > ruleSettings.thresholdMax) { if (emergingMarketsValueRatio > ruleSettings.thresholdMax) {
return { return {
evaluation: `The Emerging Markets contribution of your current investment (${(emergingMarketsValueRatio * 100).toPrecision(3)}%) exceeds ${( evaluation: this.i18nService.getTranslation({
ruleSettings.thresholdMax * 100 id: 'rule.regionClusterRiskEmergingMarkets.false.max',
).toPrecision(3)}%`, languageCode: this.getLanguageCode(),
placeholders: {
valueRatio: (emergingMarketsValueRatio * 100).toPrecision(3),
thresholdMax: (ruleSettings.thresholdMax * 100).toPrecision(3)
}
}),
value: false value: false
}; };
} else if (emergingMarketsValueRatio < ruleSettings.thresholdMin) { } else if (emergingMarketsValueRatio < ruleSettings.thresholdMin) {
return { return {
evaluation: `The Emerging Markets contribution of your current investment (${(emergingMarketsValueRatio * 100).toPrecision(3)}%) is below ${( evaluation: this.i18nService.getTranslation({
ruleSettings.thresholdMin * 100 id: 'rule.regionClusterRiskEmergingMarkets.false.min',
).toPrecision(3)}%`, languageCode: this.getLanguageCode(),
placeholders: {
valueRatio: (emergingMarketsValueRatio * 100).toPrecision(3),
thresholdMin: (ruleSettings.thresholdMin * 100).toPrecision(3)
}
}),
value: false value: false
}; };
} }
return { return {
evaluation: `The Emerging Markets contribution of your current investment (${(emergingMarketsValueRatio * 100).toPrecision(3)}%) is within the range of ${( evaluation: this.i18nService.getTranslation({
ruleSettings.thresholdMin * 100 id: 'rule.regionClusterRiskEmergingMarkets.true',
).toPrecision( languageCode: this.getLanguageCode(),
3 placeholders: {
)}% and ${(ruleSettings.thresholdMax * 100).toPrecision(3)}%`, valueRatio: (emergingMarketsValueRatio * 100).toPrecision(3),
thresholdMin: (ruleSettings.thresholdMin * 100).toPrecision(3),
thresholdMax: (ruleSettings.thresholdMax * 100).toPrecision(3)
}
}),
value: true value: true
}; };
} }
@ -72,6 +90,10 @@ export class RegionalMarketClusterRiskEmergingMarkets extends Rule<Settings> {
} }
public getName() { public getName() {
return this.i18nService.getTranslation({
id: 'rule.regionClusterRiskEmergingMarkets',
languageCode: this.getLanguageCode()
});
return 'Emerging Markets'; return 'Emerging Markets';
} }

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

@ -1,5 +1,6 @@
import { Rule } from '@ghostfolio/api/models/rule'; import { Rule } from '@ghostfolio/api/models/rule';
import { ExchangeRateDataService } from '@ghostfolio/api/services/exchange-rate-data/exchange-rate-data.service'; import { ExchangeRateDataService } from '@ghostfolio/api/services/exchange-rate-data/exchange-rate-data.service';
import { I18nService } from '@ghostfolio/api/services/i18n/i18n.service';
import { UserSettings } from '@ghostfolio/common/interfaces'; import { UserSettings } from '@ghostfolio/common/interfaces';
import { Settings } from './interfaces/rule-settings.interface'; import { Settings } from './interfaces/rule-settings.interface';
@ -10,10 +11,13 @@ export class RegionalMarketClusterRiskEurope extends Rule<Settings> {
public constructor( public constructor(
protected exchangeRateDataService: ExchangeRateDataService, protected exchangeRateDataService: ExchangeRateDataService,
private i18nService: I18nService,
languageCode: string,
currentValueInBaseCurrency: number, currentValueInBaseCurrency: number,
europeValueInBaseCurrency: number europeValueInBaseCurrency: number
) { ) {
super(exchangeRateDataService, { super(exchangeRateDataService, {
languageCode,
key: RegionalMarketClusterRiskEurope.name key: RegionalMarketClusterRiskEurope.name
}); });
@ -28,26 +32,40 @@ export class RegionalMarketClusterRiskEurope extends Rule<Settings> {
if (europeMarketValueRatio > ruleSettings.thresholdMax) { if (europeMarketValueRatio > ruleSettings.thresholdMax) {
return { return {
evaluation: `The Europe market contribution of your current investment (${(europeMarketValueRatio * 100).toPrecision(3)}%) exceeds ${( evaluation: this.i18nService.getTranslation({
ruleSettings.thresholdMax * 100 id: 'rule.regionClusterRiskEurope.false.max',
).toPrecision(3)}%`, languageCode: this.getLanguageCode(),
placeholders: {
valueRatio: (europeMarketValueRatio * 100).toPrecision(3),
thresholdMax: (ruleSettings.thresholdMax * 100).toPrecision(3)
}
}),
value: false value: false
}; };
} else if (europeMarketValueRatio < ruleSettings.thresholdMin) { } else if (europeMarketValueRatio < ruleSettings.thresholdMin) {
return { return {
evaluation: `The Europe market contribution of your current investment (${(europeMarketValueRatio * 100).toPrecision(3)}%) is below ${( evaluation: this.i18nService.getTranslation({
ruleSettings.thresholdMin * 100 id: 'rule.regionClusterRiskEurope.false.min',
).toPrecision(3)}%`, languageCode: this.getLanguageCode(),
placeholders: {
valueRatio: (europeMarketValueRatio * 100).toPrecision(3),
thresholdMin: (ruleSettings.thresholdMin * 100).toPrecision(3)
}
}),
value: false value: false
}; };
} }
return { return {
evaluation: `The Europe market contribution of your current investment (${(europeMarketValueRatio * 100).toPrecision(3)}%) is within the range of ${( evaluation: this.i18nService.getTranslation({
ruleSettings.thresholdMin * 100 id: 'rule.regionClusterRiskEurope.true',
).toPrecision( languageCode: this.getLanguageCode(),
3 placeholders: {
)}% and ${(ruleSettings.thresholdMax * 100).toPrecision(3)}%`, valueRatio: (europeMarketValueRatio * 100).toPrecision(3),
thresholdMin: (ruleSettings.thresholdMin * 100).toPrecision(3),
thresholdMax: (ruleSettings.thresholdMax * 100).toPrecision(3)
}
}),
value: true value: true
}; };
} }
@ -70,6 +88,10 @@ export class RegionalMarketClusterRiskEurope extends Rule<Settings> {
} }
public getName() { public getName() {
return this.i18nService.getTranslation({
id: 'rule.regionClusterRiskEurope',
languageCode: this.getLanguageCode()
});
return 'Europe'; return 'Europe';
} }

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

@ -1,5 +1,6 @@
import { Rule } from '@ghostfolio/api/models/rule'; import { Rule } from '@ghostfolio/api/models/rule';
import { ExchangeRateDataService } from '@ghostfolio/api/services/exchange-rate-data/exchange-rate-data.service'; import { ExchangeRateDataService } from '@ghostfolio/api/services/exchange-rate-data/exchange-rate-data.service';
import { I18nService } from '@ghostfolio/api/services/i18n/i18n.service';
import { UserSettings } from '@ghostfolio/common/interfaces'; import { UserSettings } from '@ghostfolio/common/interfaces';
import { Settings } from './interfaces/rule-settings.interface'; import { Settings } from './interfaces/rule-settings.interface';
@ -10,10 +11,13 @@ export class RegionalMarketClusterRiskJapan extends Rule<Settings> {
public constructor( public constructor(
protected exchangeRateDataService: ExchangeRateDataService, protected exchangeRateDataService: ExchangeRateDataService,
private i18nService: I18nService,
languageCode: string,
currentValueInBaseCurrency: number, currentValueInBaseCurrency: number,
japanValueInBaseCurrency: number japanValueInBaseCurrency: number
) { ) {
super(exchangeRateDataService, { super(exchangeRateDataService, {
languageCode,
key: RegionalMarketClusterRiskJapan.name key: RegionalMarketClusterRiskJapan.name
}); });
@ -28,26 +32,40 @@ export class RegionalMarketClusterRiskJapan extends Rule<Settings> {
if (japanMarketValueRatio > ruleSettings.thresholdMax) { if (japanMarketValueRatio > ruleSettings.thresholdMax) {
return { return {
evaluation: `The Japan market contribution of your current investment (${(japanMarketValueRatio * 100).toPrecision(3)}%) exceeds ${( evaluation: this.i18nService.getTranslation({
ruleSettings.thresholdMax * 100 id: 'rule.regionClusterRiskJapan.false.max',
).toPrecision(3)}%`, languageCode: this.getLanguageCode(),
placeholders: {
valueRatio: (japanMarketValueRatio * 100).toPrecision(3),
thresholdMax: (ruleSettings.thresholdMax * 100).toPrecision(3)
}
}),
value: false value: false
}; };
} else if (japanMarketValueRatio < ruleSettings.thresholdMin) { } else if (japanMarketValueRatio < ruleSettings.thresholdMin) {
return { return {
evaluation: `The Japan market contribution of your current investment (${(japanMarketValueRatio * 100).toPrecision(3)}%) is below ${( evaluation: this.i18nService.getTranslation({
ruleSettings.thresholdMin * 100 id: 'rule.regionClusterRiskJapan.false.min',
).toPrecision(3)}%`, languageCode: this.getLanguageCode(),
placeholders: {
valueRatio: (japanMarketValueRatio * 100).toPrecision(3),
thresholdMin: (ruleSettings.thresholdMin * 100).toPrecision(3)
}
}),
value: false value: false
}; };
} }
return { return {
evaluation: `The Japan market contribution of your current investment (${(japanMarketValueRatio * 100).toPrecision(3)}%) is within the range of ${( evaluation: this.i18nService.getTranslation({
ruleSettings.thresholdMin * 100 id: 'rule.regionClusterRiskJapan.true',
).toPrecision( languageCode: this.getLanguageCode(),
3 placeholders: {
)}% and ${(ruleSettings.thresholdMax * 100).toPrecision(3)}%`, valueRatio: (japanMarketValueRatio * 100).toPrecision(3),
thresholdMin: (ruleSettings.thresholdMin * 100).toPrecision(3),
thresholdMax: (ruleSettings.thresholdMax * 100).toPrecision(3)
}
}),
value: true value: true
}; };
} }
@ -70,6 +88,10 @@ export class RegionalMarketClusterRiskJapan extends Rule<Settings> {
} }
public getName() { public getName() {
return this.i18nService.getTranslation({
id: 'rule.regionClusterRiskJapan',
languageCode: this.getLanguageCode()
});
return 'Japan'; return 'Japan';
} }

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

@ -1,5 +1,6 @@
import { Rule } from '@ghostfolio/api/models/rule'; import { Rule } from '@ghostfolio/api/models/rule';
import { ExchangeRateDataService } from '@ghostfolio/api/services/exchange-rate-data/exchange-rate-data.service'; import { ExchangeRateDataService } from '@ghostfolio/api/services/exchange-rate-data/exchange-rate-data.service';
import { I18nService } from '@ghostfolio/api/services/i18n/i18n.service';
import { UserSettings } from '@ghostfolio/common/interfaces'; import { UserSettings } from '@ghostfolio/common/interfaces';
import { Settings } from './interfaces/rule-settings.interface'; import { Settings } from './interfaces/rule-settings.interface';
@ -10,10 +11,13 @@ export class RegionalMarketClusterRiskNorthAmerica extends Rule<Settings> {
public constructor( public constructor(
protected exchangeRateDataService: ExchangeRateDataService, protected exchangeRateDataService: ExchangeRateDataService,
private i18nService: I18nService,
languageCode: string,
currentValueInBaseCurrency: number, currentValueInBaseCurrency: number,
northAmericaValueInBaseCurrency: number northAmericaValueInBaseCurrency: number
) { ) {
super(exchangeRateDataService, { super(exchangeRateDataService, {
languageCode,
key: RegionalMarketClusterRiskNorthAmerica.name key: RegionalMarketClusterRiskNorthAmerica.name
}); });
@ -28,26 +32,40 @@ export class RegionalMarketClusterRiskNorthAmerica extends Rule<Settings> {
if (northAmericaMarketValueRatio > ruleSettings.thresholdMax) { if (northAmericaMarketValueRatio > ruleSettings.thresholdMax) {
return { return {
evaluation: `The North America market contribution of your current investment (${(northAmericaMarketValueRatio * 100).toPrecision(3)}%) exceeds ${( evaluation: this.i18nService.getTranslation({
ruleSettings.thresholdMax * 100 id: 'rule.regionClusterRiskNorthAmerica.false.max',
).toPrecision(3)}%`, languageCode: this.getLanguageCode(),
placeholders: {
valueRatio: (northAmericaMarketValueRatio * 100).toPrecision(3),
thresholdMax: (ruleSettings.thresholdMax * 100).toPrecision(3)
}
}),
value: false value: false
}; };
} else if (northAmericaMarketValueRatio < ruleSettings.thresholdMin) { } else if (northAmericaMarketValueRatio < ruleSettings.thresholdMin) {
return { return {
evaluation: `The North America market contribution of your current investment (${(northAmericaMarketValueRatio * 100).toPrecision(3)}%) is below ${( evaluation: this.i18nService.getTranslation({
ruleSettings.thresholdMin * 100 id: 'rule.regionClusterRiskNorthAmerica.false.min',
).toPrecision(3)}%`, languageCode: this.getLanguageCode(),
placeholders: {
valueRatio: (northAmericaMarketValueRatio * 100).toPrecision(3),
thresholdMin: (ruleSettings.thresholdMin * 100).toPrecision(3)
}
}),
value: false value: false
}; };
} }
return { return {
evaluation: `The North America market contribution of your current investment (${(northAmericaMarketValueRatio * 100).toPrecision(3)}%) is within the range of ${( evaluation: this.i18nService.getTranslation({
ruleSettings.thresholdMin * 100 id: 'rule.regionClusterRiskNorthAmerica.true',
).toPrecision( languageCode: this.getLanguageCode(),
3 placeholders: {
)}% and ${(ruleSettings.thresholdMax * 100).toPrecision(3)}%`, valueRatio: (northAmericaMarketValueRatio * 100).toPrecision(3),
thresholdMin: (ruleSettings.thresholdMin * 100).toPrecision(3),
thresholdMax: (ruleSettings.thresholdMax * 100).toPrecision(3)
}
}),
value: true value: true
}; };
} }
@ -70,6 +88,10 @@ export class RegionalMarketClusterRiskNorthAmerica extends Rule<Settings> {
} }
public getName() { public getName() {
return this.i18nService.getTranslation({
id: 'rule.regionClusterRiskNorthAmerica',
languageCode: this.getLanguageCode()
});
return 'North America'; return 'North America';
} }

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

@ -12,6 +12,77 @@
</li> </li>
<li i18n="@@myAccount">My Account</li> <li i18n="@@myAccount">My Account</li>
<li i18n="@@rule.accountClusterRisk.category">Account Cluster Risks</li> <li i18n="@@rule.accountClusterRisk.category">Account Cluster Risks</li>
<li i18n="@@rule.regionClusterRiskAsiaPacific">Asia-Pacific</li>
<li i18n="@@rule.regionClusterRiskAsiaPacific.false.max">
The Asia-Pacific market contribution of your current investment
($&#123;valueRatio&#125;%) is exceeds $&#123;thresholdMax&#125;%
</li>
<li i18n="@@rule.regionClusterRiskAsiaPacific.false.min">
The Asia-Pacific market contribution of your current investment
($&#123;valueRatio&#125;%) is below $&#123;thresholdMin&#125;%
</li>
<li i18n="@@rule.regionClusterRiskAsiaPacific.true">
The Asia-Pacific market contribution of your current investment
($&#123;valueRatio&#125;%) is within the range of
$&#123;thresholdMin&#125;% and $&#123;thresholdMax&#125;%
</li>
<li i18n="@@rule.regionClusterRiskEmergingMarkets">Emerging Markets</li>
<li i18n="@@rule.regionClusterRiskEmergingMarkets.false.max">
The Emerging Markets contribution of your current investment
($&#123;valueRatio&#125;%) exceeds $&#123;thresholdMax&#125;%
</li>
<li i18n="@@rule.regionClusterRiskEmergingMarkets.false.min">
The Emerging Markets contribution of your current investment
($&#123;valueRatio&#125;%) is below $&#123;thresholdMin&#125;%
</li>
<li i18n="@@rule.regionClusterRiskEmergingMarkets.true">
The Emerging Markets contribution of your current investment
($&#123;valueRatio&#125;%) is within the range of
$&#123;thresholdMin&#125;% and $&#123;thresholdMax&#125;%
</li>
<li i18n="@@rule.regionClusterRiskEurope">Europe</li>
<li i18n="@@rule.regionClusterRiskEurope.false.max">
The Europe market contribution of your current investment
($&#123;valueRatio&#125;%) exceeds $&#123;thresholdMax&#125;%
</li>
<li i18n="@@rule.regionClusterRiskEurope.false.min">
The Europe market contribution of your current investment
($&#123;valueRatio&#125;%) is below $&#123;thresholdMin&#125;%
</li>
<li i18n="@@rule.regionClusterRiskEurope.true">
The Europe market contribution of your current investment
($&#123;valueRatio&#125;%) is within the range of
$&#123;thresholdMin&#125;% and $&#123;thresholdMax&#125;%
</li>
<li i18n="@@rule.regionClusterRiskJapan">Japan</li>
<li i18n="@@rule.regionClusterRiskJapan.false.max">
The Japan market contribution of your current investment
($&#123;valueRatio&#125;%) exceeds $&#123;thresholdMax&#125;%
</li>
<li i18n="@@rule.regionClusterRiskJapan.false.min">
The Japan market contribution of your current investment
($&#123;valueRatio&#125;%) is below $&#123;thresholdMin&#125;%
</li>
<li i18n="@@rule.regionClusterRiskJapan.true">
The Japan market contribution of your current investment
($&#123;valueRatio&#125;%) is within the range of
$&#123;thresholdMin&#125;% and $&#123;thresholdMax&#125;%
</li>
<li i18n="@@rule.regionClusterRiskNorthAmerica">North America</li>
<li i18n="@@rule.regionClusterRiskNorthAmerica.false.max">
The North America market contribution of your current investment
($&#123;valueRatio&#125;%) exceeds $&#123;thresholdMax&#125;%
</li>
<li i18n="@@rule.regionClusterRiskNorthAmerica.false.min">
The North America market contribution of your current investment
($&#123;valueRatio&#125;%) is below $&#123;thresholdMin&#125;%
</li>
<li i18n="@@rule.regionClusterRiskNorthAmerica.true">
The North America market contribution of your current investment
($&#123;valueRatio&#125;%) is within the range of
$&#123;thresholdMin&#125;% and $&#123;thresholdMax&#125;%
</li>
<li i18n="@@rule.accountClusterRiskCurrentInvestment">Investment</li> <li i18n="@@rule.accountClusterRiskCurrentInvestment">Investment</li>
<li i18n="@@rule.accountClusterRiskCurrentInvestment.false"> <li i18n="@@rule.accountClusterRiskCurrentInvestment.false">
Over $&#123;thresholdMax&#125;% of your current investment is at Over $&#123;thresholdMax&#125;% of your current investment is at

Loading…
Cancel
Save