Browse Source

Improve language localization

pull/7349/head
Thomas Kaul 6 days ago
parent
commit
3c62ffaa84
  1. 2
      apps/client/src/app/components/admin-tag/admin-tag.component.html
  2. 9
      apps/client/src/app/components/admin-tag/admin-tag.component.ts

2
apps/client/src/app/components/admin-tag/admin-tag.component.html

@ -22,7 +22,7 @@
<ng-container i18n>Name</ng-container>
</th>
<td *matCellDef="let element" class="px-1" mat-cell>
{{ element.name }}
{{ translate(element.name) }}
</td>
</ng-container>

9
apps/client/src/app/components/admin-tag/admin-tag.component.ts

@ -3,6 +3,7 @@ import { DEFAULT_PAGE_SIZE } from '@ghostfolio/common/config';
import { CreateTagDto, UpdateTagDto } from '@ghostfolio/common/dtos';
import { ConfirmationDialogType } from '@ghostfolio/common/enums';
import { getLocale, getLowercase } from '@ghostfolio/common/helper';
import { translate } from '@ghostfolio/ui/i18n';
import { NotificationService } from '@ghostfolio/ui/notifications';
import { DataService } from '@ghostfolio/ui/services';
import { GfValueComponent } from '@ghostfolio/ui/value';
@ -68,6 +69,7 @@ export class GfAdminTagComponent implements OnInit {
];
protected readonly pageSize = DEFAULT_PAGE_SIZE;
protected tags: Tag[];
protected readonly translate = translate;
private readonly deviceType = computed(
() => this.deviceDetectorService.deviceInfo().deviceType
@ -155,7 +157,12 @@ export class GfAdminTagComponent implements OnInit {
this.dataSource = new MatTableDataSource(this.tags);
this.dataSource.paginator = this.paginator();
this.dataSource.sort = this.sort();
this.dataSource.sortingDataAccessor = getLowercase;
this.dataSource.sortingDataAccessor = (tag, path) => {
return path === 'name'
? translate(tag.name).toLocaleLowerCase()
: (getLowercase(tag, path) as number | string);
};
this.dataService.updateInfo();

Loading…
Cancel
Save