Add a language pack upgrader class.

At the conclusion of any upgrade, after the transients are refreshed from the API, pending translations are downloaded and installed to wp-content/languages.

props dd32.
see #18200.


git-svn-id: https://develop.svn.wordpress.org/trunk@25566 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
Andrew Nacin
2013-09-23 02:07:51 +00:00
parent b28cc74069
commit 330a8daccd
4 changed files with 167 additions and 1 deletions
+22
View File
@@ -379,3 +379,25 @@ function maintenance_nag() {
echo "<div class='update-nag'>$msg</div>";
}
add_action( 'admin_notices', 'maintenance_nag' );
/**
* Retrieves a list of all language updates available.
*
* @since 3.7.0
*/
function wp_get_translation_updates() {
$updates = array();
$transients = array( 'update_core' => 'core', 'update_plugins' => 'plugin', 'update_themes' => 'theme' );
foreach ( $transients as $transient => $type ) {
$transient = get_site_transient( $transient );
if ( empty( $transient->translations ) )
continue;
foreach ( $transient->translations as $translation ) {
$updates[] = (object) $translation;
}
}
return $updates;
}