Make WordPress Core

Opened 3 months ago

Closed 3 months ago

Last modified 8 weeks ago

#60641 closed defect (bug) (fixed)

Update alt text for site icon preview in customizer

Reported by: jorbin's profile jorbin Owned by: jorbin's profile jorbin
Milestone: 6.5 Priority: normal
Severity: normal Version:
Component: Customize Keywords: has-patch
Focuses: accessibility Cc:


The alt text was improved for the site icon preview as a part of [57713]. These changes should be reflected in the customizer as well.

Change History (7)

This ticket was mentioned in PR #6186 on WordPress/wordpress-develop by @jorbin.

3 months ago

  • Keywords has-patch added

Updates both alt text and the description string to match the general settings page.

Trac ticket:

@jorbin commented on PR #6186:

3 months ago

@westonruter (because customizer) @swissspidy (because internationalization) I'm wondering if either of you has thoughts on this, specifically the use of the wp.i18n functions inside of the templates. As these are not actually JS files, I am unsure if this will actually work as expected. I couldn't find any other uses of these functions in src/wp-includes/customize which is why I'm second-guessing my approach.

@swissspidy commented on PR #6186:

3 months ago

Yeah unfortunately I don‘t think that works, because the JS string extraction only works on JavaScript files, not JS templates inside a PHP file. That meand it couldn‘t be actually translated.

So either keep the existing approach or, if we want to use the JS i18n functions, use them in a JS file and inject into the template as just another variable. For the latter it could be a BC brack if plugins use these templates as well.

Hope that makes sense

@jorbin commented on PR #6186:

3 months ago

I like this approach. If it is also problematic, I think my next method to explore would be putting it in src/js/_enqueues/wp/customize/controls.js

@swissspidy commented on PR #6186:

3 months ago

That should work 👍

This ticket was mentioned in Slack in #accessibility by joedolson. View the logs.

3 months ago

#7 @jorbin
3 months ago

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

In 57730:

Site Icon/Customizer: Update strings in customizer to align with options-general.php.

This uses the new strings for alt text and site icon description that were introduced in [57713] as a part of #54370.

The strings are translated in PHP and then use wp.i18n.sprintf since the alt text strings live in a PHP file even though they are output as part of a template that is used in JavaScript.

Props westonruter, swissspidy, jorbin.
Fixes #60641.

Note: See TracTickets for help on using tickets.