WordPress.org

Make WordPress Core

Ticket #43985: 43985.6.diff

File 43985.6.diff, 3.1 KB (added by desrosj, 17 months ago)

Changes $switch_locales to singular for consistency.

  • src/wp-includes/user.php

     
    30513051        $content = str_replace( '###MANAGE_URL###', esc_url_raw( $email_data['manage_url'] ), $content );
    30523052        $content = str_replace( '###SITEURL###', esc_url_raw( $email_data['siteurl'] ), $content );
    30533053
     3054        // Localize message content for user; fallback to site default for visitors.
     3055        $switched_locale = switch_to_locale( get_user_locale( $request_data->user_id ) );
     3056
    30543057        $subject = sprintf(
    30553058                /* translators: 1: Site name. 2: Name of the confirmed action. */
    30563059                __( '[%1$s] Action Confirmed: %2$s' ),
     
    32213224        if ( $email_sent ) {
    32223225                update_post_meta( $request_id, '_wp_user_notified', true );
    32233226        }
     3227
     3228        if ( $switched_locale ) {
     3229                restore_current_locale();
     3230        }
    32243231}
    32253232
    32263233/**
     
    33673374                return new WP_Error( 'user_request_error', __( 'Invalid request.' ) );
    33683375        }
    33693376
     3377        // Localize message content for user; fallback to site default for visitors.
     3378        $switched_locale = switch_to_locale( get_user_locale( $request->user_id ) );
     3379
    33703380        $email_data = array(
    33713381                'request'     => $request,
    33723382                'email'       => $request->email,
     
    34543464         */
    34553465        $subject = apply_filters( 'user_request_action_email_subject', $subject, $email_data['sitename'], $email_data );
    34563466
    3457         return wp_mail( $email_data['email'], $subject, $content );
     3467        $email_sent = wp_mail( $email_data['email'], $subject, $content );
     3468
     3469        if ( $switched_locale ) {
     3470                restore_current_locale();
     3471        }
     3472
     3473        return $email_sent;
    34583474}
    34593475
    34603476/**
  • tests/phpunit/data/languages/es_ES.po

    Cannot display: file marked as a binary type.
    svn:mime-type = application/octet-stream
     
    1 # Translation of Development (4.4.x) in Spanish (Spain)
    2 # This file is distributed under the same license as the Development (4.4.x) package.
     1# Translation of Development (4.9.x) in Spanish (Spain)
     2# This file is distributed under the same license as the Development (4.9.x) package.
    33msgid ""
    44msgstr ""
    5 "PO-Revision-Date: 2016-10-25 18:28+0200\n"
     5"PO-Revision-Date: 2018-07-25 10:48-0400\n"
    66"MIME-Version: 1.0\n"
    77"Content-Type: text/plain; charset=UTF-8\n"
    88"Content-Transfer-Encoding: 8bit\n"
    99"Plural-Forms: nplurals=2; plural=n != 1;\n"
    10 "X-Generator: Poedit 1.8.10\n"
    11 "Project-Id-Version: Development (4.4.x)\n"
     10"X-Generator: Poedit 2.1\n"
     11"Project-Id-Version: Development (4.9.x)\n"
    1212"Language: es_ES\n"
    1313
    1414#. translators: 'rtl' or 'ltr'. This sets the text direction for WordPress.
     
    3636msgctxt "menu"
    3737msgid "(Currently set to: %s)"
    3838msgstr "(Actualmente fijado en: %s)"
     39
     40#. translators: Privacy data request subject. 1: Site name, 2: Name of the action
     41#: wp-includes/user.php:3445
     42msgid "[%1$s] Confirm Action: %2$s"
     43msgstr "[%1$s] Confirma la acción: %2$s"