Make WordPress Core

Opened 4 years ago

Closed 4 years ago

#51539 closed defect (bug) (duplicate)

switch_to_locale() fails for plugins and themes not hosted on

Reported by: jsmoriss's profile jsmoriss Owned by:
Milestone: Priority: normal
Severity: normal Version:
Component: I18N Keywords:
Focuses: Cc:


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, it does not have translations on, so switch_to_locale() fails to properly load those translation files.


Change History (1)

#1 @ocean90
4 years ago

  • Milestone Awaiting Review deleted
  • Resolution set to duplicate
  • Status changed from new to closed
  • Version 5.5.1 deleted

Duplicate of #39210.

Note: See TracTickets for help on using tickets.