WordPress.org

Make WordPress Core

Opened 5 months ago

Closed 2 months ago

#51961 closed defect (bug) (maybelater)

Twenty Twenty-One: full stop might be in wrong place

Reported by: wangql Owned by:
Milestone: Priority: normal
Severity: normal Version: 5.6
Component: Bundled Theme Keywords: has-patch close
Focuses: ui-copy Cc:

Description

In classes/class-twenty-twenty-one-dark-mode.php:188:

__( 'Dark Mode is a device setting. If a visitor to your site requests it, your site will be shown with a dark background and light text. <a href="%s">Learn more about Dark Mode.</a>', 'twentytwentyone' ),

The full-stop should be put outside the </a> mark-up.

__( 'Dark Mode is a device setting. If a visitor to your site requests it, your site will be shown with a dark background and light text. <a href="%s">Learn more about Dark Mode</a>.', 'twentytwentyone' ),

Attachments (1)

51961.diff (1.1 KB) - added by audrasjb 4 months ago.
i18n change after @sabernhardt’s comment

Download all attachments as: .zip

Change History (19)

#1 @desrosj
5 months ago

  • Milestone changed from Awaiting Review to 5.6.1

This ticket was mentioned in PR #796 on WordPress/wordpress-develop by qtxh.


4 months ago

  • Keywords has-patch added

In classes/class-twenty-twenty-one-dark-mode.php:188:
( 'Dark Mode is a device setting. If a visitor to your site requests it, your site will be shown with a dark background and light text. <a href="%s">Learn more about Dark Mode.</a>', 'twentytwentyone' ),

The full-stop should be put outside the </a> mark-up.
( 'Dark Mode is a device setting. If a visitor to your site requests it, your site will be shown with a dark

Trac ticket: https://core.trac.wordpress.org/ticket/51961

#3 @prbot
4 months ago

github-actions[bot] commented on PR #796:

Hi @qtxh! 👋

Thank you for your contribution to WordPress! 💖

It looks like this is your first pull request to wordpress-develop. Here are a few things to be aware of that may help you out!

No one monitors this repository for new pull requests. Pull requests must be attached to a Trac ticket to be considered for inclusion in WordPress Core. To attach a pull request to a Trac ticket, please include the ticket's full URL in your pull request description.

Pull requests are never merged on GitHub. The WordPress codebase continues to be managed through the SVN repository that this GitHub repository mirrors. Please feel free to open pull requests to work on any contribution you are making.

More information about how GitHub pull requests can be used to contribute to WordPress can be found in this blog post.

Please include automated tests. Including tests in your pull request is one way to help your patch be considered faster. To learn about WordPress' test suites, visit the Automated Testing page in the handbook.

If you have not had a chance, please review the Contribute with Code page in the WordPress Core Handbook.

The Developer Hub also documents the various coding standards that are followed:

Thank you,
The WordPress Project

#4 follow-up: @poena
4 months ago

Hi!
Can you give a motivation to why the full stop should be outside?

The link text is the complete sentence, and not only part of a sentence:

<a href="%s">Learn more about Dark Mode.</a>

compared to:

Learn more about <a href="%s">Dark Mode</a>.

#5 in reply to: ↑ 4 @wangql
4 months ago

  • Summary changed from Twenty Twenty-One: full stop in wrong place to Twenty Twenty-One: full stop might be in wrong place

Replying to poena:

Hi!
Can you give a motivation to why the full stop should be outside?

The link text is the complete sentence, and not only part of a sentence:

<a href="%s">Learn more about Dark Mode.</a>

compared to:

Learn more about <a href="%s">Dark Mode</a>.

Hi. I thought the phrase "Learn something" itself refers to an action taken by admin, not a complete sentence. So the full stop might be put after </a> or be removed.

#6 @mukesh27
4 months ago

Hi there!

I have found a similar issue on the About page and reported - #51965

Last edited 4 months ago by SergeyBiryukov (previous) (diff)

#7 follow-up: @SergeyBiryukov
4 months ago

  • Focuses ui-copy added

Hi there, welcome back to WordPress Trac! Thanks for the report.

Crossposting my comment from #51965.

As noted above, "Learn more about Dark Mode." is a complete sentence, so I think the full stop is in the correct place here.

This is consistent with some other strings in core, for example:

  • "Check again" link on WordPress Updates screen:
    <a href="' ... '">' . __( 'Check again.' ) . '</a>'
    
  • "Search for plugins" link on the Plugins screen:
    <a href=" ... '">' . __( 'Search for plugins in the WordPress Plugin Directory.' ) . '</a>'
    

A similar conversation was also on Slack after 5.6 beta 4:

yui 04:21
<a href="%s">Switch to automatic updates for maintenance and security releases only.</a>
is it really meant to have dot before </a>?
helen 04:25
It’s the entire line, so yes.

That said, this appears to be not a hard and fast rule, there are some other arguments and considerations:
https://ux.stackexchange.com/questions/17331/should-a-full-sentence-html-link-include-the-period-in-the-linked-text

Ideally, if any changes should be made, we'd like to be consistent with this in core.

Marking this with the ui-copy focus for a native English speaker to chime in :)

