Make WordPress Core


Ignore:
Timestamp:
02/16/2024 10:26:14 AM (22 months ago)
Author:
swissspidy
Message:

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.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/wp-includes/class-wp-textdomain-registry.php

    r57516 r57639  
    315315                if ( $file_path === $mo_path || $file_path === $php_path ) {
    316316                    $found_location = rtrim( $location, '/' ) . '/';
     317                    break 2;
    317318                }
    318319            }
Note: See TracChangeset for help on using the changeset viewer.