You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
let translatedText: T = await this.i18nRequestScopedService.translate("CAT_NAME", {
lang: 'en-us',
});
key points to a json file with this:
"CAT_NAME": "My cats name is {name}"
In v8.3.0, the returned text is : "My cats name is {name}"
In v8.3.1, the returned text is: "My cats name is {}"
I am quite confident that the issue is because in i18n.service.ts, there is a line:
const args = options?.args ?? {};
but because of that, even when the passed in options.args is undefined, it gets set to {} and hence the second part of the following boolean always translates to true:
if (translation && (args || (args instanceof Array && args.length > 0)))
Reproduction
let translatedText: T = await this.i18nRequestScopedService.translate("CAT_NAME", { lang: 'en-us', }); key points to a json file with this: "CAT_NAME": "My cats name is {name}" In v8.3.0, the returned text is : "My cats name is {name}" In v8.3.1, the returned text is: "My cats name is {}" I am quite confident that the issue is because in i18n.service.ts, there is a line: const args = options?.args ?? {}; but because of that, even when the passed in options.args is undefined, it gets set to {} and hence the second part of the following boolean always translates to true: if (translation && (args || (args instanceof Array && args.length > 0)))
Describe the bug
let translatedText: T = await this.i18nRequestScopedService.translate("CAT_NAME", {
lang: 'en-us',
});
key points to a json file with this:
"CAT_NAME": "My cats name is {name}"
In v8.3.0, the returned text is : "My cats name is {name}"
In v8.3.1, the returned text is: "My cats name is {}"
I am quite confident that the issue is because in i18n.service.ts, there is a line:
const args = options?.args ?? {};
but because of that, even when the passed in options.args is undefined, it gets set to {} and hence the second part of the following boolean always translates to true:
if (translation && (args || (args instanceof Array && args.length > 0)))
Reproduction
let translatedText: T = await this.i18nRequestScopedService.translate("CAT_NAME", { lang: 'en-us', }); key points to a json file with this: "CAT_NAME": "My cats name is {name}" In v8.3.0, the returned text is : "My cats name is {name}" In v8.3.1, the returned text is: "My cats name is {}" I am quite confident that the issue is because in i18n.service.ts, there is a line: const args = options?.args ?? {}; but because of that, even when the passed in options.args is undefined, it gets set to {} and hence the second part of the following boolean always translates to true: if (translation && (args || (args instanceof Array && args.length > 0)))
System Info
Used Package Manager
npm
Validations
The text was updated successfully, but these errors were encountered: