mirror of https://github.com/Ombi-app/Ombi
fix(translations): 🌐 Localize more places (#4400)
* Localize a few isolated strings * Localize paginator * Localize a few isolated strings * Make button width dynamic for better i18n * Localize a few isolated strings * Fix technical typoemby-recently-added
parent
22b8a221e9
commit
005529cda8
@ -1,6 +1,6 @@
|
|||||||
import { Component } from "@angular/core";
|
import { Component } from "@angular/core";
|
||||||
|
|
||||||
@Component({
|
@Component({
|
||||||
template: "<h2>Page not found</h2>",
|
template: "<h2>{{ 'ErrorPages.NotFound' | translate }}</h2>",
|
||||||
})
|
})
|
||||||
export class PageNotFoundComponent { }
|
export class PageNotFoundComponent { }
|
||||||
|
@ -0,0 +1,34 @@
|
|||||||
|
import { MatPaginatorIntl } from '@angular/material/paginator';
|
||||||
|
import { TranslateService } from '@ngx-translate/core';
|
||||||
|
|
||||||
|
export class MatPaginatorI18n {
|
||||||
|
|
||||||
|
constructor(private translate: TranslateService) { }
|
||||||
|
|
||||||
|
getPaginatorIntl(): MatPaginatorIntl {
|
||||||
|
const paginatorIntl = new MatPaginatorIntl();
|
||||||
|
paginatorIntl.itemsPerPageLabel = this.translate.instant('Paginator.itemsPerPageLabel');
|
||||||
|
paginatorIntl.nextPageLabel = this.translate.instant('Paginator.nextPageLabel');
|
||||||
|
paginatorIntl.previousPageLabel = this.translate.instant('Paginator.previousPageLabel');
|
||||||
|
paginatorIntl.firstPageLabel = this.translate.instant('Paginator.firstPageLabel');
|
||||||
|
paginatorIntl.lastPageLabel = this.translate.instant('Paginator.lastPageLabel');
|
||||||
|
paginatorIntl.getRangeLabel = this.getRangeLabel.bind(this);
|
||||||
|
return paginatorIntl;
|
||||||
|
}
|
||||||
|
|
||||||
|
private getRangeLabel(page: number, pageSize: number, length: number): string {
|
||||||
|
if (length == 0 || pageSize == 0) {
|
||||||
|
return this.translate.instant('Paginator.rangePageLabel1', { length });
|
||||||
|
}
|
||||||
|
|
||||||
|
length = Math.max(length, 0);
|
||||||
|
|
||||||
|
const startIndex = page * pageSize;
|
||||||
|
|
||||||
|
// If the start index exceeds the list length, do not try and fix the end index to the end.
|
||||||
|
const endIndex =
|
||||||
|
startIndex < length ? Math.min(startIndex + pageSize, length) : startIndex + pageSize;
|
||||||
|
|
||||||
|
return this.translate.instant('Paginator.rangePageLabel2', { startIndex: startIndex + 1, endIndex, length });
|
||||||
|
}
|
||||||
|
}
|
@ -1,3 +1,3 @@
|
|||||||
<div class="wizard-background">
|
<div class="wizard-background">
|
||||||
<h2 style="color:white">Unsubscribed!</h2>
|
<h2 style="color:white">{{ 'UserPreferences.Unsubscribed' | translate }}</h2>
|
||||||
</div>
|
</div>
|
Loading…
Reference in new issue