Skip to content

Commit

Permalink
More accessible file download link for users who use a screen reader (#…
Browse files Browse the repository at this point in the history
…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 <[email protected]>
  • Loading branch information
Andrea-Guevara and andreaNeki authored Dec 18, 2024
1 parent 253b2e8 commit f16015a
Show file tree
Hide file tree
Showing 5 changed files with 15 additions and 3 deletions.
Original file line number Diff line number Diff line change
@@ -1,4 +1,8 @@
<a [routerLink]="(bitstreamPath$| async)?.routerLink" class="dont-break-out" [queryParams]="(bitstreamPath$| async)?.queryParams" [target]="isBlank ? '_blank': '_self'" [ngClass]="cssClasses">
<a [routerLink]="(bitstreamPath$| async)?.routerLink" class="dont-break-out"
[queryParams]="(bitstreamPath$| async)?.queryParams"
[target]="isBlank ? '_blank': '_self'"
[ngClass]="cssClasses"
[attr.aria-label]="('file-download-link.download' | translate) + dsoNameService.getName(bitstream)">
<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>
<ng-container *ngTemplateOutlet="content"></ng-container>
</a>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ import {
getBitstreamDownloadRoute,
getBitstreamRequestACopyRoute,
} from '../../app-routing-paths';
import { DSONameService } from '../../core/breadcrumbs/dso-name.service';
import { AuthorizationDataService } from '../../core/data/feature-authorization/authorization-data.service';
import { FeatureID } from '../../core/data/feature-authorization/feature-id';
import { Bitstream } from '../../core/shared/bitstream.model';
Expand Down Expand Up @@ -73,6 +74,7 @@ export class FileDownloadLinkComponent implements OnInit {

constructor(
private authorizationService: AuthorizationDataService,
public dsoNameService: DSONameService,
) {
}

Expand Down
2 changes: 2 additions & 0 deletions src/assets/i18n/en.json5
Original file line number Diff line number Diff line change
Expand Up @@ -6752,6 +6752,8 @@

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

"file-download-link.download": "Download ",

"register-page.registration.aria.label": "Enter your e-mail address",

"forgot-email.form.aria.label": "Enter your e-mail address",
Expand Down
5 changes: 3 additions & 2 deletions src/assets/i18n/es.json5
Original file line number Diff line number Diff line change
Expand Up @@ -8134,11 +8134,12 @@
//"browse.search-form.placeholder": "Search the repository",
"browse.search-form.placeholder": "Buscar en el repositorio",

// "file-download-link.download": "Download ",
"file-download-link.download": "Descargar ",

// "register-page.registration.aria.label": "Enter your e-mail address",
"register-page.registration.aria.label": "Introduzca su dirección de correo electrónico",

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


}
3 changes: 3 additions & 0 deletions src/assets/i18n/pt-BR.json5
Original file line number Diff line number Diff line change
Expand Up @@ -10232,6 +10232,9 @@
//"browse.search-form.placeholder": "Search the repository",
"browse.search-form.placeholder": "Buscar no repositório",

// "file-download-link.download": "Download ",
"file-download-link.download": "Baixar ",

// "register-page.registration.aria.label": "Enter your e-mail address",
"register-page.registration.aria.label": "Digite seu e-mail",

Expand Down

0 comments on commit f16015a

Please sign in to comment.