Make WordPress Core

Opened 6 years ago

Closed 6 years ago

Last modified 3 years ago

#47655 closed defect (bug) (wontfix)

Consolidate broken up strings for better localization

Reported by: garrett-eclipse's profile garrett-eclipse Owned by:
Milestone: Priority: normal
Severity: normal Version:
Component: I18N Keywords:
Focuses: Cc:

Description

This ticket is branching from #47651 to address these comments;
@garrett-eclipse - https://core.trac.wordpress.org/ticket/47651#comment:7

"Also I moved the translator comment for the Learn more link into it's sprintf block. But I'm wondering if the two strings for this should be merged into one. Currently 'Learn more about updating PHP' is separate and appended so I wonder for i18N if that'll be an issue for RTL languages and should be one large sprintf string?"

@afragen - https://core.trac.wordpress.org/ticket/47651#comment:8

@garrett-eclipse there are probably 2-3 other locations in core where this same/similar tract is used, core-update page, plugin page, and possibly View Details iframe.
This would need to be changed in all locations but I would work towards a consensus on the new text first.

Example where the string is split in two;
https://github.com/WordPress/WordPress/blob/5.2-branch/wp-admin/update-core.php#L309-L322

<?php
                if ( ! $compatible_php && current_user_can( 'update_php' ) ) {
                        $compat .= '<br>' . __( 'This update doesn&#8217;t work with your version of PHP.' ) . '&nbsp;';
                        /* translators: %s: Update PHP page URL */
                        $compat .= sprintf(
                                __( '<a href="%s">Learn more about updating PHP</a>.' ),
                                esc_url( wp_get_update_php_url() )
                        );
                        $annotation = wp_get_update_php_annotation();
                        if ( $annotation ) {
                                $compat .= '</p><p><em>' . $annotation . '</em>';
                        }
                }

Change History (4)

#1 follow-up: @SergeyBiryukov
6 years ago

These strings are standalone sentences, keeping them separate seems fine to me.

RTL also should not be an issue here, text direction takes care of that.

__( '<a href="%s">Learn more about updating PHP</a>.' ) is used in a few other places in core, I don't see a strong reason to duplicate it as part of a larger string.

#2 in reply to: ↑ 1 @SergeyBiryukov
6 years ago

Replying to SergeyBiryukov:

__( '<a href="%s">Learn more about updating PHP</a>.' ) is used in a few other places in core, I don't see a strong reason to duplicate it as part of a larger string.

For some more context, reusable strings like this one were previously moved out of the larger strings to avoid duplicating translations, see #35746 or #38880 for example.

The change suggested in this ticket seems to go the opposite direction.

#3 @garrett-eclipse
6 years ago

  • Milestone Awaiting Review deleted
  • Resolution set to wontfix
  • Status changed from new to closed

Thanks @SergeyBiryukov I appreciate the input and feedback there. That's great news that RTL will handle the separation as you're right they are complete sentences in and of themselves. Due to this and the fact the Learn more string is reused elsewhere I'm going to close this out.

This ticket was mentioned in Slack in #polyglots by sergey. View the logs.


3 years ago

Note: See TracTickets for help on using tickets.