Make WordPress Core

Opened 5 months ago

Closed 5 months ago

Last modified 5 months ago

#60553 closed defect (bug) (fixed)

Performant Translations: PHP translation files erroneously in language dropdown

Reported by: swissspidy's profile swissspidy Owned by: swissspidy's profile swissspidy
Milestone: 6.5 Priority: normal
Severity: normal Version: 6.5
Component: I18N Keywords: has-patch has-unit-tests
Focuses: Cc:

Description

This is a follow-up to #59656 and specifically [57516], which caused get_available_languages() to loop through not only .mo files but also .l10n.php files.

This caused odd "de_DE.l10n.php" entries in the language dropdown that obviously won't work.

Change History (4)

#2 @swissspidy
5 months ago

  • Resolution set to fixed
  • Status changed from assigned to closed

In 57639:

I18N: Prevent incorrect language dropdown entries when there are .l10n.php files.

In [57516], the just-in-time translation loading logic was enhanced to support cases where only .l10n.php translation exist but no .mo or .po files. This caused a slight regression in get_available_languages(), which uses the list of files to populate the language dropdown list on the settings page.

To address this, the new file extension is now properly stripped off, and the resulting file list is de-duplicated. New test files are added to allow the existing tests to cover this new scenario.

See #59656.
Fixes #60553.

#4 @swissspidy
5 months ago

  • Milestone changed from Awaiting Review to 6.5
Note: See TracTickets for help on using tickets.