Make WordPress Core

Opened 13 months ago

Last modified 2 months ago

#59893 new enhancement

Add a translation section in the Site Health report

Reported by: sebastienserre's profile sebastienserre Owned by:
Milestone: Awaiting Review Priority: normal
Severity: normal Version: 6.5
Component: Site Health Keywords: 2nd-opinion has-patch
Focuses: Cc:

Description

In the Site Helth report, we can know if Core, plugins or theme are outdated or not.
It would be great to also know if some translations are available to be updated.

Attachments (4)

updates-available.jpg (81.2 KB) - added by sebastienserre 10 months ago.
translations-site-health.jpg (56.1 KB) - added by sebastienserre 9 months ago.
Capture d’écran du 2024-09-25 15-52-32.png (129.3 KB) - added by sebastienserre 2 months ago.
site-health-translation.png (324.8 KB) - added by flosteve 2 months ago.

Download all attachments as: .zip

Change History (15)

#1 @SergeyBiryukov
13 months ago

Hi there, thanks for the ticket!

A similar enhancement was previously suggested in #34907.

Just noting that not listing translation updates was an intentional decision at the time, as they are generally installed automatically under the hood, e.g. along with a plugin or theme update. Related: #28133, #28571, #32270, #53031.

#2 @sebastienserre
13 months ago

Not listing them on wp-admin/update-core.php, I totally understand...
Having them listed in the site-health report is something which can be helpful for support team.

Working at Polylang helpdesk, a customer asked me why "add to cart" button is not translated in Russian. I know WooCommerce is translated, but strings can be overwritten by a 3rd party (another plugin or the activated theme) which can be not translated (or not up-to-date).

This ticket was mentioned in Slack in #polyglots by tobifjellner. View the logs.


13 months ago

#4 @pedromendonca
13 months ago

Hi, check out some tests and info that this plugin (https://wordpress.org/plugins/translation-tools/) adds to the Site Health, can be seen in the plugin screenshots, these were implemented as a proof of concept and could easily be part of WP core.

Site Health Status:

  • Check if the Translation API is available
  • Check if the installed core version has a translation project
  • Check if the site locale has Language Packs, with links to invite to add more translations or force update the current translation.

Site Health Info:

  • Site and User language, with the current language packs status. This info is extended to the full array of chosen Languages for users of Preferred Languages plugin.

#5 @sebastienserre
10 months ago

My first goal on this Trac ticket was to add at least an information with something like:
"Some translations are outdated" or "Some translations updates are available"

What I think about is just a reflect of the attached screenshot (updates-available.jpg) in the Site Health report.

#6 @sebastienserre
9 months ago

In fact, I was thinking about something simpler (that looks like what we have in the update-core.php

Something like this (POC) :

<?php
add_filter( 'debug_information', 'wp_add_translations' );
function wp_add_translations( $debug_infos ) {
        $updates                = wp_get_translation_updates();
        $translations_available = __( 'No' );
        if ( ! empty( $updates ) ) {
                $translations_available = __( 'Yes' );
        }
        $debug_infos['wp-translations'] = array(
                'label'  => __( 'Translations' ),
                'fields' => array(
                        'translations' => array(
                                'label' => __( 'Translations available' ),
                                'value' => $translations_available,
                        ),
                )
        );

        return $debug_infos;
}

Check translations-site-health.jpg

Last edited 9 months ago by sebastienserre (previous) (diff)

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


9 months ago
#7

  • Keywords has-patch added; needs-patch removed

This ticket was mentioned in Slack in #polyglots by sebastienserre. View the logs.


9 months ago

#10 @flosteve
2 months ago

Hi, your suggestion works well @sebastienserre . Here is what I get. (See screenshot).

Now the question remains: should it be included in the "Status" or "Info" Section ? As this is not critical but just informative, why then just keep it info.

Thanks

#11 @sebastienserre
2 months ago

I think this is better in the info tab.
In the status tab, we maybe could add a "warning" in case of something missing or updatable ?
Any suggestion on this @audrasjb ?

Last edited 2 months ago by sebastienserre (previous) (diff)
Note: See TracTickets for help on using tickets.