Skip to content

Commit 6ee5084

Browse files
authored
[ENG-9956] Group Bug: Untranslated ARIA Labels in Navbar (#829)
- Ticket: [ENG-9956] - Feature flag: n/a ## Summary of Changes 1. Fixed label for aria-label attribute.
1 parent 3a25fe9 commit 6ee5084

3 files changed

Lines changed: 9 additions & 4 deletions

File tree

src/app/core/components/nav-menu/nav-menu.component.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
<osf-icon [iconClass]="`nav-icon ${item.icon}`"></osf-icon>
1414
}
1515

16-
<span>{{ item.label | translate }}</span>
16+
<span>{{ item.label }}</span>
1717

1818
@if (hasVisibleChildren | wrapFn: item) {
1919
<osf-icon

src/app/core/components/nav-menu/nav-menu.component.ts

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import { createDispatchMap, select } from '@ngxs/store';
22

3-
import { TranslatePipe } from '@ngx-translate/core';
3+
import { TranslateService } from '@ngx-translate/core';
44

55
import { PanelMenuModule } from 'primeng/panelmenu';
66

@@ -27,7 +27,7 @@ import { CurrentResourceSelectors, GetResourceDetails } from '@osf/shared/stores
2727

2828
@Component({
2929
selector: 'osf-nav-menu',
30-
imports: [RouterLinkActive, RouterLink, PanelMenuModule, TranslatePipe, IconComponent, WrapFnPipe],
30+
imports: [RouterLinkActive, RouterLink, PanelMenuModule, IconComponent, WrapFnPipe],
3131
templateUrl: './nav-menu.component.html',
3232
styleUrl: './nav-menu.component.scss',
3333
})
@@ -39,6 +39,7 @@ export class NavMenuComponent {
3939
private readonly authService = inject(AuthService);
4040
private readonly platformId = inject(PLATFORM_ID);
4141
private readonly viewOnlyService = inject(ViewOnlyLinkHelperService);
42+
private readonly translateService = inject(TranslateService);
4243

4344
private readonly isAuthenticated = select(UserSelectors.isAuthenticated);
4445
private readonly currentResource = select(CurrentResourceSelectors.getCurrentResource);
@@ -77,6 +78,10 @@ export class NavMenuComponent {
7778

7879
const items = updateMenuItems(filtered, routeContext);
7980

81+
items.forEach((item) => {
82+
item.label = item.label ? this.translateService.instant(item.label) : item.label;
83+
});
84+
8085
return items;
8186
});
8287

src/app/shared/components/resource-card/resource-card.component.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ <h2>
3535
<div class="line-height-3">
3636
@for (affiliatedEntity of affiliatedEntities().slice(0, limit); track $index) {
3737
<a
38-
class="word-break-word block line-height-3"
38+
class="word-break-word block line-height-4"
3939
[href]="affiliatedEntity.absoluteUrl"
4040
target="_blank"
4141
rel="noopener noreferrer"

0 commit comments

Comments
 (0)