Skip to content

Commit f16015a

Browse files
Andrea-GuevaraandreaNeki
andauthored
More accessible file download link for users who use a screen reader (DSpace#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 253b2e8 commit f16015a

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 role="img" *ngIf="(canDownload$ |async) !== true" [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
@@ -22,6 +22,7 @@ import {
2222
getBitstreamDownloadRoute,
2323
getBitstreamRequestACopyRoute,
2424
} from '../../app-routing-paths';
25+
import { DSONameService } from '../../core/breadcrumbs/dso-name.service';
2526
import { AuthorizationDataService } from '../../core/data/feature-authorization/authorization-data.service';
2627
import { FeatureID } from '../../core/data/feature-authorization/feature-id';
2728
import { Bitstream } from '../../core/shared/bitstream.model';
@@ -73,6 +74,7 @@ export class FileDownloadLinkComponent implements OnInit {
7374

7475
constructor(
7576
private authorizationService: AuthorizationDataService,
77+
public dsoNameService: DSONameService,
7678
) {
7779
}
7880

src/assets/i18n/en.json5

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

67536753
"browse.search-form.placeholder": "Search the repository",
67546754

6755+
"file-download-link.download": "Download ",
6756+
67556757
"register-page.registration.aria.label": "Enter your e-mail address",
67566758

67576759
"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
@@ -8134,11 +8134,12 @@
81348134
//"browse.search-form.placeholder": "Search the repository",
81358135
"browse.search-form.placeholder": "Buscar en el repositorio",
81368136

8137+
// "file-download-link.download": "Download ",
8138+
"file-download-link.download": "Descargar ",
8139+
81378140
// "register-page.registration.aria.label": "Enter your e-mail address",
81388141
"register-page.registration.aria.label": "Introduzca su dirección de correo electrónico",
81398142

81408143
// "forgot-email.form.aria.label": "Enter your e-mail address",
81418144
"forgot-email.form.aria.label": "Introduzca su dirección de correo electrónico",
8142-
8143-
81448145
}

src/assets/i18n/pt-BR.json5

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

10235+
// "file-download-link.download": "Download ",
10236+
"file-download-link.download": "Baixar ",
10237+
1023510238
// "register-page.registration.aria.label": "Enter your e-mail address",
1023610239
"register-page.registration.aria.label": "Digite seu e-mail",
1023710240

0 commit comments

Comments
 (0)