I've found a regression between v9.1.1 and 10.02.
I'm using a custom MissingTranslationHandler likes this:
export class CustomMissingTranslationHandler implements MissingTranslationHandler {
handle(params: MissingTranslationHandlerParams) {
return `MISSING:${params.key}`;
}
}
In v9.1.1, such syntax would be translated anyway (space added before 'foo'):
<p><span translate> foo</span>
It's not the case anymore in v10.0.2. Detailed behavior here: stackblitz of v10.0.2
I suppose the behavior should be the same as v 9.1.1: the innerText should be trimmed and then translated. In my point of view, it's annoying. Of course we should format our code, but it's easy to miss a space while using this kind of syntax:
<div [class.required]="true" translate>
destinataire
</div>
Don't know yet, didn't dig into the code. Will do !
Add a space before any innerText to be translated with the 'translate' directive. Details in provided stackblitz above.
ngx-translate version: 10.0.2
Angular version: 6.1.0
Browser:
I have exactly the same problem.
If i use this.
<p translate>label</p>
it works, but if i do this
<p translate>
label
</p>
it has a strange behavior. It translate the text, but the missing translation trigger is fired.
I also have the same problem.
<p translate>
label
</p>
it works in the first in a component, but if then i use the translate.use to change the language(don't change the component), it often don't work.
I have the same problem. For all those keywords that are used like
Is this gonna bee addressed at some point? It is annoying having to put the tags in a liner...
I have exactly the same problem.
If i use this.
<p translate>label</p>it works, but if i do this
<p translate> label </p>it has a strange behavior. It translate the text, but the missing translation trigger is fired.
Thank you man.. Give this man a medal!
We have the same problem in our project. We use the directive on many places in formatted untrimmed code.
Most helpful comment
Is this gonna bee addressed at some point? It is annoying having to put the tags in a liner...