WordPress.org

Make WordPress Core

Opened 4 years ago

Closed 4 years ago

#36872 closed enhancement (fixed)

No Action For Manually Updated Translations

Reported by: ronalfy Owned by: ocean90
Milestone: 4.6 Priority: normal
Severity: normal Version: 4.5.2
Component: Upgrade/Install Keywords: has-patch commit
Focuses: Cc:

Description

Right now, core, theme, and plugin have the do_action of upgrader_process_complete applied to them.

I feel this should also be applied for manual updates of translations.

Attachments (8)

36872.patch (1.7 KB) - added by ronalfy 4 years ago.
New Action for Tracking Manual Language Updates
36872.2.patch (1.7 KB) - added by ronalfy 4 years ago.
Fix formatting issues
36872.3.patch (1.7 KB) - added by ronalfy 4 years ago.
Typo fix of array to string
36872.4.patch (1.3 KB) - added by ronalfy 4 years ago.
Using filter for plugins, themes, core.
36872.5.patch (2.9 KB) - added by ronalfy 4 years ago.
Adding documentation
36872.6.patch (3.4 KB) - added by ronalfy 4 years ago.
Action for tracking manual updates of translations
36872.7.patch (3.9 KB) - added by ronalfy 4 years ago.
Action for tracking manual updates of translations
36872.8.patch (4.3 KB) - added by ocean90 4 years ago.

Download all attachments as: .zip

Change History (26)

#1 @ronalfy
4 years ago

I'd be willing to go ahead with a patch on this pending the ownership of a core contributor or blessed by the component maintainer.

This ticket was mentioned in Slack in #core by ronaldhuereca. View the logs.


4 years ago

@ronalfy
4 years ago

New Action for Tracking Manual Language Updates

#3 @ronalfy
4 years ago

  • Keywords has-patch added

I went ahead with a new action language_updates_complete since it didn't fall in the scheme of upgrader_process_complete.

Use-case is for logging translations.

#4 @ronalfy
4 years ago

Example output.

<?php
Marker - May 31, 2016, 5:45:18 PM
[31-May-2016 22:45:21 UTC] Array
(
    [0] => Array
        (
            [language] => de_DE
            [version] => 4.5.2
            [type] => core
            [slug] => default
        )

)

[31-May-2016 22:45:40 UTC] Array
(
    [0] => Array
        (
            [language] => de_DE
            [version] => 3.1.5
            [type] => plugin
            [slug] => akismet
        )

    [1] => Array
        (
            [language] => de_DE
            [version] => 2.2.1
            [type] => plugin
            [slug] => cmb2
        )

    [2] => Array
        (
            [language] => de_DE
            [version] => 6.0.5
            [type] => plugin
            [slug] => stops-core-theme-and-plugin-updates
        )

    [3] => Array
        (
            [language] => de_DE
            [version] => 2.2.2
            [type] => plugin
            [slug] => metronet-reorder-posts
        )

    [4] => Array
        (
            [language] => de_DE
            [version] => 1.4
            [type] => theme
            [slug] => twentyfifteen
        )

    [5] => Array
        (
            [language] => de_DE
            [version] => 1.6
            [type] => theme
            [slug] => twentyfourteen
        )

    [6] => Array
        (
            [language] => de_DE
            [version] => 1.7
            [type] => theme
            [slug] => twentythirteen
        )

)

This ticket was mentioned in Slack in #core by ronaldhuereca. View the logs.


4 years ago

@ronalfy
4 years ago

Fix formatting issues

@ronalfy
4 years ago

Typo fix of array to string

#6 in reply to: ↑ 5 @DrewAPicture
4 years ago

Replying to slackbot:

This ticket was mentioned in Slack in #core by ronaldhuereca. View the logs.

See the linked Slack discussion about possible just reusing the upgrader_process_complete for language pack updates.

#7 @DrewAPicture
4 years ago

  • Milestone changed from Awaiting Review to 4.6

#8 @DrewAPicture
4 years ago

  • Milestone changed from 4.6 to Awaiting Review

I was mistaken, @ronalfy is talking about wanting to log all language packs being updated rather than individually. The reuse of upgrader_process_complete for language packs, however, wouldn't be a terrible idea for another ticket.

#9 @DrewAPicture
4 years ago

  • Milestone changed from Awaiting Review to 4.6

Yay, milestone gymanstics.

@ronalfy
4 years ago

Using filter for plugins, themes, core.

@ronalfy
4 years ago

Adding documentation

@ronalfy
4 years ago

Action for tracking manual updates of translations

#10 @ronalfy
4 years ago

Ended up going with upgrader_process_complete thanks to the help of @DrewAPicture.

#11 @ocean90
4 years ago

There are a few version checks hooked into upgrader_process_complete see trunk/src/wp-admin/includes/admin-filters.php?rev=37570&marks=110-114#L110. I think these should be removed in Language_Pack_Upgrader::bulk_upgrade().

@ronalfy
4 years ago

Action for tracking manual updates of translations

#12 @ronalfy
4 years ago

Thanks for the feedback @ocean90 . Patch updated and I also resolved a PHP warning error when the language is changed from the settings panel.

#13 @chriscct7
4 years ago

  • Owner set to ronalfy
  • Status changed from new to assigned

This ticket was mentioned in Slack in #core by voldemortensen. View the logs.


4 years ago

#15 @ocean90
4 years ago

  • Owner changed from ronalfy to ocean90
  • Status changed from assigned to reviewing

@ocean90
4 years ago

#16 @ocean90
4 years ago

36872.7.patch looks good. In 36872.8.patch I tweaked the docs a bit and restored the version checks after the upgrader_process_complete hook.

@DrewAPicture Are you happy with the docs?

#17 @DrewAPicture
4 years ago

  • Keywords commit added

@ocean90 The docs look great :)

#18 @ocean90
4 years ago

  • Resolution set to fixed
  • Status changed from reviewing to closed

In 37687:

Upgrade: Trigger the upgrader_process_complete action for translation updates.

This brings Language_Pack_Upgrader in line with the core, theme, and plugin upgrader.

Props ronalfy.
Fixes #36872.

Note: See TracTickets for help on using tickets.