diff --git a/CHANGELOG.md b/CHANGELOG.md index b63fcd03c..3510dfa8a 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -11,6 +11,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 - Migrated the clone, create and edit activity dialogs to dedicated routes - Improved the language localization in the historical market data table of the admin control panel +- Improved the language localization in the tag management of the admin control panel ### Fixed diff --git a/apps/client/src/app/components/admin-tag/admin-tag.component.html b/apps/client/src/app/components/admin-tag/admin-tag.component.html index 14b011ddc..2edad000d 100644 --- a/apps/client/src/app/components/admin-tag/admin-tag.component.html +++ b/apps/client/src/app/components/admin-tag/admin-tag.component.html @@ -22,7 +22,7 @@ Name - {{ element.name }} + {{ translate(element.name) }} diff --git a/apps/client/src/app/components/admin-tag/admin-tag.component.ts b/apps/client/src/app/components/admin-tag/admin-tag.component.ts index 5fb2317f4..ca9143e53 100644 --- a/apps/client/src/app/components/admin-tag/admin-tag.component.ts +++ b/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();