Hiển thị các bài đăng có nhãn keep html tags. Hiển thị tất cả bài đăng
Hiển thị các bài đăng có nhãn keep html tags. Hiển thị tất cả bài đăng

ngx-translate: Translate strings in html

Source: https://stackoverflow.com/questions/50027311/ngx-translate-translate-strings-in-html

<label for="user-terms" [innerHTML]="'i-agree' | translate: {termLink: 'javascript:void(0)'}"></label>


This is how you can use parametric translation with filters:
// define translation with parameter
'TRANSLATION_KEY': '{{days}} days'

// use it in template
<span>{{ 'TRANSLATION_KEY' | translate: { days: followUpInDays | positiveNumber } }}</span>
If you want to have the whole sentence as a translation (including the HTML), you will need to use innerHTML property binding:
// define translation with parameter
'TRANSLATION_KEY': 'Follow-up is <span class="{{className}}">{{days}} days</span> past due'

// use it in template
<span *ngIf="Days < 0 && !shortSentence"
      [innerHTML]="'TRANSLATION_KEY' | translate: { className: (highlightContent ? 'font-bold' : ''), days: followUpInDays | positiveNumber }"> </span>

Renewing Facebook Graph API token automatically?

  Mã truy cập dài hạn https://developers.facebook.com/docs/facebook-login/guides/access-tokens/get-long-lived/ https://community.n8n.io/t/re...