Skip to content

Commit

Permalink
Block Library: Remove Gutenberg i18n domain from block-library package (
Browse files Browse the repository at this point in the history
#64701).

As these files are distributed to WordPress in an unaltered form, the domain needs to be removed to allow it to be added to the WordPress translations.

Co-authored-by: peterwilsoncc <[email protected]>
Co-authored-by: ramonjd <[email protected]>
  • Loading branch information
3 people authored Aug 22, 2024
1 parent 54eee32 commit 66b8b61
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 6 deletions.
2 changes: 1 addition & 1 deletion packages/block-library/src/comment-date/index.php
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ function render_block_core_comment_date( $attributes, $content, $block ) {
$wrapper_attributes = get_block_wrapper_attributes( array( 'class' => $classes ) );
if ( isset( $attributes['format'] ) && 'human-diff' === $attributes['format'] ) {
// translators: %s: human-readable time difference.
$formatted_date = sprintf( __( '%s ago', 'gutenberg' ), human_time_diff( get_comment_date( 'U', $comment ) ) );
$formatted_date = sprintf( __( '%s ago' ), human_time_diff( get_comment_date( 'U', $comment ) ) );
} else {
$formatted_date = get_comment_date( empty( $attributes['format'] ) ? '' : $attributes['format'], $comment );
}
Expand Down
4 changes: 2 additions & 2 deletions packages/block-library/src/form/index.php
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@ function block_core_form_send_email() {
// Start building the email content.
$content = sprintf(
/* translators: %s: The request URI. */
__( 'Form submission from %1$s', 'gutenberg' ) . '</br>',
__( 'Form submission from %1$s' ) . '</br>',
'<a href="' . esc_url( get_site_url( null, $params['_wp_http_referer'] ) ) . '">' . get_bloginfo( 'name' ) . '</a>'
);

Expand All @@ -110,7 +110,7 @@ function block_core_form_send_email() {
// Send the email.
$result = wp_mail(
str_replace( 'mailto:', '', $params['formAction'] ),
__( 'Form submission', 'gutenberg' ),
__( 'Form submission' ),
$content
);

Expand Down
6 changes: 3 additions & 3 deletions packages/block-library/src/post-date/index.php
Original file line number Diff line number Diff line change
Expand Up @@ -26,10 +26,10 @@ function render_block_core_post_date( $attributes, $content, $block ) {
$post_timestamp = get_post_timestamp( $post_ID );
if ( $post_timestamp > time() ) {
// translators: %s: human-readable time difference.
$formatted_date = sprintf( __( '%s from now', 'gutenberg' ), human_time_diff( $post_timestamp ) );
$formatted_date = sprintf( __( '%s from now' ), human_time_diff( $post_timestamp ) );
} else {
// translators: %s: human-readable time difference.
$formatted_date = sprintf( __( '%s ago', 'gutenberg' ), human_time_diff( $post_timestamp ) );
$formatted_date = sprintf( __( '%s ago' ), human_time_diff( $post_timestamp ) );
}
} else {
$formatted_date = get_the_date( empty( $attributes['format'] ) ? '' : $attributes['format'], $post_ID );
Expand All @@ -52,7 +52,7 @@ function render_block_core_post_date( $attributes, $content, $block ) {
if ( get_the_modified_date( 'Ymdhi', $post_ID ) > get_the_date( 'Ymdhi', $post_ID ) ) {
if ( isset( $attributes['format'] ) && 'human-diff' === $attributes['format'] ) {
// translators: %s: human-readable time difference.
$formatted_date = sprintf( __( '%s ago', 'gutenberg' ), human_time_diff( get_post_timestamp( $post_ID, 'modified' ) ) );
$formatted_date = sprintf( __( '%s ago' ), human_time_diff( get_post_timestamp( $post_ID, 'modified' ) ) );
} else {
$formatted_date = get_the_modified_date( empty( $attributes['format'] ) ? '' : $attributes['format'], $post_ID );
}
Expand Down

0 comments on commit 66b8b61

Please sign in to comment.