The Preferred Languages project is gaining some momentum with this week’s 2.0 release of the feature plugin. In 2017, WordPress Core Committer Pascal Birchler released a prototype that lets users select multiple preferred languages in their settings so that WordPress will load the first translation available, falling back to the next language in the list.
“More than half of all WordPress sites in the world use a language other than US English,” Birchler said in a previous update. “For these sites and users, the options to change the site and user language are great. But when there’s no translation for a given plugin or theme, WordPress falls back to US English. That’s a poor user experience for many non-English speakers.”
Version 2.0 introduces some major changes with a full refactoring of the UI to use React. (Previously it was using jQuery and jQuery UI.) Birchler removed the drag and drop sorting functionality to improve accessibility but users should find that almost everything the plugin still looks the same as before.
This update also brings compaibility with with WP_Textdomain_Registry
and switch_to_user_locale()
for users on WordPress 6.1+ and brings unit test coverage to nearly 100%.
The Preferred Languages plugin has more than 2,000 active installs but Birchler is calling for people to test the update, as he believes the plugin is close to a core merge proposal.
“One big remaining question mark is the concept of translation merging,” he said. “By default, if there are only some missing strings in a selected locale, these would be displayed in English. But with translation merging, the missing strings will be taken from the locale next in line instead. While this works great, it could be a tad slow due to the way translations are loaded in WordPress. Any help addressing this potential performance concern would be greatly appreciated.”
Testers can contribute to the code on GitHub, leave feedback on the support forum, and open new issues to submit bug reports. Getting this project into core will make using WordPress and its plugin and theme ecosystems more accessible for non-English speakers.