Make WordPress Core

Changeset 39325


Ignore:
Timestamp:
11/21/2016 01:51:39 AM (9 years ago)
Author:
SergeyBiryukov
Message:

I18N: Move the support forums URL in update-related HTTP API error messages to a separate translatable string that is already used elsewhere.

Props ramiy, SergeyBiryukov.
Fixes #38880.

Location:
trunk/src
Files:
6 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/wp-admin/includes/plugin-install.php

    r38953 r39325  
    156156
    157157        if ( $ssl && is_wp_error( $request ) ) {
    158             trigger_error( __( '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>.' ) . ' ' . __( '(WordPress could not establish a secure connection to WordPress.org. Please contact your server administrator.)' ), headers_sent() || WP_DEBUG ? E_USER_WARNING : E_USER_NOTICE );
     158            trigger_error(
     159                sprintf(
     160                    /* translators: %s: support forums URL */
     161                    __( '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="%s">support forums</a>.' ),
     162                    __( 'https://wordpress.org/support/' )
     163                ) . ' ' . __( '(WordPress could not establish a secure connection to WordPress.org. Please contact your server administrator.)' ),
     164                headers_sent() || WP_DEBUG ? E_USER_WARNING : E_USER_NOTICE
     165            );
    159166            $request = wp_remote_post( $http_url, $http_args );
    160167        }
    161168
    162169        if ( is_wp_error($request) ) {
    163             $res = new WP_Error('plugins_api_failed', __( '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>.' ), $request->get_error_message() );
     170            $res = new WP_Error( 'plugins_api_failed',
     171                sprintf(
     172                    /* translators: %s: support forums URL */
     173                    __( '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="%s">support forums</a>.' ),
     174                    __( 'https://wordpress.org/support/' )
     175                ),
     176                $request->get_error_message()
     177            );
    164178        } else {
    165179            $res = maybe_unserialize( wp_remote_retrieve_body( $request ) );
    166             if ( ! is_object( $res ) && ! is_array( $res ) )
    167                 $res = new WP_Error('plugins_api_failed', __( '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>.' ), wp_remote_retrieve_body( $request ) );
     180            if ( ! is_object( $res ) && ! is_array( $res ) ) {
     181                $res = new WP_Error( 'plugins_api_failed',
     182                    sprintf(
     183                        /* translators: %s: support forums URL */
     184                        __( '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="%s">support forums</a>.' ),
     185                        __( 'https://wordpress.org/support/' )
     186                    ),
     187                    wp_remote_retrieve_body( $request )
     188                );
     189            }
    168190        }
    169191    } elseif ( !is_wp_error($res) ) {
  • trunk/src/wp-admin/includes/theme.php

    r39140 r39325  
    463463        if ( $ssl && is_wp_error( $request ) ) {
    464464            if ( ! wp_doing_ajax() ) {
    465                 trigger_error( __( '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>.' ) . ' ' . __( '(WordPress could not establish a secure connection to WordPress.org. Please contact your server administrator.)' ), headers_sent() || WP_DEBUG ? E_USER_WARNING : E_USER_NOTICE );
     465                trigger_error(
     466                    sprintf(
     467                        /* translators: %s: support forums URL */
     468                        __( '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="%s">support forums</a>.' ),
     469                        __( 'https://wordpress.org/support/' )
     470                    ) . ' ' . __( '(WordPress could not establish a secure connection to WordPress.org. Please contact your server administrator.)' ),
     471                    headers_sent() || WP_DEBUG ? E_USER_WARNING : E_USER_NOTICE
     472                );
    466473            }
    467474            $request = wp_remote_post( $http_url, $http_args );
     
    469476
    470477        if ( is_wp_error($request) ) {
    471             $res = new WP_Error('themes_api_failed', __( '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>.' ), $request->get_error_message() );
     478            $res = new WP_Error( 'themes_api_failed',
     479                sprintf(
     480                    /* translators: %s: support forums URL */
     481                    __( '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="%s">support forums</a>.' ),
     482                    __( 'https://wordpress.org/support/' )
     483                ),
     484                $request->get_error_message()
     485            );
    472486        } else {
    473487            $res = maybe_unserialize( wp_remote_retrieve_body( $request ) );
    474             if ( ! is_object( $res ) && ! is_array( $res ) )
    475                 $res = new WP_Error('themes_api_failed', __( '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>.' ), wp_remote_retrieve_body( $request ) );
     488            if ( ! is_object( $res ) && ! is_array( $res ) ) {
     489                $res = new WP_Error( 'themes_api_failed',
     490                    sprintf(
     491                        /* translators: %s: support forums URL */
     492                        __( '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="%s">support forums</a>.' ),
     493                        __( 'https://wordpress.org/support/' )
     494                    ),
     495                    wp_remote_retrieve_body( $request )
     496                );
     497            }
    476498        }
    477499    }
  • trunk/src/wp-admin/includes/translation-install.php

    r38470 r39325  
    5757
    5858        if ( $ssl && is_wp_error( $request ) ) {
    59             trigger_error( __( '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>.' ) . ' ' . __( '(WordPress could not establish a secure connection to WordPress.org. Please contact your server administrator.)' ), headers_sent() || WP_DEBUG ? E_USER_WARNING : E_USER_NOTICE );
     59            trigger_error(
     60                sprintf(
     61                    /* translators: %s: support forums URL */
     62                    __( '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="%s">support forums</a>.' ),
     63                    __( 'https://wordpress.org/support/' )
     64                ) . ' ' . __( '(WordPress could not establish a secure connection to WordPress.org. Please contact your server administrator.)' ),
     65                headers_sent() || WP_DEBUG ? E_USER_WARNING : E_USER_NOTICE
     66            );
    6067
    6168            $request = wp_remote_post( $http_url, $options );
     
    6370
    6471        if ( is_wp_error( $request ) ) {
    65             $res = new WP_Error( 'translations_api_failed', __( '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>.' ), $request->get_error_message() );
     72            $res = new WP_Error( 'translations_api_failed',
     73                sprintf(
     74                    /* translators: %s: support forums URL */
     75                    __( '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="%s">support forums</a>.' ),
     76                    __( 'https://wordpress.org/support/' )
     77                ),
     78                $request->get_error_message()
     79            );
    6680        } else {
    6781            $res = json_decode( wp_remote_retrieve_body( $request ), true );
    6882            if ( ! is_object( $res ) && ! is_array( $res ) ) {
    69                 $res = new WP_Error( 'translations_api_failed', __( '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>.' ), wp_remote_retrieve_body( $request ) );
     83                $res = new WP_Error( 'translations_api_failed',
     84                    sprintf(
     85                        /* translators: %s: support forums URL */
     86                        __( '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="%s">support forums</a>.' ),
     87                        __( 'https://wordpress.org/support/' )
     88                    ),
     89                    wp_remote_retrieve_body( $request )
     90                );
    7091            }
    7192        }
  • trunk/src/wp-admin/includes/update.php

    r39323 r39325  
    113113    $response = wp_remote_get( $url, $options );
    114114    if ( $ssl && is_wp_error( $response ) ) {
    115         trigger_error( __( '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>.' ) . ' ' . __( '(WordPress could not establish a secure connection to WordPress.org. Please contact your server administrator.)' ), headers_sent() || WP_DEBUG ? E_USER_WARNING : E_USER_NOTICE );
     115        trigger_error(
     116            sprintf(
     117                /* translators: %s: support forums URL */
     118                __( '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="%s">support forums</a>.' ),
     119                __( 'https://wordpress.org/support/' )
     120            ) . ' ' . __( '(WordPress could not establish a secure connection to WordPress.org. Please contact your server administrator.)' ),
     121            headers_sent() || WP_DEBUG ? E_USER_WARNING : E_USER_NOTICE
     122        );
    116123        $response = wp_remote_get( $http_url, $options );
    117124    }
  • trunk/src/wp-admin/theme-install.php

    r38722 r39325  
    4949        'upload'              => __( 'Upload Theme' ),
    5050        'back'                => __( 'Back' ),
    51         'error'               => __( '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>.' ),
     51        'error'               => sprintf(
     52            /* translators: %s: support forums URL */
     53            __( '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="%s">support forums</a>.' ),
     54            __( 'https://wordpress.org/support/' )
     55        ),
    5256        'themesFound'         => __( 'Number of Themes found: %d' ),
    5357        'noThemesFound'       => __( 'No themes found. Try a different search.' ),
  • trunk/src/wp-includes/update.php

    r38470 r39325  
    121121    $response = wp_remote_post( $url, $options );
    122122    if ( $ssl && is_wp_error( $response ) ) {
    123         trigger_error( __( '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>.' ) . ' ' . __( '(WordPress could not establish a secure connection to WordPress.org. Please contact your server administrator.)' ), headers_sent() || WP_DEBUG ? E_USER_WARNING : E_USER_NOTICE );
     123        trigger_error(
     124            sprintf(
     125                /* translators: %s: support forums URL */
     126                __( '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="%s">support forums</a>.' ),
     127                __( 'https://wordpress.org/support/' )
     128            ) . ' ' . __( '(WordPress could not establish a secure connection to WordPress.org. Please contact your server administrator.)' ),
     129            headers_sent() || WP_DEBUG ? E_USER_WARNING : E_USER_NOTICE
     130        );
    124131        $response = wp_remote_post( $http_url, $options );
    125132    }
     
    304311    $raw_response = wp_remote_post( $url, $options );
    305312    if ( $ssl && is_wp_error( $raw_response ) ) {
    306         trigger_error( __( '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>.' ) . ' ' . __( '(WordPress could not establish a secure connection to WordPress.org. Please contact your server administrator.)' ), headers_sent() || WP_DEBUG ? E_USER_WARNING : E_USER_NOTICE );
     313        trigger_error(
     314            sprintf(
     315                /* translators: %s: support forums URL */
     316                __( '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="%s">support forums</a>.' ),
     317                __( 'https://wordpress.org/support/' )
     318            ) . ' ' . __( '(WordPress could not establish a secure connection to WordPress.org. Please contact your server administrator.)' ),
     319            headers_sent() || WP_DEBUG ? E_USER_WARNING : E_USER_NOTICE
     320        );
    307321        $raw_response = wp_remote_post( $http_url, $options );
    308322    }
     
    477491    $raw_response = wp_remote_post( $url, $options );
    478492    if ( $ssl && is_wp_error( $raw_response ) ) {
    479         trigger_error( __( '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>.' ) . ' ' . __( '(WordPress could not establish a secure connection to WordPress.org. Please contact your server administrator.)' ), headers_sent() || WP_DEBUG ? E_USER_WARNING : E_USER_NOTICE );
     493        trigger_error(
     494            sprintf(
     495                /* translators: %s: support forums URL */
     496                __( '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="%s">support forums</a>.' ),
     497                __( 'https://wordpress.org/support/' )
     498            ) . ' ' . __( '(WordPress could not establish a secure connection to WordPress.org. Please contact your server administrator.)' ),
     499            headers_sent() || WP_DEBUG ? E_USER_WARNING : E_USER_NOTICE
     500        );
    480501        $raw_response = wp_remote_post( $http_url, $options );
    481502    }
Note: See TracChangeset for help on using the changeset viewer.