You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
[not verified] Sync Health Tests: make messages easier to translate (#15396)
* Sync Health Tests: make messages easier to translate
Fixes#15379
I've also taken the opportunity to make the message with a number translatable differently depending on the number.
* Add missing period
Co-Authored-By: Kim Brown <[email protected]>
Co-authored-by: Kim Brown <[email protected]>
$description .= esc_html__( 'The information synced by Jetpack ensures that Jetpack Search, Related Posts and other features are aligned with your site’s current content.', 'jetpack' );
__( 'Jetpack has detected an error while syncing your site. <strong>We recommend <a id="full_sync_request_link" href="#">a full sync</a> to align Jetpack with your site data.</strong>', 'jetpack' ),
565
+
array(
566
+
'a' => array(
567
+
'id' => array(),
568
+
'href' => array(),
569
+
),
570
+
'strong' => array(),
571
+
)
572
+
);
573
+
$description .= '</p>';
553
574
554
575
returnself::failing_test(
555
576
array(
@@ -559,27 +580,42 @@ protected function test__sync_health() {
__( 'The information synced by Jetpack ensures that Jetpack Search, Related Posts and other features are aligned with your site’s current content.', 'jetpack' ),
565
-
__( 'Error', 'jetpack' ),
566
-
__( 'Jetpack has detected an error while syncing your site', 'jetpack' ), /* translators: screen reader text indicating a test failed */
567
-
__( 'We recommend', 'jetpack' ),
568
-
__( 'full sync', 'jetpack' ),
569
-
__( 'to align Jetpack with your site data.', 'jetpack' )
570
-
),
583
+
'long_description' => $description,
571
584
)
572
585
);
573
586
574
587
} else {
575
-
576
588
// Get the Sync Queue.
577
589
$sender = Sync_Sender::get_instance();
578
590
$sync_queue = $sender->get_sync_queue();
579
591
580
592
// lag exceeds 5 minutes.
581
593
if ( $sync_queue->lag() > 5 * MINUTE_IN_SECONDS ) {
582
594
595
+
$description = '<p>';
596
+
$description .= esc_html__( 'The information synced by Jetpack ensures that Jetpack Search, Related Posts and other features are aligned with your site’s current content.', 'jetpack' );
/* translators: name, used to describe a clock icon. */
602
+
esc_html__( 'Clock', 'jetpack' )
603
+
);
604
+
$description .= wp_kses(
605
+
sprintf(
606
+
/* translators: placeholder is a number of minutes. */
607
+
_n(
608
+
'Jetpack has identified a delay while syncing individual content updates. Certain features might be slower than usual, but this is only temporary while sync catches up with recent changes to your site. <strong>We’re seeing a current delay of %1$d minute.</strong>',
609
+
'Jetpack has identified a delay while syncing individual content updates. Certain features might be slower than usual, but this is only temporary while sync catches up with recent changes to your site. <strong>We’re seeing a current delay of %1$d minutes.</strong>',
__( 'The information synced by Jetpack ensures that Jetpack Search, Related Posts and other features are aligned with your site’s current content.', 'jetpack' ),
594
-
__( 'Clock', 'jetpack' ),
595
-
__( 'Jetpack has identified a delay while syncing individual content updates. Certain features might be slower than usual, but this is only temporary while sync catches up with recent changes to your site.', 'jetpack' ), /* translators: screen reader text indicating a test failed */
596
-
__( 'We’re seeing a current delay of', 'jetpack' ),
597
-
intval( $sync_queue->lag() / MINUTE_IN_SECONDS ),
598
-
__( 'minutes.', 'jetpack' )
599
-
),
627
+
'long_description' => $description,
600
628
)
601
629
);
602
630
@@ -608,8 +636,27 @@ protected function test__sync_health() {
608
636
}
609
637
}
610
638
} else {
639
+
/*
640
+
* Sync is disabled.
641
+
*/
642
+
643
+
$description = '<p>';
644
+
$description .= esc_html__( 'The information synced by Jetpack ensures that Jetpack Search, Related Posts and other features are aligned with your site’s current content.', 'jetpack' );
645
+
$description .= '</p>';
646
+
$description .= '<p>';
647
+
$description .= __( 'Developers may enable / disable syncing using the Sync Settings API.', 'jetpack' );
__( 'Jetpack Sync has been disabled on your site. Without it, certain Jetpack features will not work. <strong>We recommend enabling Sync.</strong>', 'jetpack' ),
656
+
array( 'strong' => array() )
657
+
);
658
+
$description .= '</p>';
611
659
612
-
// Sync is disabled.
613
660
returnself::failing_test(
614
661
array(
615
662
'name' => $name,
@@ -618,17 +665,7 @@ protected function test__sync_health() {
__( 'The information synced by Jetpack ensures that Jetpack Search, Related Posts and other features are aligned with your site’s current content.', 'jetpack' ),
624
-
__( 'Developers may enable / disable syncing using the Sync Settings API.', 'jetpack' ), /* translators: screen reader text indicating a test failed */
625
-
__( 'The information synced by Jetpack ensures that Jetpack Search, Related Posts and other features are aligned with your site’s current content.', 'jetpack' ),
626
-
__( 'Developers may enable / disable syncing using the Sync Settings API.', 'jetpack' ),
627
-
/* translators: screen reader text indicating a test failed */
628
-
__( 'Error', 'jetpack' ),
629
-
__( 'Jetpack Sync has been disabled on your site. Without it, certain Jetpack features will not work.', 'jetpack' ),
0 commit comments