From c02adead7467f414eefd7849704bf6579f41ef14 Mon Sep 17 00:00:00 2001 From: andreaNeki Date: Mon, 26 Aug 2024 10:37:33 -0300 Subject: [PATCH 1/6] More accessible file download link for users who use a screen reader --- .../file-download-link.component.html | 6 +++++- .../file-download-link.component.ts | 11 +++++++++++ src/assets/i18n/en.json5 | 2 ++ src/assets/i18n/es.json5 | 3 +++ src/assets/i18n/pt-BR.json5 | 3 +++ 5 files changed, 24 insertions(+), 1 deletion(-) diff --git a/src/app/shared/file-download-link/file-download-link.component.html b/src/app/shared/file-download-link/file-download-link.component.html index d649c0ad4e2..779a47eced8 100644 --- a/src/app/shared/file-download-link/file-download-link.component.html +++ b/src/app/shared/file-download-link/file-download-link.component.html @@ -1,4 +1,8 @@ - + diff --git a/src/app/shared/file-download-link/file-download-link.component.ts b/src/app/shared/file-download-link/file-download-link.component.ts index 9b01cd799d4..2952dc0ee85 100644 --- a/src/app/shared/file-download-link/file-download-link.component.ts +++ b/src/app/shared/file-download-link/file-download-link.component.ts @@ -71,6 +71,11 @@ export class FileDownloadLinkComponent implements OnInit { canDownload$: Observable; + /** + * Get the bitstream name + */ + bitstreamName: string; + constructor( private authorizationService: AuthorizationDataService, ) { @@ -87,6 +92,8 @@ export class FileDownloadLinkComponent implements OnInit { this.bitstreamPath$ = observableOf(this.getBitstreamDownloadPath()); this.canDownload$ = observableOf(true); } + + this.getBitstreamName() } getBitstreamPath(canDownload: boolean, canRequestACopy: boolean) { @@ -102,4 +109,8 @@ export class FileDownloadLinkComponent implements OnInit { queryParams: {}, }; } + + getBitstreamName() { + return this.bitstreamName = this.bitstream.name; + } } diff --git a/src/assets/i18n/en.json5 b/src/assets/i18n/en.json5 index 8f20c657f94..40a6cac692f 100644 --- a/src/assets/i18n/en.json5 +++ b/src/assets/i18n/en.json5 @@ -6739,4 +6739,6 @@ "item.page.cc.license.disclaimer": "Except where otherwised noted, this item's license is described as", "browse.search-form.placeholder": "Search the repository", + + "file-download-link.download": "Download ", } diff --git a/src/assets/i18n/es.json5 b/src/assets/i18n/es.json5 index 55962d25b5f..fe0805079a0 100644 --- a/src/assets/i18n/es.json5 +++ b/src/assets/i18n/es.json5 @@ -8152,5 +8152,8 @@ //"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 ", + } diff --git a/src/assets/i18n/pt-BR.json5 b/src/assets/i18n/pt-BR.json5 index c3b26a09d28..aaa7778035c 100644 --- a/src/assets/i18n/pt-BR.json5 +++ b/src/assets/i18n/pt-BR.json5 @@ -10249,4 +10249,7 @@ //"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 ", } From 405a48378cfa2d598d6cb1ec8ddbec0cf17bb268 Mon Sep 17 00:00:00 2001 From: andreaNeki Date: Mon, 26 Aug 2024 12:37:38 -0300 Subject: [PATCH 2/6] Refactoring implementation - More accessible file download link for users who use a screen reader --- .../file-download-link.component.html | 2 +- .../file-download-link.component.ts | 13 ++----------- 2 files changed, 3 insertions(+), 12 deletions(-) diff --git a/src/app/shared/file-download-link/file-download-link.component.html b/src/app/shared/file-download-link/file-download-link.component.html index 779a47eced8..aea5c4562cb 100644 --- a/src/app/shared/file-download-link/file-download-link.component.html +++ b/src/app/shared/file-download-link/file-download-link.component.html @@ -2,7 +2,7 @@ [queryParams]="(bitstreamPath$| async)?.queryParams" [target]="isBlank ? '_blank': '_self'" [ngClass]="cssClasses" - [attr.aria-label]="('file-download-link.download' | translate) + getBitstreamName()"> + [attr.aria-label]="('file-download-link.download' | translate) + dsoNameService.getName(bitstream)"> diff --git a/src/app/shared/file-download-link/file-download-link.component.ts b/src/app/shared/file-download-link/file-download-link.component.ts index 2952dc0ee85..1c3e8c9eb96 100644 --- a/src/app/shared/file-download-link/file-download-link.component.ts +++ b/src/app/shared/file-download-link/file-download-link.component.ts @@ -26,6 +26,7 @@ import { AuthorizationDataService } from '../../core/data/feature-authorization/ import { FeatureID } from '../../core/data/feature-authorization/feature-id'; import { Bitstream } from '../../core/shared/bitstream.model'; import { Item } from '../../core/shared/item.model'; +import { DSONameService } from '../../core/breadcrumbs/dso-name.service'; import { hasValue, isNotEmpty, @@ -71,13 +72,9 @@ export class FileDownloadLinkComponent implements OnInit { canDownload$: Observable; - /** - * Get the bitstream name - */ - bitstreamName: string; - constructor( private authorizationService: AuthorizationDataService, + public dsoNameService: DSONameService, ) { } @@ -92,8 +89,6 @@ export class FileDownloadLinkComponent implements OnInit { this.bitstreamPath$ = observableOf(this.getBitstreamDownloadPath()); this.canDownload$ = observableOf(true); } - - this.getBitstreamName() } getBitstreamPath(canDownload: boolean, canRequestACopy: boolean) { @@ -109,8 +104,4 @@ export class FileDownloadLinkComponent implements OnInit { queryParams: {}, }; } - - getBitstreamName() { - return this.bitstreamName = this.bitstream.name; - } } From e43469f67f0bc91bdd62582cf480c07d07eb4bc4 Mon Sep 17 00:00:00 2001 From: andreaNeki Date: Wed, 28 Aug 2024 09:09:16 -0300 Subject: [PATCH 3/6] Fixing import error --- .../shared/file-download-link/file-download-link.component.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/app/shared/file-download-link/file-download-link.component.ts b/src/app/shared/file-download-link/file-download-link.component.ts index 1c3e8c9eb96..3080a94bd3e 100644 --- a/src/app/shared/file-download-link/file-download-link.component.ts +++ b/src/app/shared/file-download-link/file-download-link.component.ts @@ -22,11 +22,11 @@ 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'; import { Item } from '../../core/shared/item.model'; -import { DSONameService } from '../../core/breadcrumbs/dso-name.service'; import { hasValue, isNotEmpty, From 77ea67c359e238dcd0ef57ca218c94c7a43ecdbd Mon Sep 17 00:00:00 2001 From: andreaNeki Date: Tue, 3 Dec 2024 13:47:55 -0300 Subject: [PATCH 4/6] Solving the spaces error --- src/assets/i18n/es.json5 | 2 -- 1 file changed, 2 deletions(-) diff --git a/src/assets/i18n/es.json5 b/src/assets/i18n/es.json5 index c526c807140..7ee24fd2af0 100644 --- a/src/assets/i18n/es.json5 +++ b/src/assets/i18n/es.json5 @@ -8142,6 +8142,4 @@ // "forgot-email.form.aria.label": "Enter your e-mail address", "forgot-email.form.aria.label": "Introduzca su dirección de correo electrónico", - - } From 3c41a4d8e6422e646253dda914cf8620903f76e1 Mon Sep 17 00:00:00 2001 From: root Date: Wed, 4 Dec 2024 16:25:00 -0300 Subject: [PATCH 5/6] Solving the spaces error --- src/assets/i18n/en.json5 | 2 +- src/assets/i18n/pt-BR.json5 | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/assets/i18n/en.json5 b/src/assets/i18n/en.json5 index b45a64228ac..27d85f5042b 100644 --- a/src/assets/i18n/en.json5 +++ b/src/assets/i18n/en.json5 @@ -6737,7 +6737,7 @@ "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", diff --git a/src/assets/i18n/pt-BR.json5 b/src/assets/i18n/pt-BR.json5 index 1a41a28829d..e012bb54bad 100644 --- a/src/assets/i18n/pt-BR.json5 +++ b/src/assets/i18n/pt-BR.json5 @@ -10216,7 +10216,7 @@ // "search.filters.filter.notifyEndorsement.head": "Notify Endorsement", "search.filters.filter.notifyEndorsement.head": "Notificar Avaliação", - + // "search.filters.filter.notifyEndorsement.placeholder": "Notify Endorsement", "search.filters.filter.notifyEndorsement.placeholder": "Notificar Avaliação", From 0242fb2d04f733c65a4ca1e58f527f5d9dd00767 Mon Sep 17 00:00:00 2001 From: root Date: Wed, 4 Dec 2024 16:35:53 -0300 Subject: [PATCH 6/6] Solving the spaces error in file pt-BR.json5 --- src/assets/i18n/pt-BR.json5 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/assets/i18n/pt-BR.json5 b/src/assets/i18n/pt-BR.json5 index e012bb54bad..1a41a28829d 100644 --- a/src/assets/i18n/pt-BR.json5 +++ b/src/assets/i18n/pt-BR.json5 @@ -10216,7 +10216,7 @@ // "search.filters.filter.notifyEndorsement.head": "Notify Endorsement", "search.filters.filter.notifyEndorsement.head": "Notificar Avaliação", - + // "search.filters.filter.notifyEndorsement.placeholder": "Notify Endorsement", "search.filters.filter.notifyEndorsement.placeholder": "Notificar Avaliação",