Skip to content

v2.0.20

Choose a tag to compare

@rvdforst rvdforst released this 03 Feb 15:02
· 76 commits to main since this release
a9ca976

Improved i18n fallback for MO and PHP translation files

This release improves how translations are loaded when a locale-specific file is missing.

Highlights
• Added full support for .l10n.php translation files (WP PHP translations).
• Improved locale fallback logic using installed/allowed languages instead of hard-coded defaults.
• Supports chained fallbacks (e.g. en_UK → en_GB → en_US → en).
• Keeps backward compatibility with legacy .mo loading.
• Safer filename handling (locale replacement only within the filename).

Technical notes
• Uses both load_translation_file (modern) and load_textdomain_mofile (legacy).
• Falls back only to locales that are actually installed and/or configured.
• Prevents valid translations from being skipped due to rigid fallback rules.

No breaking changes. Existing translations continue to work as before, with more reliable fallbacks.