Empresas
Empregos
  • Sobre nós
  • Soluções
    • Publicação de vagas
      Publique sua vaga e receba candidatos qualificados em 48h.
    • Avaliações de candidatos
      Mais de 500 testes técnicos e psicológicos, mais anti-fraude.
    • Headhunting
      Busca executiva personalizada do início ao fim.
    • Folha de Pagamento + EOR
      Dispersão de folha e EOR em mais de 15 países da LATAM.
  • Preços
  • Empregos

0

127
Visualizações
Angular i18next string interpolation

I would like to translate my code with i18next for my angular project.

I've installed: i18next, i18next-xhr-backend, i18next-browser-languagedetector

Using lot of ngfor into my code --> I don't know how to use i18next into string interpolations.

In this example below, i would like to translate item.label.

  <ng-container *ngFor="let item of listOfItems; let i = index">
    <mat-grid-tile rowspan="1" class="{{ item.visible === 'false' ? 'invisible' : '' }}">
      <button *ngIf="item && !isItemSelected(item)" (click)="selectItem(item)" mat-raised-button
        class="action-button {{ item.color }}">
        <span class="action-button-text">{{ item.label }}</span>
      </button>
    </mat-grid-tile>
  </ng-container>```

Here is my list of label :

[{
        "id": "1",
        "label": "flower",
        "subject": "plant", 
        "visible": "true",
        "color": "yellow"
    },
    {
        "id": "2",
        "label": "bread",
        "subject": "table", 
        "visible": "false",
        "color": "white"
    },
     {
        "id": "3",
        "label": "glass",
        "subject": "table", 
        "visible": "true",
        "color": "green"
    },
 {
        "id": "4",
        "label": "pissenlit",
        "subject": "plant", 
        "visible": "true",
        "color": "yellow_green"
    }]

here is my list of translation english and french : en:

{"flower":"flower",
"bread":"bread",
"glass":"glass"
"pissenlit":"pissenlit"
}

FR

{"flower":"fleur",
"bread":"pain",
"glass":"verre"
"pissenlit":"pissenlit"
}```


about 4 years ago · Juan Pablo Isaza
Responde à pergunta
Encontrar trabalhos remotos

Descubra a nova forma de encontrar um emprego!

melhores empregos
Principais categorias de trabalho
Empresas
Postar vaga Preços Comercial
Jurídico
Termos e Condições Política de privacidade
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomende algumas ofertas para mim
Preciso de ajuda