wordpress-develop/tests/phpunit/tests/admin
Dominik Schilling 9e83d04f84 I18N: Introduce WP_Textdomain_Registry to store text domains and their language directory paths.
Previously, when using `switch_to_locale()` all current loaded text domains were unloaded and added to the `$l10n_unloaded` global. This prevented the just-in-time loading for text domains after a switch. The just-in-time loading was also only possible if the translations were stored in `WP_LANG_DIR`. Both issues have been fixed.

* Adds `WP_Textdomain_Registry` to keep track of the language directory paths for all plugins and themes.
* Updates all `load_*_textdomain()`  functions to store the path in `WP_Textdomain_Registry`.
* Adds `$reloadable` parameter to `unload_textdomain()` to define whether a text domain can be loaded just-in-time again. This is used by `WP_Locale_Switcher::load_translations()`.
* Extends `_load_textdomain_just_in_time()` to also support text domains of plugins and themes with custom language directories.
* Fixes the incorrect `test_plugin_translation_after_switching_locale_twice()` test which should have catch this issue earlier.
* Adds a new test plugin/theme to test the loading of translations with a custom language directory.
* Deprecates the now unused and private `_get_path_to_translation()` and `_get_path_to_translation_from_lang_dir()` functions.

Props yoavf, swissspidy, dd32, ocean90.
See #26511.
Fixes #39210.

git-svn-id: https://develop.svn.wordpress.org/trunk@49236 602fd350-edb4-49c9-b593-d223f7449a82
2020-10-20 16:03:58 +00:00
..
includesComment.php Code is Poetry. 2017-11-30 23:09:33 +00:00
includesCommunityEvents.php Community Events: Update timezone-related @since tags to 5.5.2. 2020-10-14 21:33:10 +00:00
includesFile.php Tests: First pass at using assertSame() instead of assertEquals() in most of the unit tests. 2020-09-02 00:35:36 +00:00
includesListTable.php Administration: Allow WP_List_Table::get_bulk_items() to receive a nested array in order to output optgroups. 2020-10-18 16:20:07 +00:00
includesMisc.php Tests: First pass at using assertSame() instead of assertEquals() in most of the unit tests. 2020-09-02 00:35:36 +00:00
includesPlugin.php I18N: Introduce WP_Textdomain_Registry to store text domains and their language directory paths. 2020-10-20 16:03:58 +00:00
includesPost.php Tests: First pass at using assertSame() instead of assertEquals() in most of the unit tests. 2020-09-02 00:35:36 +00:00
includesSchema.php Tests: First pass at using assertSame() instead of assertEquals() in most of the unit tests. 2020-09-02 00:35:36 +00:00
includesScreen.php Code Modernization: Use explicit visibility for class property declarations. 2020-10-17 16:24:35 +00:00
includesTemplate.php Docs: Correct comments in test_wp_add_dashboard_widget() per the documentation standards. 2020-10-11 02:35:32 +00:00
includesTheme.php Tests: Introduce assertSameSets() and assertSameSetsWithIndex(), and use them where appropriate. 2020-09-04 07:01:00 +00:00
includesUpdateCore.php Code Modernization: Replace dirname( __FILE__ ) calls with __DIR__ magic constant. 2020-02-06 06:31:22 +00:00
includesUser.php REST API: Introduce Application Passwords for API authentication. 2020-10-08 22:12:02 +00:00
wpPrivacyRequestsTable.php Tests: Clean up some existing @covers tags. 2020-08-25 00:57:17 +00:00