Skip to content

Commit beef2ac

Browse files
Andrea-GuevaraandreaNeki
authored andcommitted
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 3bd84a6 commit beef2ac

5 files changed

Lines changed: 15 additions & 3 deletions

File tree

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
@@ -6758,6 +6758,8 @@
67586758

67596759
"browse.search-form.placeholder": "Search the repository",
67606760

6761+
"file-download-link.download": "Download ",
6762+
67616763
"register-page.registration.aria.label": "Enter your e-mail address",
67626764

67636765
"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
@@ -8152,11 +8152,12 @@
81528152
//"browse.search-form.placeholder": "Search the repository",
81538153
"browse.search-form.placeholder": "Buscar en el repositorio",
81548154

8155+
// "file-download-link.download": "Download ",
8156+
"file-download-link.download": "Descargar ",
8157+
81558158
// "register-page.registration.aria.label": "Enter your e-mail address",
81568159
"register-page.registration.aria.label": "Introduzca su dirección de correo electrónico",
81578160

81588161
// "forgot-email.form.aria.label": "Enter your e-mail address",
81598162
"forgot-email.form.aria.label": "Introduzca su dirección de correo electrónico",
8160-
8161-
81628163
}

src/assets/i18n/pt-BR.json5

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

10253+
// "file-download-link.download": "Download ",
10254+
"file-download-link.download": "Baixar ",
10255+
1025310256
// "register-page.registration.aria.label": "Enter your e-mail address",
1025410257
"register-page.registration.aria.label": "Digite seu e-mail",
1025510258

0 commit comments

Comments
 (0)