Version 1, edited 4 months ago by SergeyBiryukov (previous) (next) (diff)

#8 in reply to: ↑ 7 @markscottrobson
4 months ago

Replying to SergeyBiryukov:

Hi there, welcome back to WordPress Trac! Thanks for the report.

Crossposting my comment from #51965.

As noted above, "Learn more about Dark Mode." is a complete sentence, so I think the full stop is in the correct place here.

This is consistent with some other strings in core, for example:

  • "Check again" link on WordPress Updates screen:
    <a href="' ... '">' . __( 'Check again.' ) . '</a>'
    
  • "Search for plugins" link on the Plugins screen:
    <a href=" ... '">' . __( 'Search for plugins in the WordPress Plugin Directory.' ) . '</a>'
    

A similar conversation was also on Slack after 5.6 beta 4:

yui 04:21
<a href="%s">Switch to automatic updates for maintenance and security releases only.</a>
is it really meant to have dot before </a>?
helen 04:25
It’s the entire line, so yes.

That said, this appears to be not a hard and fast rule, there are some other arguments and considerations:
https://ux.stackexchange.com/questions/17331/should-a-full-sentence-html-link-include-the-period-in-the-linked-text

Ideally, if any changes should be made, we'd like to be consistent with this in core and bundled themes.

Marking this with the ui-copy focus for a native English speaker to chime in :)

As a native UK English speaker, I would suggest that the text should be hyperlinked and not the punctuation. Most style guides would support this. Also, an underlined hyperlink looks strange if the full stop is underlined as well.

Last edited 4 months ago by markscottrobson (previous) (diff)

#9 @sabernhardt
4 months ago

Ultimately, I don't think either way is wrong, yet neither of them will look correct to everybody. Preferences likely reflect how a period is inside quotation marks here in the U.S. and the full stop is often outside the quotes in other countries.

We could continue to follow the rules given for parenthetical comments (text in round brackets), applying those rules to links. British and American style guides agree on adding the terminal punctuation inside with full sentences:

Consider these:

  1. All full sentences should remain completely intact inside links. (This includes any terminal punctuation.)
  2. Moving the punctuation outside links is acceptable (as long as the WordPress style guide is updated to prefer it).

Of course, if the WordPress style guide discourages adding any full-sentence links instead, that could settle this more simply.

Last edited 4 months ago by sabernhardt (previous) (diff)

#10 @sabernhardt
4 months ago

After the linked article is published, a better option may become more apparent, but here's a rough idea for an edited sentence:

Learn more about <a href="%s">how to work with Dark Mode in this theme</a>.

#11 @johnbillion
4 months ago

  • Version set to 5.6

@audrasjb
4 months ago

i18n change after @sabernhardt’s comment

#12 @audrasjb
4 months ago

I think @sabernhardt’s proposal is the best option here. See 51961.diff.

#13 @desrosj
4 months ago

As noted above by @SergeyBiryukov, when this change is made, it should be done throughout core for consistency.

For that reason, I am electing not to include this change in the Twenty Twenty-One bug fix update being shipped later today.

I do have one question that does not seem to have been discussed yet. Are there any a11y considerations for including the . within <a> tags?

#14 @audrasjb
4 months ago

Good point @desrosj. AFAIK, it's indeed better to exclude it from the link as links may be fetched independentely by accessibility tools and keyboard navigation. That's not a huge deal BTW :)

This ticket was mentioned in Slack in #core-themes by poena. View the logs.


3 months ago

#16 @audrasjb
3 months ago

  • Milestone changed from 5.6.1 to 5.7

As this ticket is not an urgent change, we agreed with @poena to move it to next major release.

#17 @SergeyBiryukov
3 months ago

  • Keywords close added

Thanks for the patch!

It looks like there is no consensus yet that this string needs any changes, so I'm marking this for closure, unless anyone has strong feelings either way :)

#18 @peterwilsoncc
2 months ago

  • Milestone 5.7 deleted
  • Resolution set to maybelater
  • Status changed from new to closed

I agree with Sergey, without consensus this can be closed off.

As mentioned above, consistency is best so a more general ticket and larger patch to achieve that would be more ideal. As it would involve several string changes it's probably best done prior to a beta release to allow the polyglots to update translations as needed.

Note: See TracTickets for help on using tickets.