You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I am using PrimeNG with the PrimeNGConfig.setTranslation method for internationalization in my Angular application. When switching the language to French, the p-multiselect component does not translate certain values such as selectionMessage. Other components and text are correctly translated to French.
Steps to Reproduce:
Set up a PrimeNG project.
Configure PrimeNGConfig to switch languages (e.g., from English to French).
Use the p-multiselect component in a template.
Attempt to switch the language to French.
Expected behavior:
The selectionMessage and other static text within the p-multiselect component should be translated to French.
Actual behavior:
The selectionMessage remains in English even after switching to French.
// app.module.ts
import { NgModule } from '@angular/core';
import { BrowserModule } from '@angular/platform-browser';
import { AppComponent } from './app.component';
import { MultiSelectModule } from 'primeng/multiselect';
import { PrimeNGConfig } from 'primeng/api';
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
-
I am using PrimeNG with the PrimeNGConfig.setTranslation method for internationalization in my Angular application. When switching the language to French, the p-multiselect component does not translate certain values such as selectionMessage. Other components and text are correctly translated to French.
Steps to Reproduce:
Set up a PrimeNG project.
Configure PrimeNGConfig to switch languages (e.g., from English to French).
Use the p-multiselect component in a template.
Attempt to switch the language to French.
Expected behavior:
The selectionMessage and other static text within the p-multiselect component should be translated to French.
Actual behavior:
The selectionMessage remains in English even after switching to French.
// app.module.ts
import { NgModule } from '@angular/core';
import { BrowserModule } from '@angular/platform-browser';
import { AppComponent } from './app.component';
import { MultiSelectModule } from 'primeng/multiselect';
import { PrimeNGConfig } from 'primeng/api';
@NgModule({
declarations: [
AppComponent
],
imports: [
BrowserModule,
MultiSelectModule
],
providers: [],
bootstrap: [AppComponent]
})
export class AppModule {}
// app.component.ts
import { Component, OnInit } from '@angular/core';
import { PrimeNGConfig } from 'primeng/api';
@component({
selector: 'app-root',
template:
<p-multiselect [options]="options" [(ngModel)]="selectedOptions" ></p-multiselect>
})
export class AppComponent implements OnInit {
options: any[] = [
{label: 'Option 1', value: '1'},
{label: 'Option 2', value: '2'}
];
selectedOptions: any[] = [];
constructor(private primeNGConfig: PrimeNGConfig) {}
ngOnInit() {
this.primeNGConfig.setTranslation({
selectionMessage: 'éléments sélectionnés',
emptySearchMessage: 'Aucun résultat trouvé',
emptyFilterMessage: 'Aucun résultat trouvé',
});
}
}
Beta Was this translation helpful? Give feedback.
All reactions