WordPress.org

Make WordPress Core

Opened 7 years ago

Closed 7 years ago

#27738 closed defect (bug) (fixed)

Customizer: Make header image strings ready for translation

Reported by: ocean90 Owned by: nacin
Milestone: 3.9 Priority: normal
Severity: normal Version: 3.9
Component: Themes Keywords: has-patch commit
Focuses: Cc:

Description (last modified by ocean90)

Related: #21785

trunk/src/wp-includes/class-wp-customize-control.php@27985#L855

<?php
// @todo translate (and look to custom-header.php for inspiration)
echo ( 'Personalize your site with your own header image.' ) . ' ';
if ( $width && $height ) {
	printf( ( 'While you can crop images to your liking after clicking <strong>Add new</strong>, your theme recommends a header size of <strong>%d &times; %d</strong> pixels.' ), $width, $height );
} elseif ( $width ) {
	printf( ( 'While you can crop images to your liking after clicking <strong>Add new</strong>, your theme recommends a header width of <strong>%d</strong> pixels.' ), $width );
} else {
	printf( ( 'While you can crop images to your liking after clicking <strong>Add new</strong>, your theme recommends a header height of <strong>%d</strong> pixels.' ), $height );
}
?>

Text in custom-header.php: trunk/src/wp-admin/custom-header.php@27985#L511

Attachments (1)

27738.patch (1.1 KB) - added by ocean90 7 years ago.

Download all attachments as: .zip

Change History (13)

#1 @ocean90
7 years ago

  • Description modified (diff)

#3 @nacin
7 years ago

I would like to drop "Personalize your site with your own header image." No other customizer section has such an introduction and it feels out of place. The other strings are fine.

#4 @nacin
7 years ago

  • Owner set to nacin
  • Resolution set to fixed
  • Status changed from new to closed

In 28082:

Translate custom header customize control strings. Remove final added before beta to see what breakage we might cause by refactoring this class.

see #21785. fixes #27738.

#5 in reply to: ↑ 2 @SergeyBiryukov
7 years ago

  • Resolution fixed deleted
  • Status changed from closed to reopened

#6 @nacin
7 years ago

I'm still mulling over the string. :) Commit incoming.

#7 @nacin
7 years ago

I came up with this simple version:

  • There was a problem trying to load themes. Can&#8217;t communicate with WordPress.org.

Optionally could tack "Please try again." onto the end of that.

It's based on "'An unexpected error occurred. Something may be wrong with WordPress.org or this server&#8217;s configuration. If you continue to have problems, please try the <a href="https://wordpress.org/support/">support forums</a>."

I'm fine with using more of this string... But we can't really mention server configuration, as this is all JS. Instead,

  • An unexpected error occurred. Something may be wrong with WordPress.org. If you continue to have problems, please try the <a href="https://wordpress.org/support/">support forums</a>.

Doesn't really matter to me.

#8 follow-up: @nacin
7 years ago

  • Component changed from Appearance to Themes

Larger issue: I can't get that error to display. The JSONP request just hangs forever when my internet is disconnected. Perhaps we need to add a timeout of say 30000ms or something?

#9 in reply to: ↑ 8 ; follow-up: @ocean90
7 years ago

Replying to nacin:

Larger issue: I can't get that error to display. The JSONP request just hangs forever when my internet is disconnected. Perhaps we need to add a timeout of say 30000ms or something?

That's JSONP, there is no real error handling. We can set the timeout setting, but there are some issues with Firefox.

In Firefox 3.0+ only, script and JSONP requests cannot be cancelled by a timeout; the script will run even if it arrives after the timeout period.

https://api.jquery.com/jQuery.ajax/#jQuery-ajax-settings (Bug ticket)

But at least you will get the error message with the timeout setting.

#10 in reply to: ↑ 9 @matveb
7 years ago

Replying to ocean90:

But at least you will get the error message with the timeout setting.

Yes, let's add one. What should be the amount? 30 seconds seems a bit long.

@ocean90
7 years ago

#11 @ocean90
7 years ago

  • Keywords has-patch commit added; needs-patch removed

27738.patch uses the string from comment:7 and sets timeout to 15 seconds.

#12 @nacin
7 years ago

  • Resolution set to fixed
  • Status changed from reopened to closed
Note: See TracTickets for help on using tickets.