WordPress.org

Make WordPress Core

Opened 6 years ago

Closed 6 years ago

#30369 closed defect (bug) (fixed)

Manually installing language files issue

Reported by: deconf Owned by: ocean90
Milestone: 4.1 Priority: normal
Severity: normal Version: 4.0
Component: I18N Keywords:
Focuses: Cc:

Description

There is an issue while manually installing language files, to replicate follow these steps:

  1. Install a new instance of WordPress and select the default option, as shown in 1.png

Install an en_US instance

  1. Copy the localization files in wp-content (Romanian files in this case)
  1. Go to Settings -> General and select the new language (ro_RO). The WordPress install is properly localized, as you can see in 2.png

Settings screen
In Updates screen (see 3.png), you'll be prompted to reinstall the en_US version instead of the ro_RO or whatever.
Updates screen

Attachments (6)

1.png (36.7 KB) - added by deconf 6 years ago.
Install an en_US instance
2.png (61.1 KB) - added by deconf 6 years ago.
Settings screen
3.png (67.3 KB) - added by deconf 6 years ago.
Updates screen
30369.png (98.1 KB) - added by ocean90 6 years ago.
30369.patch (967 bytes) - added by ocean90 6 years ago.
30369.2.patch (1.8 KB) - added by SergeyBiryukov 6 years ago.

Download all attachments as: .zip

Change History (18)

@deconf
6 years ago

Install an en_US instance

@deconf
6 years ago

Settings screen

@deconf
6 years ago

Updates screen

#1 @ocean90
6 years ago

#30367 was marked as a duplicate.

@ocean90
6 years ago

#2 @ocean90
6 years ago

  • Keywords reporter-feedback added

Hello deconf,

I followed your steps but couldn't reproduce the issue, see 30369.png. What happens when you click the "Verifică din nou" button?

@ocean90
6 years ago

#3 @ocean90
6 years ago

  • Keywords has-patch 2nd-opinion added; reporter-feedback removed

After switching back to en_US I could see the issue.
The update results are cached in a transient which we could delete if the WPLANG option is changed, see 30369.patch.

#4 @deconf
6 years ago

  • Keywords reporter-feedback added; has-patch 2nd-opinion removed

After clicking the "Verifică din nou" button, the correct language is displayed (as shown in your attachment). Probably the transient gets updated and the correct language code is displayed.

#5 @ocean90
6 years ago

  • Keywords has-patch 2nd-opinion added; reporter-feedback removed

#6 @markoheijnen
6 years ago

If wanted we can also use the new function in /wp-admin/includes/class-wp-upgrader.php where we have the same code twice.

#7 @SergeyBiryukov
6 years ago

  • Keywords commit added; 2nd-opinion removed
  • Milestone changed from Awaiting Review to 4.1

30369.2.patch uses the new function in class-wp-upgrader.php as well.

#8 @ocean90
6 years ago

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

In 30554:

Clear update caches when site language is changed.

The update screen has a re-install button which could show the wrong language locale after the site language was changed. That's because the update data is cached.
Introduce _wp_clear_update_cache() as a helper function to clean up the update cache.

props SergeyBiryukov, ocean90.
fixes #30369.

#9 follow-up: @nacin
6 years ago

In 30856:

Rename _wp_clear_update_cache() to wp_clean_update_cache().

This makes it match most cache-clearing functions, including the ones it wraps. Also no need for it to be prefixed as "private."

wp_clean_plugins_cache() doesn't always exist, so as a quick fix, clear the transient we care to clear.

see #30369.

#10 @johnbillion
6 years ago

  • Keywords has-patch commit removed
  • Resolution fixed deleted
  • Status changed from closed to reopened

#11 in reply to: ↑ 9 @johnbillion
6 years ago

Replying to nacin:

wp_clean_plugins_cache() doesn't always exist, so as a quick fix, clear the transient we care to clear.

wp_clean_plugins_cache() should be moved out of wp-admin/includes/plugin.php to somewhere more appropriate.

#12 @johnbillion
6 years ago

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

In 30870:

Rename _wp_clear_update_cache() to wp_clean_update_cache().

This makes it match most cache-clearing functions, including the ones it wraps. Also no need for it to be prefixed as "private."

wp_clean_plugins_cache() doesn't always exist, so as a quick fix, clear the transient we care to clear.

Merges [30856] to the 4.1 branch.

Fixes #30369.

Note: See TracTickets for help on using tickets.