Make WordPress Core

Opened 9 years ago

Last modified 3 weeks ago

#42281 new enhancement

Better Update Management for Translation files

Reported by: stk_jj's profile stk_jj Owned by:
Milestone: Awaiting Review Priority: normal
Severity: normal Version: 4.8.2
Component: Upgrade/Install Keywords: has-patch has-unit-tests has-screenshots
Focuses: Cc:

Description

Codex says:

Automatic translation file updates are already enabled by default, the same as minor core updates.

But still a button "update translations" is shown in the Update Dashboard. This is ridiculous as I

a) have no influence on accepting or skipping a certain translation, because
b) there is no presention of the upcoming translation updates in advance

As we have PTE and GTE for QA autoupdate is the right choice for translation files. Pls consider to remove the "update translations" buttons and substitute it with a email message as per minor core updates.

Change History (7)

#1 @Jyria
8 years ago

  • Keywords 2nd-opinion added

Hello there @stk_jj !

Automatic translations updates are in place, if you are facing the following scenario:

  1. Plugin/theme update/s is/are available.

If you click "Update plugins/themes", within the same update routine also a check for newly available translation files (for just installed plugin/theme versions) is performed and installed automatically onto your installtion if available (!) for those currently updated plugins/themes - without having to click "update translations" separately.

  1. WP Core update

Same thing as above

_

Only if translation updates become available at an asynchronous point of time, you will see the "Update translations" button.
And yes, I agree there should be some improvement here:

  1. At least present the user a list of the exact translation files which just became available, with the possibility to NOT install one or all of them (just like available plugins/themes update list)
  2. Even though codex says, that WP should not force anything onto your installation, without your consent by default ( i.e. "update plugins"-button, "update themes"-button), we should take into account that newly available translation files already ran through thorough review, and you already decided to run the corresponding plugin and/or WP core versions in your installation. Thus the admin of the current installation already gave their consent to these code versions (plugin, theme, core). And since translation files should be considered as "part" of the installed plugin/theme/core versions, translation updates should run automatically, just like minor core updates.

Best regards
Saskia

Could you have a look at this?
@ocean90

Last edited 8 years ago by Jyria (previous) (diff)

#2 @Presskopp
8 years ago

related #31902

Version 0, edited 8 years ago by Presskopp (next)

This ticket was mentioned in PR #11610 on WordPress/wordpress-develop by @Jyria.


3 weeks ago
#3

  • Keywords has-patch has-unit-tests added

## Summary

list_translation_updates() currently renders only a generic "New translations are available." message and the Update Translations button. Unlike the WordPress core, plugin, and theme update sections, it does not resolve or display the specific translation updates that are pending, so there is no pre-upgrade visibility into which component/language/version combinations will be updated.

This PR adds display helpers for translation updates and uses them on update-core.php to list the pending translation updates before the upgrade runs.

## Changes

  • add translation update display helpers in wp-admin/includes/update.php
  • resolve translation update names for core, themes, and plugins
  • map plugin translation slugs back to installed plugin files so WordPress.org-style slugs still display the correct plugin name
  • display a translations count and a per-update list on wp-admin/update-core.php
  • add PHPUnit coverage for translation update display data, including plugin slug fallback behavior

## Test plan

  • [x] php -l src/wp-admin/includes/update.php
  • [x] php -l src/wp-admin/update-core.php
  • [x] php -l tests/phpunit/tests/admin/includesUpdate.php
  • [x] vendor/bin/phpcs --standard=phpcs.xml.dist src/wp-admin/includes/update.php src/wp-admin/update-core.php tests/phpunit/tests/admin/includesUpdate.php
  • [x] Authenticated HTTP smoke test against https://wpcore.wp-studio.dev/wp-admin/update-core.php with a temporary MU-plugin fixture injecting controlled core, plugin, and theme translation updates; verified the rendered translations section shows a count of 3 and entries for WordPress, Hello Dolly, and Twenty Twenty-Four
  • [ ] PHPUnit execution for Tests_Admin_IncludesUpdate could not be run in this environment because the local WordPress test configuration / Docker test environment was unavailable

## Use of AI Tools

AI assistance: Yes
Tool(s): Codex
Model(s): GPT-5-based Codex
Used for: implementation, test scaffolding, server-side smoke-test orchestration, and PR drafting; outputs were reviewed and validated with syntax checks, PHPCS, and an authenticated admin-page smoke test.

#4 @Jyria
3 weeks ago

Refreshing this ticket with a patch for the UI improvement mentioned in comment:1.

PR: https://github.com/WordPress/wordpress-develop/pull/11610

This patch keeps the current translation update behavior, but improves the Updates screen by listing the specific pending translation updates before the upgrade runs. It adds display data helpers for translation updates and renders the pending core/plugin/theme translation packages with component name, language, and target version on wp-admin/update-core.php.

Tests/validation:

  • Added PHPUnit coverage for the translation update display data, including plugin slug mapping for WordPress.org-style slugs.
  • Passed php -l on the changed files.
  • Passed phpcs for the changed files.
  • Ran an authenticated admin smoke test against update-core.php on a dedicated test instance and verified the rendered translations section and count for core, plugin, and theme translation updates.

I was not able to run the PHPUnit suite end-to-end in this environment because the local WordPress test configuration / Docker test environment was unavailable.

However I manually tested this using WP playground: https://github.com/WordPress/wordpress-develop/pull/11610#issuecomment-4287467328

https://isla-stud.io/img_cloud/wordpress_trac_pr_11610.png

Last edited 3 weeks ago by Jyria (previous) (diff)

@Jyria commented on PR #11610:


3 weeks ago
#5

Playground test passed. Manually tested and reviewed. Works.

Test this pull request with WordPress Playground.

#6 @Jyria
3 weeks ago

  • Summary changed from No Autoupdate for Translation files to Better Update Management for Translation files
  • Type changed from defect (bug) to enhancement

#7 @Jyria
3 weeks ago

  • Keywords has-screenshots added; 2nd-opinion removed

Ticket Properties modified to better reflect its status.

Note: See TracTickets for help on using tickets.