rohit 1 day ago
committed by GitHub
parent
commit
5301e67817
No known key found for this signature in database GPG Key ID: B5690EEEBB952194
  1. 10
      apps/api/src/app/portfolio/portfolio.service.ts
  2. 10
      apps/api/src/app/user/user.service.ts
  3. 45
      apps/api/src/models/rules/regional-market-cluster-risk/asia-pacific.ts
  4. 45
      apps/api/src/models/rules/regional-market-cluster-risk/emerging-markets.ts
  5. 45
      apps/api/src/models/rules/regional-market-cluster-risk/europe.ts
  6. 45
      apps/api/src/models/rules/regional-market-cluster-risk/japan.ts
  7. 45
      apps/api/src/models/rules/regional-market-cluster-risk/north-america.ts
  8. 73
      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

45
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.regionalMarketClusterRiskAsiaPacific.false.max',
).toPrecision(3)}%`, languageCode: this.getLanguageCode(),
placeholders: {
thresholdMax: (ruleSettings.thresholdMax * 100).toPrecision(3),
valueRatio: (asiaPacificMarketValueRatio * 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.regionalMarketClusterRiskAsiaPacific.false.min',
).toPrecision(3)}%`, languageCode: this.getLanguageCode(),
placeholders: {
thresholdMin: (ruleSettings.thresholdMin * 100).toPrecision(3),
valueRatio: (asiaPacificMarketValueRatio * 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.regionalMarketClusterRiskAsiaPacific.true',
).toPrecision( languageCode: this.getLanguageCode(),
3 placeholders: {
)}% and ${(ruleSettings.thresholdMax * 100).toPrecision(3)}%`, thresholdMax: (ruleSettings.thresholdMax * 100).toPrecision(3),
thresholdMin: (ruleSettings.thresholdMin * 100).toPrecision(3),
valueRatio: (asiaPacificMarketValueRatio * 100).toPrecision(3),
}
}),
value: true value: true
}; };
} }
@ -70,7 +88,10 @@ export class RegionalMarketClusterRiskAsiaPacific extends Rule<Settings> {
} }
public getName() { public getName() {
return 'Asia-Pacific'; return this.i18nService.getTranslation({
id: 'rule.regionalMarketClusterRiskAsiaPacific',
languageCode: this.getLanguageCode(),
});
} }
public getSettings({ baseCurrency, xRayRules }: UserSettings): Settings { public getSettings({ baseCurrency, xRayRules }: UserSettings): Settings {

45
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.regionalMarketClusterRiskEmergingMarkets.false.max',
).toPrecision(3)}%`, languageCode: this.getLanguageCode(),
placeholders: {
thresholdMax: (ruleSettings.thresholdMax * 100).toPrecision(3),
valueRatio: (emergingMarketsValueRatio * 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.regionalMarketClusterRiskEmergingMarkets.false.min',
).toPrecision(3)}%`, languageCode: this.getLanguageCode(),
placeholders: {
thresholdMin: (ruleSettings.thresholdMin * 100).toPrecision(3),
valueRatio: (emergingMarketsValueRatio * 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.regionalMarketClusterRiskEmergingMarkets.true',
).toPrecision( languageCode: this.getLanguageCode(),
3 placeholders: {
)}% and ${(ruleSettings.thresholdMax * 100).toPrecision(3)}%`, thresholdMax: (ruleSettings.thresholdMax * 100).toPrecision(3),
thresholdMin: (ruleSettings.thresholdMin * 100).toPrecision(3),
valueRatio: (emergingMarketsValueRatio * 100).toPrecision(3),
}
}),
value: true value: true
}; };
} }
@ -72,7 +90,10 @@ export class RegionalMarketClusterRiskEmergingMarkets extends Rule<Settings> {
} }
public getName() { public getName() {
return 'Emerging Markets'; return this.i18nService.getTranslation({
id: 'rule.regionalMarketClusterRiskEmergingMarkets',
languageCode: this.getLanguageCode(),
});
} }
public getSettings({ baseCurrency, xRayRules }: UserSettings): Settings { public getSettings({ baseCurrency, xRayRules }: UserSettings): Settings {

45
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.regionalMarketClusterRiskEurope.false.max',
).toPrecision(3)}%`, languageCode: this.getLanguageCode(),
placeholders: {
thresholdMax: (ruleSettings.thresholdMax * 100).toPrecision(3),
valueRatio: (europeMarketValueRatio * 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.regionalMarketClusterRiskEurope.false.min',
).toPrecision(3)}%`, languageCode: this.getLanguageCode(),
placeholders: {
thresholdMin: (ruleSettings.thresholdMin * 100).toPrecision(3),
valueRatio: (europeMarketValueRatio * 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.regionalMarketClusterRiskEurope.true',
).toPrecision( languageCode: this.getLanguageCode(),
3 placeholders: {
)}% and ${(ruleSettings.thresholdMax * 100).toPrecision(3)}%`, thresholdMax: (ruleSettings.thresholdMax * 100).toPrecision(3),
thresholdMin: (ruleSettings.thresholdMin * 100).toPrecision(3),
valueRatio: (europeMarketValueRatio * 100).toPrecision(3),
}
}),
value: true value: true
}; };
} }
@ -70,7 +88,10 @@ export class RegionalMarketClusterRiskEurope extends Rule<Settings> {
} }
public getName() { public getName() {
return 'Europe'; return this.i18nService.getTranslation({
id: 'rule.regionalMarketClusterRiskEurope',
languageCode: this.getLanguageCode(),
});
} }
public getSettings({ baseCurrency, xRayRules }: UserSettings): Settings { public getSettings({ baseCurrency, xRayRules }: UserSettings): Settings {

45
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.regionalMarketClusterRiskJapan.false.max',
).toPrecision(3)}%`, languageCode: this.getLanguageCode(),
placeholders: {
thresholdMax: (ruleSettings.thresholdMax * 100).toPrecision(3),
valueRatio: (japanMarketValueRatio * 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.regionalMarketClusterRiskJapan.false.min',
).toPrecision(3)}%`, languageCode: this.getLanguageCode(),
placeholders: {
thresholdMin: (ruleSettings.thresholdMin * 100).toPrecision(3),
valueRatio: (japanMarketValueRatio * 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.regionalMarketClusterRiskJapan.true',
).toPrecision( languageCode: this.getLanguageCode(),
3 placeholders: {
)}% and ${(ruleSettings.thresholdMax * 100).toPrecision(3)}%`, thresholdMax: (ruleSettings.thresholdMax * 100).toPrecision(3),
thresholdMin: (ruleSettings.thresholdMin * 100).toPrecision(3),
valueRatio: (japanMarketValueRatio * 100).toPrecision(3),
}
}),
value: true value: true
}; };
} }
@ -70,7 +88,10 @@ export class RegionalMarketClusterRiskJapan extends Rule<Settings> {
} }
public getName() { public getName() {
return 'Japan'; return this.i18nService.getTranslation({
id: 'rule.regionalMarketClusterRiskJapan',
languageCode: this.getLanguageCode(),
});
} }
public getSettings({ baseCurrency, xRayRules }: UserSettings): Settings { public getSettings({ baseCurrency, xRayRules }: UserSettings): Settings {

45
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.regionalMarketClusterRiskNorthAmerica.false.max',
).toPrecision(3)}%`, languageCode: this.getLanguageCode(),
placeholders: {
thresholdMax: (ruleSettings.thresholdMax * 100).toPrecision(3),
valueRatio: (northAmericaMarketValueRatio * 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.regionalMarketClusterRiskNorthAmerica.false.min',
).toPrecision(3)}%`, languageCode: this.getLanguageCode(),
placeholders: {
thresholdMin: (ruleSettings.thresholdMin * 100).toPrecision(3),
valueRatio: (northAmericaMarketValueRatio * 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.regionalMarketClusterRiskNorthAmerica.true',
).toPrecision( languageCode: this.getLanguageCode(),
3 placeholders: {
)}% and ${(ruleSettings.thresholdMax * 100).toPrecision(3)}%`, thresholdMax: (ruleSettings.thresholdMax * 100).toPrecision(3),
thresholdMin: (ruleSettings.thresholdMin * 100).toPrecision(3),
valueRatio: (northAmericaMarketValueRatio * 100).toPrecision(3),
}
}),
value: true value: true
}; };
} }
@ -70,7 +88,10 @@ export class RegionalMarketClusterRiskNorthAmerica extends Rule<Settings> {
} }
public getName() { public getName() {
return 'North America'; return this.i18nService.getTranslation({
id: 'rule.regionalMarketClusterRiskNorthAmerica',
languageCode: this.getLanguageCode(),
});
} }
public getSettings({ baseCurrency, xRayRules }: UserSettings): Settings { public getSettings({ baseCurrency, xRayRules }: UserSettings): Settings {

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

@ -12,6 +12,79 @@
</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.regionalMarketClusterRiskAsiaPacific">Asia-Pacific</li>
<li i18n="@@rule.regionalMarketClusterRiskAsiaPacific.false.max">
The Asia-Pacific market contribution of your current investment
($&#123;valueRatio&#125;%) exceeds $&#123;thresholdMax&#125;%
</li>
<li i18n="@@rule.regionalMarketClusterRiskAsiaPacific.false.min">
The Asia-Pacific market contribution of your current investment
($&#123;valueRatio&#125;%) is below $&#123;thresholdMin&#125;%
</li>
<li i18n="@@rule.regionalMarketClusterRiskAsiaPacific.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.regionalMarketClusterRiskEmergingMarkets">
Emerging Markets
</li>
<li i18n="@@rule.regionalMarketClusterRiskEmergingMarkets.false.max">
The Emerging Markets contribution of your current investment
($&#123;valueRatio&#125;%) exceeds $&#123;thresholdMax&#125;%
</li>
<li i18n="@@rule.regionalMarketClusterRiskEmergingMarkets.false.min">
The Emerging Markets contribution of your current investment
($&#123;valueRatio&#125;%) is below $&#123;thresholdMin&#125;%
</li>
<li i18n="@@rule.regionalMarketClusterRiskEmergingMarkets.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.regionalMarketClusterRiskEurope">Europe</li>
<li i18n="@@rule.regionalMarketClusterRiskEurope.false.max">
The Europe market contribution of your current investment
($&#123;valueRatio&#125;%) exceeds $&#123;thresholdMax&#125;%
</li>
<li i18n="@@rule.regionalMarketClusterRiskEurope.false.min">
The Europe market contribution of your current investment
($&#123;valueRatio&#125;%) is below $&#123;thresholdMin&#125;%
</li>
<li i18n="@@rule.regionalMarketClusterRiskEurope.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.regionalMarketClusterRiskJapan">Japan</li>
<li i18n="@@rule.regionalMarketClusterRiskJapan.false.max">
The Japan market contribution of your current investment
($&#123;valueRatio&#125;%) exceeds $&#123;thresholdMax&#125;%
</li>
<li i18n="@@rule.regionalMarketClusterRiskJapan.false.min">
The Japan market contribution of your current investment
($&#123;valueRatio&#125;%) is below $&#123;thresholdMin&#125;%
</li>
<li i18n="@@rule.regionalMarketClusterRiskJapan.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.regionalMarketClusterRiskNorthAmerica">North America</li>
<li i18n="@@rule.regionalMarketClusterRiskNorthAmerica.false.max">
The North America market contribution of your current investment
($&#123;valueRatio&#125;%) exceeds $&#123;thresholdMax&#125;%
</li>
<li i18n="@@rule.regionalMarketClusterRiskNorthAmerica.false.min">
The North America market contribution of your current investment
($&#123;valueRatio&#125;%) is below $&#123;thresholdMin&#125;%
</li>
<li i18n="@@rule.regionalMarketClusterRiskNorthAmerica.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