8

I updated WP to version 3.9.2 (currently the latest) via Git which works fine. However, in the admin it keeps on telling me “a newer version is available”. After some digging somehow it appears to be related to the language pack. I’ve got WPLANG set to nl_NL.

In the wp-includes/update.php file wp_version_check() checks against the WordPress server for newer versions using a URL like this:

http://api.wordpress.org/core/version-check/1.7/?version=3.9.2&php=5.5.11&mysql=5.5.15&local_package=&blogs=1&users=2&multisite_enabled=0&locale=nl_NL

Click it and you’ll notice it offers a response with the status “upgrade”, yet the version is the same!? If you remove locale argument at the end or leave it empty (URL below), you’ll see it will answer with a status value of “latest” and thus not triggering update nags.

http://api.wordpress.org/core/version-check/1.7/?version=3.9.2&php=5.5.11&mysql=5.5.15&local_package=&blogs=1&users=2&multisite_enabled=0&locale=

I tried flushing the WP cache (update transients) but nothing changes. Anybody gets what is going on here? Thanks.

6

The issue is, there is no value for local_package in the URL.

At first I thought this might be a bug. Similar issues have been reported before (see here and here.

I then stumbled on comment in trac ticket 8729 where user nbachiyski explains how localization should work:

There are two ways to localize WordPress:

  1. Drop some translation files.
  2. Install localized package.

Whenever possible we try to enforce the 2nd way.

So, here is how the whole thing works:

  1. Both the current locale and the current localized package, installed, are sent to the API.
  2. If a localized package for the user's locale is available and the user doesn't have the localized package, the user is prompted to upgrade or to hide updgrade.

You can either install the Dutch version of WordPress or hide the updates for it (/wp-admin/update-core.php> Hide this update).

  • Thank you, Dan. Unfortunately, installing the localized package isn’t possible for me since I’m upgrading WP via Git. That’s why I’m manually updating translation files. However, the links to the trac tickets you provided helped me a lot. – Geert Aug 14 '14 at 7:15
5

Dan’s answer put me on the right path. In addition to the language files, a localized WP package also creates the $wp_local_package variable in wp-includes/version.php. If that variable is set, its value will be included in the version check URL and the response will then correctly say you’re using the latest version:

http://api.wordpress.org/core/version-check/1.7/?version=3.9.2&php=5.5.11&mysql=5.5.15&local_package=nl_NL&blogs=1&users=2&multisite_enabled=0&locale=nl_NL

Since I’m updating WP via Git, installing localized packages is not an option. I’m manually updating the language files. In that case, in order to get rid of the update nags, you can define $wp_local_package yourself in your wp-config.php file. This will make WP think you’re always running the latest localized package:

define('WPLANG', 'nl_NL');
$wp_local_package = WPLANG; // Don’t forget to manually update the language files now

Your Answer

By clicking "Post Your Answer", you acknowledge that you have read our updated terms of service, privacy policy and cookie policy, and that your continued use of the website is subject to these policies.

Not the answer you're looking for? Browse other questions tagged or ask your own question.