Skip to content

Commit

Permalink
Properly translate attribution close label (fixes #1083) (#1126)
Browse files Browse the repository at this point in the history
  • Loading branch information
demiankatz authored Oct 16, 2024
1 parent d39123b commit c0fda72
Show file tree
Hide file tree
Showing 10 changed files with 32 additions and 14 deletions.
1 change: 1 addition & 0 deletions src/content-handlers/iiif/BaseConfig.ts
Original file line number Diff line number Diff line change
Expand Up @@ -153,6 +153,7 @@ export type CenterPanelOptions = {

export type CenterPanelContent = {
attribution: string;
close: string;
};

type CenterPanel = ModuleConfig & {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -199,7 +199,8 @@
"requiredStatementEnabled": true
},
"content": {
"attribution": "$attribution"
"attribution": "$attribution",
"close": "$close"
}
},
"alephCenterPanel": {
Expand All @@ -211,7 +212,8 @@
"dracoDecoderPath": "uv/lib/"
},
"content": {
"attribution": "Attribution"
"attribution": "$attribution",
"close": "$close"
}
},
"settingsDialogue": {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -226,7 +226,8 @@
"requiredStatementEnabled": true
},
"content": {
"attribution": "$attribution"
"attribution": "$attribution",
"close": "$close"
}
},
"avCenterPanel": {
Expand All @@ -248,6 +249,7 @@
},
"content": {
"attribution": "$attribution",
"close": "$close",
"currentTime": "$currentTime",
"delimiter": " - ",
"duration": "$duration",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,8 @@
"requiredStatementEnabled": true
},
"content": {
"attribution": "$attribution"
"attribution": "$attribution",
"close": "$close"
}
},
"fileLinkCenterPanel": {
Expand All @@ -104,7 +105,8 @@
"requiredStatementEnabled": true
},
"content": {
"attribution": "$attribution"
"attribution": "$attribution",
"close": "$close"
}
},
"footerPanel": {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -195,7 +195,8 @@
"requiredStatementEnabled": true
},
"content": {
"attribution": "$attribution"
"attribution": "$attribution",
"close": "$close"
}
},
"ebookCenterPanel": {
Expand All @@ -206,7 +207,8 @@
"requiredStatementEnabled": true
},
"content": {
"attribution": "$attribution"
"attribution": "$attribution",
"close": "$close"
}
},
"settingsDialogue": {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -153,7 +153,8 @@
"requiredStatementEnabled": true
},
"content": {
"attribution": "$attribution"
"attribution": "$attribution",
"close": "$close"
}
},
"mediaelementCenterPanel": {
Expand All @@ -167,7 +168,8 @@
"requiredStatementEnabled": true
},
"content": {
"attribution": "$attribution"
"attribution": "$attribution",
"close": "$close"
}
},
"restrictedDialogue": {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -244,7 +244,8 @@
"requiredStatementEnabled": true
},
"content": {
"attribution": "$attribution"
"attribution": "$attribution",
"close": "$close"
}
},
"modelViewerCenterPanel": {
Expand All @@ -260,6 +261,7 @@
},
"content": {
"attribution": "$attribution",
"close": "$close",
"zoomIn": "$zoomIn",
"zoomOut": "$zoomOut",
"vr": "$vr"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -333,7 +333,8 @@
"requiredStatementEnabled": true
},
"content": {
"attribution": "$attribution"
"attribution": "$attribution",
"close": "$close"
}
},
"openSeadragonCenterPanel": {
Expand Down Expand Up @@ -361,6 +362,7 @@
},
"content": {
"attribution": "$attribution",
"close": "$close",
"goHome": "$goHome",
"imageUnavailable": "$imageUnavailable",
"next": "$next",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -171,7 +171,8 @@
"requiredStatementEnabled": true
},
"content": {
"attribution": "$attribution"
"attribution": "$attribution",
"close": "$close"
}
},
"pdfCenterPanel": {
Expand All @@ -183,7 +184,8 @@
"usePdfJs": true
},
"content": {
"attribution": "$attribution"
"attribution": "$attribution",
"close": "$close"
}
},
"resourcesLeftPanel": {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ export class CenterPanel<
<div class="attribution">
<div class="header">
<div class="title"></div>
<button type="button" class="close" aria-label="Close">
<button type="button" class="close">
<span aria-hidden="true">&#215;</span>
</button>
</div>
Expand All @@ -73,6 +73,7 @@ export class CenterPanel<
this.closeAttribution();

this.$closeAttributionButton = this.$attribution.find(".header .close");
this.$closeAttributionButton.attr("aria-label", this.content.close);
this.$closeAttributionButton.on("click", (e) => {
e.preventDefault();
this.closeAttribution();
Expand Down

0 comments on commit c0fda72

Please sign in to comment.