WordPress.org

Make WordPress Core

Opened 3 years ago

Closed 3 years ago

#29395 closed enhancement (fixed)

Site Language: Install translations on the fly

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

Description

This was previously included in #15677, but we decided to extract it for now, because it needs some more work.

Goal
The new language dropdown shows in addition to the installed languages also all available translations. When you select one of the available translations core will download the language pack and switches the site language.

Screencast: https://cloudup.com/cxEoda9nxh6

Issues
The main issue is the access to the filesystem: If it requires the credentials it currently does't work, because of the Automatic_Upgrader_Skin() in wp_download_language_pack().

Attachments (3)

29395.patch (9.3 KB) - added by ocean90 3 years ago.
29395.2.patch (9.7 KB) - added by ocean90 3 years ago.
29395.3.patch (9.7 KB) - added by ocean90 3 years ago.

Download all attachments as: .zip

Change History (22)

@ocean90
3 years ago

#1 @nacin
3 years ago

[29691] should probably be undone by this, as noted in #29456.

#2 follow-up: @SergeyBiryukov
3 years ago

I guess this should allow us to get rid of the unnecessary language selection step on install for localized builds. Or do we still need it for some reason?

See http://make.wordpress.org/polyglots/2014/09/03/i-really-like-the-new-installation-language-page/.

#3 in reply to: ↑ 2 @SergeyBiryukov
3 years ago

Replying to SergeyBiryukov:

I guess this should allow us to get rid of the unnecessary language selection step on install for localized builds.

Resolved in #29487.

#4 @SergeyBiryukov
3 years ago

  • Milestone changed from Awaiting Review to 4.1

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


3 years ago

#6 @ocean90
3 years ago

#29814 was marked as a duplicate.

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


3 years ago

This ticket was mentioned in Slack in #docs by ocean90. View the logs.


3 years ago

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


3 years ago

#10 @ocean90
3 years ago

My current idea is to introduce an AJAX action which takes care of the FS check and the installation. Some brain dump:

  1. On submit we check if the selected languages is already installed
  2. If not we send an AJAX request with the language to install
  3. The action does first a FS check, if it fails the user will be promted to enter the FS credentials
  4. The user enters the data and submits the data again via AJAX
  5. The AJAX action does the installation
  6. On success we send the locale back, on failure we return a message (maybe add_settings_error())
  7. After that the form will be submitted with the new locale and the options can be saved.

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


3 years ago

#12 @ocean90
3 years ago

Let's make use of wp_can_install_language_pack() here and ignore FS credentials for now.

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


3 years ago

@ocean90
3 years ago

#14 follow-up: @johnbillion
3 years ago

  • Keywords 4.1-early removed

29395.2.patch looks great. Works as expected when the filesystem is writable, only shows the currently installed languages when it isn't.

The only change I'd like to make is to move the spinner next to the submit button on both settings screens. What do you think ocean90?

Barring that, this can and should go in.

#15 in reply to: ↑ 14 @ocean90
3 years ago

Replying to johnbillion:

The only change I'd like to make is to move the spinner next to the submit button on both settings screens. What do you think ocean90?

Makes sense, would be consistent with other screens like install or Post UI.

@ocean90
3 years ago

#16 @ocean90
3 years ago

In 30335:

Site Language: Install translations on the fly.

The language dropdown now includes installed languages and all available translations when the filesystem is writable by WordPress.
Go to wp-admin/options-general.php, select one of the available translations, submit the form and let WordPress handle the rest.
Works for Multisite's Default Language too.

see #29395.

#17 follow-up: @johnbillion
3 years ago

  • Keywords has-patch removed

r30495 missed this ticket.

I think we're done here. Anything else you want to do for 4.1 ocean90?

#18 @johnbillion
3 years ago

  • Type changed from enhancement to task (blessed)

#19 in reply to: ↑ 17 @ocean90
3 years ago

  • Resolution set to fixed
  • Status changed from new to closed
  • Type changed from task (blessed) to enhancement

Replying to johnbillion:

Anything else you want to do for 4.1 ocean90?

Looks good for 4.1.

Note: See TracTickets for help on using tickets.