Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix: Button aria contains text not accessible for translations (fixes #151) #156

Merged
merged 2 commits into from
Jun 26, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 9 additions & 0 deletions properties.schema
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,15 @@
"id": "http://jsonschema.net",
"$ref": "http://localhost/plugins/content/contentobject/model.schema",
"globals": {
"itemCount": {
"type": "string",
"required": true,
"title": "Item count label",
"default": "Item {{_nthChild}} of {{_totalChild}}",
"inputType": "Text",
"validators": [],
"translatable": true
},
"durationLabel": {
"type": "string",
"required": true,
Expand Down
8 changes: 8 additions & 0 deletions schema/course.schema.json
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,14 @@
"title": "Box Menu",
"default": {},
"properties": {
"itemCount": {
"type": "string",
"title": "Item count label",
"default": "Item {{_nthChild}} of {{_totalChild}}",
"_adapt": {
"translatable": true
}
},
"durationLabel": {
"type": "string",
"title": "Duration label",
Expand Down
2 changes: 1 addition & 1 deletion templates/boxMenuItem.hbs
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@
</div>

<div class="menu-item__button-container boxmenu-item__button-container">
<button class="btn-text menu-item__button boxmenu-item__button js-btn-click{{#if _isVisited}} is-visited{{/if}}{{#if _isLocked}} is-locked{{/if}}" aria-label="{{#if _isComplete}} {{_globals._accessibility._ariaLabels.complete}}.{{else _isVisited}} {{_globals._accessibility._ariaLabels.visited}}.{{/if}} {{linkText}} {{title}}. Item {{_nthChild}} of {{_totalChild}}.{{#if _isOptional}} {{_globals._accessibility._ariaLabels.optional}}{{/if}}"{{#if _isLocked}} aria-disabled="true"{{/if}}>
<button class="btn-text menu-item__button boxmenu-item__button js-btn-click{{#if _isVisited}} is-visited{{/if}}{{#if _isLocked}} is-locked{{/if}}" aria-label="{{#if _isComplete}}{{_globals._accessibility._ariaLabels.complete}}. {{else _isVisited}}{{_globals._accessibility._ariaLabels.visited}}. {{/if}}{{linkText}} {{title}}. {{{compile _globals._menu._boxMenu.itemCount}}}.{{#if _isOptional}} {{_globals._accessibility._ariaLabels.optional}}{{/if}}"{{#if _isLocked}} aria-disabled="true"{{/if}}>
{{{linkText}}}
</button>

Expand Down