Skip to content

Commit 4bf4e18

Browse files
Andrea-GuevaraandreaNeki
authored andcommitted
More accessible file download link for users who use a screen reader (#3264)
* More accessible file download link for users who use a screen reader * Refactoring implementation - More accessible file download link for users who use a screen reader * Fixing import error * Solving the spaces error * Solving the spaces error * Solving the spaces error in file pt-BR.json5 --------- Co-authored-by: andreaNeki <root@TI-03.OHB.LOCAL>
1 parent 2ff5350 commit 4bf4e18

File tree

5 files changed

+15
-3
lines changed

5 files changed

+15
-3
lines changed

src/app/shared/file-download-link/file-download-link.component.html

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,8 @@
1-
<a [routerLink]="(bitstreamPath$| async)?.routerLink" class="dont-break-out" [queryParams]="(bitstreamPath$| async)?.queryParams" [target]="isBlank ? '_blank': '_self'" [ngClass]="cssClasses">
1+
<a [routerLink]="(bitstreamPath$| async)?.routerLink" class="dont-break-out"
2+
[queryParams]="(bitstreamPath$| async)?.queryParams"
3+
[target]="isBlank ? '_blank': '_self'"
4+
[ngClass]="cssClasses"
5+
[attr.aria-label]="('file-download-link.download' | translate) + dsoNameService.getName(bitstream)">
26
<span *ngIf="!(canDownload$ |async)" [attr.aria-label]="'file-download-link.restricted' | translate" class="pr-1"><i class="fas fa-lock"></i></span>
37
<ng-container *ngTemplateOutlet="content"></ng-container>
48
</a>

src/app/shared/file-download-link/file-download-link.component.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
import { Component, Input, OnInit } from '@angular/core';
22
import { Bitstream } from '../../core/shared/bitstream.model';
33
import { getBitstreamDownloadRoute, getBitstreamRequestACopyRoute } from '../../app-routing-paths';
4+
import { DSONameService } from '../../core/breadcrumbs/dso-name.service';
45
import { AuthorizationDataService } from '../../core/data/feature-authorization/authorization-data.service';
56
import { FeatureID } from '../../core/data/feature-authorization/feature-id';
67
import { hasValue, isNotEmpty } from '../empty.util';
@@ -48,6 +49,7 @@ export class FileDownloadLinkComponent implements OnInit {
4849

4950
constructor(
5051
private authorizationService: AuthorizationDataService,
52+
public dsoNameService: DSONameService,
5153
) {
5254
}
5355

src/assets/i18n/en.json5

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5386,6 +5386,8 @@
53865386

53875387
"browse.search-form.placeholder": "Search the repository",
53885388

5389+
"file-download-link.download": "Download ",
5390+
53895391
"register-page.registration.aria.label": "Enter your e-mail address",
53905392

53915393
"forgot-email.form.aria.label": "Enter your e-mail address",

src/assets/i18n/es.json5

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7831,11 +7831,12 @@
78317831
//"browse.search-form.placeholder": "Search the repository",
78327832
"browse.search-form.placeholder": "Buscar en el repositorio",
78337833

7834+
// "file-download-link.download": "Download ",
7835+
"file-download-link.download": "Descargar ",
7836+
78347837
// "register-page.registration.aria.label": "Enter your e-mail address",
78357838
"register-page.registration.aria.label": "Introduzca su dirección de correo electrónico",
78367839

78377840
// "forgot-email.form.aria.label": "Enter your e-mail address",
78387841
"forgot-email.form.aria.label": "Introduzca su dirección de correo electrónico",
7839-
7840-
78417842
}

src/assets/i18n/pt-BR.json5

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7858,6 +7858,9 @@
78587858
//"browse.search-form.placeholder": "Search the repository",
78597859
"browse.search-form.placeholder": "Buscar no repositório",
78607860

7861+
// "file-download-link.download": "Download ",
7862+
"file-download-link.download": "Baixar ",
7863+
78617864
// "register-page.registration.aria.label": "Enter your e-mail address",
78627865
"register-page.registration.aria.label": "Digite seu e-mail",
78637866

0 commit comments

Comments
 (0)