WordPress.org

Make WordPress Core

Opened 5 years ago

Closed 5 years ago

Last modified 11 months ago

#29860 closed defect (bug) (fixed)

Remove theme/plugin translations when deleting a theme/plugin

Reported by: ocean90 Owned by:
Milestone: 4.1 Priority: normal
Severity: normal Version:
Component: I18N Keywords: has-patch
Focuses: Cc:
PR Number:

Description

When deleting a theme or a plugin the translation files remain in WP_LANG_DIR, when they were installed via the new Translation API (language packs). We should remove them too.

Too keep it simple I attached a patch which doesn't introduce any new API.

I changed wp_get_installed_translations() to return only translations which also have a .mo file since just a .po file isn't enough.

Attachments (2)

29860.patch (7.8 KB) - added by ocean90 5 years ago.
29860.2.patch (13.3 KB) - added by ocean90 5 years ago.

Download all attachments as: .zip

Change History (5)

@ocean90
5 years ago

This ticket was mentioned in IRC in #wordpress-dev by ocean90. View the logs.


5 years ago

@ocean90
5 years ago

#2 @ocean90
5 years ago

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

In 29856:

Language packs: Remove translations when deleting a theme or a plugin.

This is for translation files in WP_LANG_DIR which are installed through a language pack.
Change wp_get_installed_translations() to only return a translation if the .mo file also exists.

fixes #29860.

#3 @ocean90
11 months ago

In 44675:

I18N: Remove JSON translations when deleting a theme or a plugin.

See #29860.
Fixes #45467.

Note: See TracTickets for help on using tickets.