PHP error in es_ES translation due to mismatched templates

My site has started throwing errors for logged-in users. Tracing the error, it seems to occur at wp-content/plugins/better-wp-security/core/modules/two-factor/includes/template.php:98, due to a missing argument in printf. The code in that file seems ok, so the error is in a translation that hasn’t been updated.

At wp-content/languages/plugins/better-wp-security-es_ES.po:1871, the msgstr has an additional template element (%5$s). The same thing happens in the previous template (line 1867).

I have corrected the translations, but they are pending approval.

For any other users affected: check your translations (instead of es_ES, open the corresponding file for your language) and edit to remove additional template elements.

As a general suggestion, maybe you should invalidate translations when the number or type of template spots change in the original, to avoid errors. I’d much rather my users see some untranslated text than an error.

Technical details:

  • Plugin version: 9.1.0
  • PHP version: 8.1.25

 

This site will teach you how to build a WordPress website for beginners. We will cover everything from installing WordPress to adding pages, posts, and images to your site. You will learn how to customize your site with themes and plugins, as well as how to market your site online.

Buy WordPress Transfer