Browse Source

Task/improve language localization in tag management of admin control panel (#7349)

* Improve language localization

* Update changelog
pull/7351/head
Thomas Kaul 4 days ago
committed by GitHub
parent
commit
842e74fe88
No known key found for this signature in database GPG Key ID: B5690EEEBB952194
  1. 1
      CHANGELOG.md
  2. 2
      apps/client/src/app/components/admin-tag/admin-tag.component.html
  3. 9
      apps/client/src/app/components/admin-tag/admin-tag.component.ts

1
CHANGELOG.md

@ -10,6 +10,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
### Changed
- Migrated the clone, create and edit activity dialogs to dedicated routes
- Improved the language localization in the tag management of the admin control panel
### Fixed

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