#Translate @Input data with @angular/localize

18 messages · Page 1 of 1 (latest)

last kestrel
#

you want to pass the key of your i18 files not the text directly

#

then the translate service will pick up the right language itself to turn the key in text

pulsar surge
last kestrel
#

as for your input, you either pass the key and translate later on, or you translate it before passing it. I will let you chose what seems best for you x)

#

Hold on, I have some big doubt going on, looking up things

#

🤦‍♂️

#

No wonder things did not add up between the link I send you and what I said along

stoic shell
last kestrel
#

Yes that's what I suggested on the next line

last kestrel
#
<app-create-stream-link
  [title]="title"
  [description]="description"
></app-create-stream-link>
  protected title = $localize `offers:constructor`;
  protected description = $localize `offers:constructor-desc`;

Something like that !

stoic shell
#

AFAIK, you can also directly use

<app-create-stream-link
  title="some text" i18n-title="@@offers:constructor-desc"
  description=" some description" i18n-description="@@offers:constructor-desc"
></app-create-stream-link>

(at least that works for standard HTML attributes)

last kestrel
#

nice !

pulsar surge
#

Thank you very much guys