vpat 27/28: rtfScan aria edits (#4020)

- linked input/output file labels to the input fields so
they have descriptive names
- added more detailed button labels
- fixed "No file selected" not appearing if no file is selected
This commit is contained in:
abaevbog 2024-06-06 00:03:58 -05:00 committed by GitHub
parent f30d8f07d5
commit 4f7b43747a
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
3 changed files with 18 additions and 14 deletions

View file

@ -645,10 +645,11 @@ const Zotero_RTFScan = { // eslint-disable-line no-unused-vars, camelcase
this.wizard.canAdvance = newCanAdvance; this.wizard.canAdvance = newCanAdvance;
}, },
updatePath() { async updatePath() {
this.wizard.canAdvance = this.inputFile && this.outputFile; this.wizard.canAdvance = this.inputFile && this.outputFile;
document.getElementById('input-path').value = this.inputFile ? this.inputFile.path : ''; let noFileSelectedLabel = await document.l10n.formatValue("rtfScan-no-file-selected");
document.getElementById('output-path').value = this.outputFile ? this.outputFile.path : ''; document.getElementById('input-path').value = this.inputFile ? this.inputFile.path : noFileSelectedLabel;
document.getElementById('output-path').value = this.outputFile ? this.outputFile.path : noFileSelectedLabel;
}, },
insertRows(newRows, beforeRow) { insertRows(newRows, beforeRow) {

View file

@ -35,17 +35,17 @@
<span class="page-start-2" data-l10n-id="rtfScan-introPage-description2" /> <span class="page-start-2" data-l10n-id="rtfScan-introPage-description2" />
</div> </div>
<div> <div>
<label for="choose-input-file" class="file-input-label" data-l10n-id="rtfScan-input-file" /> <label control="input-path" class="file-input-label" data-l10n-id="rtfScan-input-file" />
<div class="file-input-container"> <div class="file-input-container">
<html:input type="text" data-l10n-id="zotero-file-none-selected" id="input-path" readonly="true" /> <html:input type="text" id="input-path" readonly="true"/>
<button id="choose-input-file" data-l10n-id="zotero-file-choose" /> <button id="choose-input-file" data-l10n-id="rtfScan-choose-input-file" />
</div> </div>
</div> </div>
<div> <div>
<label for="choose-output-file" class="file-input-label" data-l10n-id="rtfScan-output-file" /> <label control="output-path" class="file-input-label" data-l10n-id="rtfScan-output-file" />
<div class="file-input-container"> <div class="file-input-container">
<html:input type="text" data-l10n-id="zotero-file-none-selected" id="output-path" readonly="true" /> <html:input type="text" id="output-path" readonly="true"/>
<button id="choose-output-file" data-l10n-id="zotero-file-choose" /> <button id="choose-output-file" data-l10n-id="rtfScan-choose-output-file" />
</div> </div>
</div> </div>
</wizardpage> </wizardpage>

View file

@ -8,6 +8,7 @@ return-or-enter =
general-remove = Remove general-remove = Remove
general-add = Add general-add = Add
general-remind-me-later = Remind Me Later general-remind-me-later = Remind Me Later
general-choose-file = Choose File…
menu-file-show-in-finder = menu-file-show-in-finder =
.label = Show in Finder .label = Show in Finder
@ -219,11 +220,13 @@ rtfScan-introPage-description2 = To get started, select an RTF input file and an
rtfScan-input-file = Input File rtfScan-input-file = Input File
rtfScan-output-file = Output File rtfScan-output-file = Output File
zotero-file-none-selected = rtfScan-no-file-selected = No file selected
.value = No file selected rtfScan-choose-input-file =
.label = { general-choose-file }
zotero-file-choose = .aria-label = Choose Input File
.label = Choose File… rtfScan-choose-output-file =
.label = { general-choose-file }
.aria-label = Choose Output File
rtfScan-intro-page = rtfScan-intro-page =
.label = Introduction .label = Introduction