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

Mark translations that are only for screen readers #323

Merged
merged 1 commit into from
Sep 29, 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
1 change: 1 addition & 0 deletions duplicate-post.php
Original file line number Diff line number Diff line change
Expand Up @@ -97,6 +97,7 @@ function duplicate_post_plugin_actions( $actions ) {
'settings' => sprintf(
'<a href="%1$s" %2$s>%3$s</a>',
menu_page_url( 'duplicatepost', false ),
/* translators: Hidden accessibility text. */
'aria-label="' . __( 'Settings for Duplicate Post', 'duplicate-post' ) . '"',
esc_html__( 'Settings', 'duplicate-post' )
),
Expand Down
8 changes: 6 additions & 2 deletions src/admin/views/options.php
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,12 @@
<form id="duplicate_post_settings_form" method="post" action="options.php" style="clear: both">
<?php \settings_fields( 'duplicate_post_group' ); ?>

<header role="tablist" aria-label="<?php \esc_attr_e( 'Settings sections', 'duplicate-post' ); ?>"
class="nav-tab-wrapper">
<header role="tablist" aria-label="
<?php
/* translators: Hidden accessibility text. */
\esc_attr_e( 'Settings sections', 'duplicate-post' );
?>
" class="nav-tab-wrapper">
<button
type="button"
role="tab"
Expand Down
6 changes: 3 additions & 3 deletions src/ui/row-actions.php
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ public function add_clone_action_link( $actions, $post ) {

$actions['clone'] = '<a href="' . $this->link_builder->build_clone_link( $post->ID )
. '" aria-label="' . \esc_attr(
/* translators: %s: Post title. */
/* translators: Hidden accessibility text; %s: Post title. */
\sprintf( \__( 'Clone &#8220;%s&#8221;', 'duplicate-post' ), $title )
) . '">'
. \esc_html_x( 'Clone', 'verb', 'duplicate-post' ) . '</a>';
Expand All @@ -108,7 +108,7 @@ public function add_new_draft_action_link( $actions, $post ) {

$actions['edit_as_new_draft'] = '<a href="' . $this->link_builder->build_new_draft_link( $post->ID )
. '" aria-label="' . \esc_attr(
/* translators: %s: Post title. */
/* translators: Hidden accessibility text; %s: Post title. */
\sprintf( \__( 'New draft of &#8220;%s&#8221;', 'duplicate-post' ), $title )
) . '">'
. \esc_html__( 'New Draft', 'duplicate-post' )
Expand Down Expand Up @@ -139,7 +139,7 @@ public function add_rewrite_and_republish_action_link( $actions, $post ) {

$actions['rewrite'] = '<a href="' . $this->link_builder->build_rewrite_and_republish_link( $post->ID )
. '" aria-label="' . \esc_attr(
/* translators: %s: Post title. */
/* translators: Hidden accessibility text; %s: Post title. */
\sprintf( \__( 'Rewrite & Republish &#8220;%s&#8221;', 'duplicate-post' ), $title )
) . '">'
. \esc_html_x( 'Rewrite & Republish', 'verb', 'duplicate-post' ) . '</a>';
Expand Down
6 changes: 3 additions & 3 deletions src/utils.php
Original file line number Diff line number Diff line change
Expand Up @@ -118,7 +118,7 @@ public static function get_edit_or_view_link( $post ) {
return \sprintf(
'<a href="%s" aria-label="%s">%s</a>',
\esc_url( \get_edit_post_link( $post->ID ) ),
/* translators: %s: post title */
/* translators: Hidden accessibility text; %s: post title */
\esc_attr( \sprintf( \__( 'Edit &#8220;%s&#8221;', 'duplicate-post' ), $title ) ),
$title
);
Expand All @@ -130,7 +130,7 @@ public static function get_edit_or_view_link( $post ) {
return \sprintf(
'<a href="%s" rel="bookmark" aria-label="%s">%s</a>',
\esc_url( $preview_link ),
/* translators: %s: post title */
/* translators: Hidden accessibility text; %s: post title */
\esc_attr( \sprintf( \__( 'Preview &#8220;%s&#8221;', 'duplicate-post' ), $title ) ),
$title
);
Expand All @@ -140,7 +140,7 @@ public static function get_edit_or_view_link( $post ) {
return \sprintf(
'<a href="%s" rel="bookmark" aria-label="%s">%s</a>',
\esc_url( \get_permalink( $post->ID ) ),
/* translators: %s: post title */
/* translators: Hidden accessibility text; %s: post title */
\esc_attr( \sprintf( \__( 'View &#8220;%s&#8221;', 'duplicate-post' ), $title ) ),
$title
);
Expand Down