1
0
mirror of https://github.com/flarum/core.git synced 2025-08-08 09:26:34 +02:00

[1.x] chore(core, tags): resolve a11y warnings in Admin Frontend (#4114)

* chore: add accessible label to scope removal button

* chore: add accessible label to edit tag button
This commit is contained in:
Davide Iadeluca
2024-11-19 17:57:49 +01:00
committed by GitHub
parent 00329eaee0
commit 345023242b
4 changed files with 14 additions and 2 deletions

View File

@@ -16,7 +16,12 @@ function tagItem(tag) {
<div className="TagListItem-info">
{tagIcon(tag)}
<span className="TagListItem-name">{tag.name()}</span>
<Button className="Button Button--link" icon="fas fa-pencil-alt" onclick={() => app.modal.show(EditTagModal, { model: tag })} />
<Button
className="Button Button--link"
icon="fas fa-pencil-alt"
aria-label={app.translator.trans('flarum-tags.admin.tags.edit_tag_label', { tag: tag.name() })}
onclick={() => app.modal.show(EditTagModal, { model: tag })}
/>
</div>
{!tag.isChild() && tag.position() !== null && (
<ol className="TagListItem-children TagList">

View File

@@ -56,6 +56,7 @@ flarum-tags:
about_tags_text: "Tags are used to categorize discussions. Primary tags are like traditional forum categories: they can be arranged in a two-level hierarchy. Secondary tags do not have hierarchy or order, and are useful for micro-categorization."
create_primary_tag_button: Create Primary Tag
create_secondary_tag_button: Create Secondary Tag
edit_tag_label: Edit Tag {tag}
primary_heading: Primary Tags
secondary_heading: Secondary Tags
settings_heading: Settings

View File

@@ -57,7 +57,12 @@ export default class PermissionGrid<CustomAttrs extends IPermissionGridAttrs = I
<th>
{scope.label}{' '}
{!!scope.onremove && (
<Button icon="fas fa-times" className="Button Button--text PermissionGrid-removeScope" onclick={scope.onremove} />
<Button
icon="fas fa-times"
className="Button Button--text PermissionGrid-removeScope"
aria-label={app.translator.trans('core.admin.permissions.remove_scope_label', { scope: scope.label })}
onclick={scope.onremove}
/>
)}
</th>
))}

View File

@@ -226,6 +226,7 @@ core:
participate_heading: Participate
post_without_throttle_label: Reply multiple times without waiting
read_heading: Read
remove_scope_label: Remove scope of {scope}
rename_discussions_label: Rename discussions
reply_to_discussions_label: Reply to discussions
search_users_label: => core.ref.search_users