[wp-trac] [WordPress Trac] #43985: Privacy: The user request email should be sent in the user language

WordPress Trac noreply at wordpress.org
Wed Aug 8 12:26:11 UTC 2018


#43985: Privacy: The user request email should be sent in the user language
-------------------------------------+-------------------------------------
 Reporter:  Chouby                   |       Owner:  desrosj
     Type:  defect (bug)             |      Status:  accepted
 Priority:  normal                   |   Milestone:  4.9.9
Component:  I18N                     |     Version:  4.9.6
 Severity:  normal                   |  Resolution:
 Keywords:  has-patch needs-testing  |     Focuses:  administration,
  has-unit-tests                     |  privacy
-------------------------------------+-------------------------------------

Comment (by birgire):

 This seems to be in good progress.

 The latest patch [attachment:"43985.11.diff"] runs successfully on my
 install.

 Here are few things from reviewing the latest
 [attachment:"43985.11.diff"]:

 - There are currently no {{{restore_previous_locale()}}}. Was that
 intentionally?

 - There is some discrepancy between test method descriptions and test
 method function names

 Here is "site has a default locale" vs {{{site_has_non_default_locale}}}:

 {{{
 /**
  * The function should respect the user locale settings when the site has
 a default locale and the administrator
  * uses the site default.
  *
  * @ticket 43985
  */
 public function
 test_should_send_user_request_email_in_user_locale_when_site_has_non_default_locale()
 {

 }}}


 It looks like the site is not in default locale (en_US) here:


 {{{
 /**
  * The function should respect the user locale settings when the site has
 a default locale, the administrator
  * has a different locale, and the user uses the site's default.
  *
  * @ticket 43985
  */
 public function
 test_should_send_user_request_email_in_user_locale_when_admin_has_different_locale_than_site()
 {
         update_option( 'WPLANG', 'es_ES' );
         switch_to_locale( 'es_ES' );

 }}}

 Same here:

 {{{
 /**
  * The function should respect the user locale settings when the site has
 a default locale and both the
  * administrator and the user use different locales.
  *
  * @ticket 43985
  */
 public function
 test_should_send_user_request_email_in_user_locale_when_admin_and_site_have_different_locales()
 {
         update_option( 'WPLANG', 'es_ES' );
         switch_to_locale( 'es_ES' );

 }}}

 - A typo in {{{'erase.request.from.unergistered.user at example.com'}}},
 should be {{{'erase.request.from.unregistered.user at example.com'}}}.
 - There are two {{{wp_create_user_request()}}} and two
 {{{wp_set_current_user()}}} in
 {{{test_should_send_user_request_email_in_user_locale_when_admin_has_different_locale_than_site()}}}.
 - Are the global {{{$taxnow}}} and {{{$typenow}}} (implicitly) set in the
 test methods? It was always empty during my test runs.
 - Should the manual {{{remove_filter}}} be avoided in test methods if
 possible and rely on the built-in  {{{_restore_hooks()}}} during tear
 down? Sometimes it's nice though to see the scope of the filtering, i.e.
 when {{{add_filter}}} is added and when {{{remove_filter}}}. I'm just
 mentioning it here for future reference.

-- 
Ticket URL: <https://core.trac.wordpress.org/ticket/43985#comment:43>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform


More information about the wp-trac mailing list