Utilizing TranslateService from @ngx-translate/core to retrieve strings in the current language can be done as shown below:
this.translate
.get(['hotline-card.email-subject', 'hotline-card.email-body'])
.subscribe((strings) => {
console.log('strings', strings);
let subject = strings['hotmail-card.email-subject'];
console.log('subject', subject);
});
The resulting strings object resembles this structure (without quotes around keys in the console):
{
"hotline-card.email-subject": "Some subject",
"hotline-card.email-body": "Some body"
}
However, the value of 'subject' appears to be undefined. How can I properly access the translated string values?
Appreciate any insights.
Søren