Make WordPress Core

Opened 5 years ago

Closed 5 years ago

Last modified 5 years ago

#47108 closed enhancement (duplicate)

Plugin and theme language packs are not downloaded when changing language

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


When changing the WordPress language in Settings -> General, the core language packs are immediately downloaded and available. However, the plugin and theme language packs aren't handled: at this point there are no .mo and .po files downloaded for the new language.

Actually, the plugin and theme language packs are downloaded only after users go to the Updates page and click on "Update Translations".

Code-wise this seems to be the intended behavior, but there are some undesirable side-effects:

  • User experience is not ideal: there's nothing to inform users they have to update to actually get plugins and themes translations.
  • Plugins (and themes) code relying on is_textdomain_loaded() will fail because the new language .mo file doesn't exist yet. While this is technically correct, it's a bit misleading as developers might expect it returns true once a new language has been set.

To reproduce on trunk:

  • activate a plugin that is translated
  • delete the build/wp-content/languages/ directory
  • go to Settings > General Settings and set a new language
  • observe the build/wp-content/languages/ directory and see the core language files are donwloaded immediately
  • see there are no plugins and themes sub-directories under build/wp-content/languages/ directory
  • at this point, the WordPress core admin pages will be translated, the plugin / themes pages won't
  • go to the Updates page
  • click "Update Translations" (in whatever language it's displayed :) )
  • observe the build/wp-content/languages/ directory and see that only now the plugins and themes sub-directories get created and actually contain the plugin / theme language packs

I'd tend to think software should have smart default behaviors and not require users to do manual tasks that can be avoided. Seems to me a better behavior would be automatically downloading also the plugin and theme language packs.

/Cc @swissspidy for his expertise and help in debugging this :)

Change History (2)

#1 @dimadin
5 years ago

  • Resolution set to duplicate
  • Status changed from new to closed

Duplicate of #30559.

#2 @SergeyBiryukov
5 years ago

  • Milestone Awaiting Review deleted
Note: See TracTickets for help on using tickets.