[wp-trac] [WordPress Trac] #44541: Text length should be localizable

WordPress Trac noreply at wordpress.org
Mon Jul 9 10:27:24 UTC 2018


#44541: Text length should be localizable
--------------------------------------+---------------------
 Reporter:  miyauchi                  |       Owner:  (none)
     Type:  enhancement               |      Status:  new
 Priority:  normal                    |   Milestone:  5.0
Component:  I18N                      |     Version:
 Severity:  normal                    |  Resolution:
 Keywords:  has-patch has-unit-tests  |     Focuses:
--------------------------------------+---------------------

Comment (by birgire):

 Thanks @miyauchi, it's most likely something regarding my install :)

 So instead I just skimmed through the tests and here are few suggestions:

 We should consider calling {{{restore_previous_locale()}}} before any
 {{{$this->assert*}}}, otherwise it will not restore the previous locale on
 failure, affecting other tests as well.

 I noticed the
 {{{
 require_once dirname( dirname( dirname( dirname( __FILE__ ) ) ) ) . '/src
 /wp-admin/includes/dashboard.php';
 }}}

 Shouldn't it refer to the build directory?

 What about:

 {{{
 require_once ABSPATH . 'wp-admin/includes/dashboard.php';

 }}}

 instead?

 For these assertions:

 {{{
 $this->assertTrue( !! strpos( $result, $expect ) );

 }}}

 isn't there the possibility of a "false negative" when the string position
 is {{{0}}} ?

 What about {{{$this->assertContains()}}} or
 {{{$this->expectOutputRegex()}}} instead?.

 There are some unused variables, like:

 {{{
 $post = $this->factory()->post->create( $args );

 }}}

 what about:

 {{{
 $this->factory()->post->create( $args );

 }}}

 instead to simplify?

 Could we define the long version of the "Lorem Ipsum" text to reuse it?

 Cheers

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


More information about the wp-trac mailing list