Repository navigation
Paginator labels are not updated when the UI language changes #522
Copy link
Copy link
Open
Labels
bugSomething isn't workingSomething isn't working
Description
Is this a regression?
No
Severity
⚪ Cosmetic – visual or non-functional issue
Please provide the branch(es) you discovered this issue in
v92
Environment Details
Edge on Windows 11, v9.2.2
Please provide a minimal set of steps to reproduce the issue
- Open any view containing a Material paginator (e.g. a data table).
- Change the UI language (or log out and log in with a different language).
- Observe that the paginator labels ("Entries per page", "First page", range text, etc.) are still shown in the old language.
Description
The custom Paginator (extends MatPaginatorIntl, in lds-replace/qbm shared code, branch v92) loads its translations only once in the constructor using translateService.get(...). Since get() emits a single value and completes, the paginator labels are never refreshed when:
- the UI language is changed at runtime, or
- a user logs out and logs in again with a different language.
The paginator then keeps showing the labels of the previously active language.
There are two root causes:
translateService.get()is used instead oftranslateService.stream(), soonLangChangeevents are ignored.this.changes.next()is never called —MatPaginatoronly re-renders its labels when thechangessubject ofMatPaginatorIntlemits, so even updated properties would not become visible.
Describe what you expected to happen versus what actually happened
Paginator labels follow the currently active UI language.
Relevant logs or console output
Add a screenshot(s) if that helps illustrate the problem
No response
Suggested Fix
Replace the one-time get() subscriptions with a single stream() subscription and notify Material via changes.next():
export class Paginator extends MatPaginatorIntl {
private rangeText = '';
private rangeTextFallback = '';
private readonly labels: { [property: string]: string } = {
itemsPerPageLabel: '#LDS#Entries per page',
firstPageLabel: '#LDS#First page',
previousPageLabel: '#LDS#Previous page',
nextPageLabel: '#LDS#Next page',
lastPageLabel: '#LDS#Last page',
rangeText: '#LDS#{0} - {1} of {2}',
rangeTextFallback: '#LDS#0 of {0}',
};
private constructor(private translateService: TranslateService, private readonly ldsReplace: LdsReplacePipe) {
super();
this.translateService.stream(Object.values(this.labels))
.subscribe((texts: { [key: string]: string }) => {
Object.entries(this.labels).forEach(([property, key]) => this[property] = texts[key]);
this.itemsPerPageLabel += ':';
this.changes.next();
});
this.getRangeLabel = (page: number, pageSize: number, length: number) => {
length = Math.max(length, 0);
if (length === 0 || pageSize === 0) {
return this.ldsReplace.transform(this.rangeTextFallback, length);
}
const startIndex = page * pageSize;
const endIndex = startIndex < length ? Math.min(startIndex + pageSize, length) : startIndex + pageSize;
return this.ldsReplace.transform(this.rangeText, startIndex + 1, endIndex, length);
};
}
public static Create(translateService: TranslateService, ldsReplace: LdsReplacePipe): Paginator {
return new Paginator(translateService, ldsReplace);
}
}Anything else?
No response
Before submitting...
- I have searched for existing issues that match this one on github and on the community support page
- I have included all necessary details to reproduce this issue
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
bugSomething isn't workingSomething isn't working
Activity
github-actions commentedon Oct 2, 2026
This issue has not seen any action for a while! Closing for now, but it can be reopened at a later date.
asattler commentedon Oct 3, 2026
This issue should not be closed.