Make WordPress Core

Opened 3 years ago

Closed 3 years ago

#53535 closed defect (bug) (fixed)

Site health/i18n: add a separator between tab names and "Site health"

Reported by: audrasjb's profile audrasjb Owned by: clorith's profile Clorith
Milestone: 5.8 Priority: normal
Severity: normal Version: 5.8
Component: Site Health Keywords: needs-patch i18n-change
Focuses: Cc:

Description

The current implementation of Site Health tab names is missing a separator between "Site Health" and the name of the tab.

$title = sprintf(
       // translators: %s: The currently displayed tab.
       __( 'Site Health %s' ),
       ( isset( $_GET['tab'] ) ? esc_html( $tabs[ $_GET['tab'] ] ) : esc_html( reset( $tabs ) ) )
);

With the default tabs, it displays "Site Health Info" and "Site Health Status", but with the introduction of custom tabs, I think we should add a separator between "Site Health" and the name of the tab.

I'd propose to rather use "–" or ":", so it will work on any custom tab name provided by developers.

Attachments (1)

53535.diff (450 bytes) - added by audrasjb 3 years ago.

Download all attachments as: .zip

Change History (7)

@audrasjb
3 years ago

#1 @swissspidy
3 years ago

Unrelated, but shouldn't the isset() check there really be isset( $_GET['tab'], $tabs[ $_GET['tab'] )? Otherwise there would be "Undefined array key" notices/warnings when using something like ?tab=thisdoesnotexist.

Related to that, the "Status" tab is not marked as active (blue border below the tab) when just visiting the site-health.php site. Clicking on "Status" links to site-health.php?tab, making it active.

Tested using 5.8-beta4-51247

#2 @SergeyBiryukov
3 years ago

  • Milestone changed from Awaiting Review to 5.8

#3 @desrosj
3 years ago

  • Keywords needs-testing added

#4 @Clorith
3 years ago

  • Keywords needs-testing removed
  • Owner set to Clorith
  • Status changed from new to assigned

Good catch @swissspidy, and yes there's a missing active link indicator there as you mentioned. Besides than that I think @audrasjb has the right idea with the label, let's get both tackled before RC-1.

This ticket was mentioned in Slack in #core by jeffpaul. View the logs.


3 years ago

#6 @Clorith
3 years ago

  • Resolution set to fixed
  • Status changed from assigned to closed

In 51252:

Site Health: Improve readability of site titles.

This splits up the site title for the Site Health tabs to make it more obvious what page a user is viewing, and which tab under that page. It also removes a possible source of warnings if a user tries accessing a tab that does not exist.

The introduction of this check for existing tabs also improves the accuracy of the active-tab indicator, ensuring the indicator shows up for the default tab, when no other tab has been selected.

Follow-up to [50764].

Props audrasjb, swissspidy.
Fixes #53535.

Note: See TracTickets for help on using tickets.