Open sChupin opened 6 years ago
The problem also happens for invocations with strings (not I18nDef
):
this.i18n('My ' + 'value');
I propose a simple fix at #50.
I get the same error message with this syntax:
this.i18n({
meaning: 'ChangeProfilePictureComponent',
description: 'Error Message if wrong File Type is supplied',
id: 'ChangeProfilePictureComponentErrorWrongFileType',
value: `The File Type '${file.type}' is not supported.`
})
@DanielHabenicht change `The File Type '${file.type}' is not supported.` to \'The File Type {{file.type}}
is not supported.' You need to use the interpolation syntax instead of ${file.type}
syntax
@sChupin a possible work around for long lines would be to use ` instead of ' for the string you need to split on different lines that way you don't need to use the plus operator:
Example:
this.i18n({ value: `My really really really really really really \
really really really really really really really really really \
really really really really really really really really really really really long string`,
id: 'myId', description: 'myDescription' });
rather than
this.i18n({ value: 'My really really really really really really' +
'really really really really really really really really really' +
'really really really really really really really really really really really long string',
id: 'myId', description: 'myDescription' });
When a value is the result of the concatenation of 2 strings, I got the following error after running
ng xi18n
andngx-extractor
:Example of i18n-polyfill use that causes this issue:
The reason why I have some split strings is that my editor wraps line at 120 characters.