I'm doing internationalization for a website and I'm encountering a weird problem with string interpolation. The following variable will not compile as it will fail to Parsing error: Unexpected character ''. You can check this out yourself in www.jslint.com.
const production = `${t('solarPanel.production.daily')} ${moment(selectedTime).format('D.M.')}`;
For clarification:
tis a function from a translation library that will return a localized string.momentis a date library that will return a string form of the date objectselectedTime.
This isn't important though, because the error is in the syntax. It seems that the translation function in the first interpolation is the problem. The linter points the supposed empty string to be between )} after the function.
I can go around this problem simply by assigning the value of the translation function into a variable and including that in the first interpolation. However, I am interested in what is causing this problem in the first place?
tandmomentare not in scope.'ie write\'?