[wp-trac] [WordPress Trac] #34114: Remove the requirement to call load_plugin_textdomain() or load_theme_textdomain()

WordPress Trac noreply at wordpress.org
Thu Apr 28 16:22:17 UTC 2016


#34114: Remove the requirement to call load_plugin_textdomain() or
load_theme_textdomain()
--------------------------------------+------------------
 Reporter:  johnbillion               |       Owner:
     Type:  enhancement               |      Status:  new
 Priority:  normal                    |   Milestone:  4.6
Component:  I18N                      |     Version:
 Severity:  normal                    |  Resolution:
 Keywords:  has-patch has-unit-tests  |     Focuses:
--------------------------------------+------------------
Changes (by ocean90):

 * keywords:  dev-feedback has-patch has-unit-tests => has-patch has-unit-
     tests


Comment:

 Some feedback on [attachment:34114.3.diff]:

 * The tests are failing for me:

 {{{
 ) Tests_L10n::test_load_plugin_textdomain_just_in_time
 Failed asserting that two strings are identical.
 --- Expected
 +++ Actual
 @@ @@
 -Das ist ein Dummy Plugin
 +This is a dummy plugin

 /tests/phpunit/tests/l10n.php:70

 2) Tests_L10n::test_load_theme_textdomain_just_in_time
 Failed asserting that two strings are identical.
 --- Expected
 +++ Actual
 @@ @@
 -Das ist ein Dummy Theme
 +This is a dummy theme

 /tests/phpunit/tests/l10n.php:99
 }}}
 * In `load_textdomain_just_in_time()` the default value of the static
 variable should be null and `if ( empty( $cached_mofiles ) )`  should be
 replace with `if ( null === $cached_mofiles )`. This prevents recurring
 lookups for installs which don't have any translations installed.
 * The tests should remove the test plugin/theme from the plugin/theme
 directory
    * Do we really have to copy them? `Tests_Theme_ThemeDir` is changing
 the global `$wp_theme_directories` variable, for the plugin we could just
 require the file like `Tests_Import_Import` does.

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


More information about the wp-trac mailing list