[wp-trac] [WordPress Trac] #51539: switch_to_locale() fails for plugins and themes not hosted on wordpress.org.
WordPress Trac
noreply at wordpress.org
Thu Oct 15 17:16:56 UTC 2020
#51539: switch_to_locale() fails for plugins and themes not hosted on
wordpress.org.
--------------------------+-----------------------------
Reporter: jsmoriss | Owner: (none)
Type: defect (bug) | Status: new
Priority: normal | Milestone: Awaiting Review
Component: I18N | Version: 5.5.1
Severity: normal | Keywords:
Focuses: |
--------------------------+-----------------------------
The WP_Locale_Switcher->switch_to_locale() method relies on
_load_textdomain_just_in_time(), which uses _get_path_to_translation(),
which uses _get_path_to_translation_from_lang_dir(), which only returns mo
file paths from WP_LANG_DIR.
If a plugin or theme is not hosted on wordpress.org, it does not have
translations on wordpress.org, so switch_to_locale() fails to properly
load those translation files.
js.
--
Ticket URL: <https://core.trac.wordpress.org/ticket/51539>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform
More information about the wp-trac
mailing list