Skip to content

Commit f7a9fd1

Browse files
authored
Merge pull request #485 from BeAPI/fix-social-a11y
Update share link attributes for accessibility
2 parents f5476e1 + e4ec8dd commit f7a9fd1

4 files changed

Lines changed: 274 additions & 145 deletions

File tree

inc/Helpers/Formatting/Share.php

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -49,8 +49,8 @@ function get_share_link( string $name, string $link_to_share, array $share_attri
4949

5050
$networks = [
5151
'facebook' => [
52-
'attributes' => [
53-
'title' => __( 'Share on Facebook', 'beapi-frontend-framework' ),
52+
'accessible_name' => __( 'Share on Facebook', 'beapi-frontend-framework' ),
53+
'attributes' => [
5454
'href' => 'http://www.facebook.com/sharer.php',
5555
'class' => 'share__link',
5656
],
@@ -60,8 +60,8 @@ function get_share_link( string $name, string $link_to_share, array $share_attri
6060
],
6161
],
6262
'x' => [
63-
'attributes' => [
64-
'title' => __( 'Share on X', 'beapi-frontend-framework' ),
63+
'accessible_name' => __( 'Share on X', 'beapi-frontend-framework' ),
64+
'attributes' => [
6565
'href' => 'https://twitter.com/intent/tweet',
6666
'class' => 'share__link',
6767
],
@@ -71,8 +71,8 @@ function get_share_link( string $name, string $link_to_share, array $share_attri
7171
],
7272
],
7373
'linkedin' => [
74-
'attributes' => [
75-
'title' => __( 'Share on Linkedin', 'beapi-frontend-framework' ),
74+
'accessible_name' => __( 'Share on Linkedin', 'beapi-frontend-framework' ),
75+
'attributes' => [
7676
'href' => 'https://www.linkedin.com/shareArticle',
7777
'class' => 'share__link',
7878
],
@@ -82,8 +82,8 @@ function get_share_link( string $name, string $link_to_share, array $share_attri
8282
],
8383
],
8484
'instagram' => [
85-
'attributes' => [
86-
'title' => __( 'Share on Instagram', 'beapi-frontend-framework' ),
85+
'accessible_name' => __( 'Share on Instagram', 'beapi-frontend-framework' ),
86+
'attributes' => [
8787
'href' => 'https://www.instagram.com/',
8888
'class' => 'share__link',
8989
],
@@ -93,8 +93,8 @@ function get_share_link( string $name, string $link_to_share, array $share_attri
9393
],
9494
],
9595
'bluesky' => [
96-
'attributes' => [
97-
'title' => __( 'Share on Bluesky', 'beapi-frontend-framework' ),
96+
'accessible_name' => __( 'Share on Bluesky', 'beapi-frontend-framework' ),
97+
'attributes' => [
9898
'href' => 'https://bsky.app/intent/compose',
9999
'class' => 'share__link',
100100
],
@@ -104,8 +104,8 @@ function get_share_link( string $name, string $link_to_share, array $share_attri
104104
],
105105
],
106106
'email' => [
107-
'attributes' => [
108-
'title' => __( 'Share on Email', 'beapi-frontend-framework' ),
107+
'accessible_name' => __( 'Share by email', 'beapi-frontend-framework' ),
108+
'attributes' => [
109109
'href' => 'mailto:',
110110
'class' => 'share__link',
111111
],
@@ -146,7 +146,7 @@ function get_share_link( string $name, string $link_to_share, array $share_attri
146146
'content' => sprintf(
147147
'%s<span class="sr-only">%s</span>',
148148
$icon_html,
149-
$network['attributes']['title']
149+
(string) ( $network['accessible_name'] ?? '' )
150150
),
151151
'mode' => 'button',
152152
'before' => '<li>',
Lines changed: 113 additions & 63 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
# Copyright (C) 2025 BeAPI
2-
# This file is distributed under the .
1+
# Copyright (C) 2026 BeAPI
2+
# This file is distributed under the same license as the Be API Frontend Framework theme.
33
msgid ""
44
msgstr ""
55
"Project-Id-Version: Be API Frontend Framework 1.0.0\n"
@@ -9,9 +9,9 @@ msgstr ""
99
"MIME-Version: 1.0\n"
1010
"Content-Type: text/plain; charset=UTF-8\n"
1111
"Content-Transfer-Encoding: 8bit\n"
12-
"POT-Creation-Date: 2025-02-18T15:06:50+00:00\n"
12+
"POT-Creation-Date: 2026-04-20T12:32:17+00:00\n"
1313
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
14-
"X-Generator: WP-CLI 2.10.0\n"
14+
"X-Generator: WP-CLI 2.12.0\n"
1515
"X-Domain: beapi-frontend-framework\n"
1616

1717
#. Theme Name of the theme
@@ -43,39 +43,40 @@ msgstr ""
4343
msgid "Footer"
4444
msgstr ""
4545

46-
#: header.php:33
46+
#: header.php:28
4747
msgid "Fast access links"
4848
msgstr ""
4949

50-
#: header.php:36
50+
#: header.php:31
51+
#: header.php:34
5152
msgid "Go to main navigation menu"
5253
msgstr ""
5354

54-
#: header.php:39
55+
#: header.php:37
5556
msgid "Go to main content"
5657
msgstr ""
5758

58-
#: header.php:42
59+
#: header.php:40
5960
msgid "Go to footer"
6061
msgstr ""
6162

62-
#: header.php:46
63+
#: header.php:44
6364
msgid "Header"
6465
msgstr ""
6566

66-
#: header.php:56
67+
#: header.php:54
6768
msgid "Open the menu"
6869
msgstr ""
6970

70-
#: header.php:57
71+
#: header.php:55
7172
msgid "Close the menu"
7273
msgstr ""
7374

74-
#: header.php:60
75+
#: header.php:58
7576
msgid "Main navigation"
7677
msgstr ""
7778

78-
#: header.php:79
79+
#: header.php:77
7980
msgid "Main content"
8081
msgstr ""
8182

@@ -91,98 +92,67 @@ msgstr ""
9192
msgid "New window"
9293
msgstr ""
9394

94-
#: inc/Helpers/Formatting/Share.php:53
95+
#: inc/Helpers/Formatting/Share.php:52
9596
msgid "Share on Facebook"
9697
msgstr ""
9798

98-
#: inc/Helpers/Formatting/Share.php:64
99+
#: inc/Helpers/Formatting/Share.php:63
99100
msgid "Share on X"
100101
msgstr ""
101102

102-
#: inc/Helpers/Formatting/Share.php:75
103+
#: inc/Helpers/Formatting/Share.php:74
103104
msgid "Share on Linkedin"
104105
msgstr ""
105106

106-
#: inc/Helpers/Formatting/Share.php:86
107+
#: inc/Helpers/Formatting/Share.php:85
107108
msgid "Share on Instagram"
108109
msgstr ""
109110

110-
#: inc/Helpers/Formatting/Share.php:97
111+
#: inc/Helpers/Formatting/Share.php:96
111112
msgid "Share on Bluesky"
112113
msgstr ""
113114

114-
#: inc/Helpers/Formatting/Share.php:108
115-
msgid "Share on Email"
115+
#: inc/Helpers/Formatting/Share.php:107
116+
msgid "Share by email"
116117
msgstr ""
117118

118-
#: inc/Services/Editor.php:81
119-
msgid "Dark"
120-
msgstr ""
121-
122-
#: inc/Services/Editor.php:86
123-
msgid "Light"
124-
msgstr ""
125-
126-
#: inc/Services/Editor.php:91
127-
msgid "Primary"
128-
msgstr ""
129-
130-
#: inc/Services/Editor.php:96
131-
msgid "Secondary"
132-
msgstr ""
133-
134-
#: inc/Services/Editor.php:107
135-
msgid "Title 6"
136-
msgstr ""
137-
138-
#: inc/Services/Editor.php:113
139-
msgid "Title 5"
140-
msgstr ""
141-
142-
#: inc/Services/Editor.php:119
143-
msgid "Title 4"
144-
msgstr ""
145-
146-
#: inc/Services/Editor.php:125
147-
msgid "Title 3"
148-
msgstr ""
149-
150-
#: inc/Services/Editor.php:131
151-
msgid "Title 2"
152-
msgstr ""
153-
154-
#: inc/Services/Editor.php:137
155-
msgid "Title 1"
156-
msgstr ""
157-
158-
#: inc/Services/Editor.php:251
119+
#: inc/Services/Editor.php:144
159120
msgid "Small"
160121
msgstr ""
161122

162-
#: inc/Services/Editor.php:259
123+
#: inc/Services/Editor.php:152
163124
msgid "Large"
164125
msgstr ""
165126

166-
#: inc/Services/Editor.php:267
127+
#: inc/Services/Editor.php:160
167128
msgid "Huge"
168129
msgstr ""
169130

131+
#. translators: %s: heading number
132+
#: inc/Services/Editor.php:168
133+
#, php-format
134+
msgid "Style H%s"
135+
msgstr ""
136+
170137
#: inc/Services/Editor_Patterns.php:40
171138
msgid "Common"
172139
msgstr ""
173140

174141
#. translators: %s: file name.
175142
#: inc/Services/Editor_Patterns.php:125
143+
#, php-format
176144
msgid "Could not register file \"%s\" as a block pattern (\"Slug\" field missing)"
177145
msgstr ""
178146

179147
#. translators: %1s: file name; %2s: slug value found.
180148
#: inc/Services/Editor_Patterns.php:138
149+
#, php-format
181150
msgid "Could not register file \"%1$s\" as a block pattern (invalid slug \"%2$s\")"
182151
msgstr ""
183152

184153
#. translators: %1s: file name; %2s: slug value found.
185154
#: inc/Services/Editor_Patterns.php:155
155+
#, php-format
186156
msgid "Could not register file \"%s\" as a block pattern (\"Title\" field missing)"
187157
msgstr ""
188158

@@ -198,3 +168,83 @@ msgstr ""
198168
msgctxt "Pattern title"
199169
msgid "Media Text"
200170
msgstr ""
171+
172+
#: theme.json
173+
msgctxt "Color name"
174+
msgid "Noir"
175+
msgstr ""
176+
177+
#: theme.json
178+
msgctxt "Color name"
179+
msgid "Blanc"
180+
msgstr ""
181+
182+
#: theme.json
183+
msgctxt "Color name"
184+
msgid "Jaune 500"
185+
msgstr ""
186+
187+
#: theme.json
188+
msgctxt "Color name"
189+
msgid "Gris 100"
190+
msgstr ""
191+
192+
#: theme.json
193+
msgctxt "Color name"
194+
msgid "Gris 200"
195+
msgstr ""
196+
197+
#: theme.json
198+
msgctxt "Color name"
199+
msgid "Gris 300"
200+
msgstr ""
201+
202+
#: theme.json
203+
msgctxt "Color name"
204+
msgid "Gris 400"
205+
msgstr ""
206+
207+
#: theme.json
208+
msgctxt "Color name"
209+
msgid "Gris 500"
210+
msgstr ""
211+
212+
#: theme.json
213+
msgctxt "Color name"
214+
msgid "Gris 600"
215+
msgstr ""
216+
217+
#: theme.json
218+
msgctxt "Color name"
219+
msgid "Gris 700"
220+
msgstr ""
221+
222+
#: theme.json
223+
msgctxt "Color name"
224+
msgid "Gris 800"
225+
msgstr ""
226+
227+
#: theme.json
228+
msgctxt "Color name"
229+
msgid "Gris 900"
230+
msgstr ""
231+
232+
#: theme.json
233+
msgctxt "Space size name"
234+
msgid "xs (16px)"
235+
msgstr ""
236+
237+
#: theme.json
238+
msgctxt "Space size name"
239+
msgid "sm (32px)"
240+
msgstr ""
241+
242+
#: theme.json
243+
msgctxt "Space size name"
244+
msgid "md (48px)"
245+
msgstr ""
246+
247+
#: theme.json
248+
msgctxt "Space size name"
249+
msgid "lg (64px)"
250+
msgstr ""

languages/fr_FR.mo

-448 Bytes
Binary file not shown.

0 commit comments

Comments
 (0)