#33844 closed enhancement (fixed)
Add language chooser to wp-signup.php
Reported by: | DrewAPicture | Owned by: | johnbillion |
---|---|---|---|
Milestone: | 4.4 | Priority: | normal |
Severity: | normal | Version: | 4.3 |
Component: | Login and Registration | Keywords: | has-patch has-screenshots |
Focuses: | multisite | Cc: |
Description
In [33920], we added the language chooser to site-new.php for choosing the language when creating a new site in the network admin.
We should also make it possible to choose the language when registering a site via wp-signup.php.
In the attached patch, there are two important aspects to note that differ from the site-new.php implementation:
- Only already-installed languages are available in the drop-down (implementing when-needed installation would require loading the entire languages administration API otherwise)
- It adds a filter on the available languages for this context and simultaneously makes it possible to disable the setting output by passing an empty array
There is also logic to strip any not-installed languages before output.
Attachments (9)
Change History (25)
#2
@
9 years ago
- Keywords needs-screenshots added
- Type changed from defect (bug) to enhancement
- Version set to trunk
#3
@
9 years ago
- Keywords needs-screenshots removed
Added screenshots for Twenty Thirteen - Sixteen. The bar in the middle of the Twenty Sixteen screenshot is an artifact from my screenshot add-on. Definitely going to need a little bit of styling help in terms of forcing the drop-down to a new line in a not-janky way, because the spicing currently is not good.
Also, you might notice that all of the other setting titles have a trailing colon. I didn't introduce one here because I figured we probably didn't want such a close approximation to an existing string. Actually makes me wonder if there are close duplicates to the others like "Site Title" etc.
#4
@
9 years ago
- Keywords dev-feedback added
I'd be interested to see input here from @lancewillett or @obenland here on best-suggestion for minimally styling the language chooser.
#6
@
9 years ago
I agree, it needs some margin adjustments in pretty much all themes. Not sure what we do with dropdowns in Twenty Fifteen, but I think it should look like in the other default themes. The full-width input elements don't really work on that screen, maybe we should think about displaying them like in Twenty Thirteen.
#7
@
9 years ago
- Keywords has-screenshots commit added; needs-testing dev-feedback removed
33844.2.diff removes the line break and relies simply on display:block
. See:
#8
@
9 years ago
- Owner changed from DrewAPicture to obenland
- Status changed from accepted to assigned
@obenland Mind reviewing this, pretty please? :-)
#9
@
9 years ago
- Keywords commit removed
I think the value of $_POST['WPLANG']
should be checked against get_available_languages()
and set to an empty value if it's not valid.
#10
@
9 years ago
In fact the signup_available_languages
filter would need to be called here too, in case a site has a language pack installed but the owner doesn't want new sites using it but a new user manually sets it in their $_POST
request (unlikely, but it's possible).
#11
@
9 years ago
- Keywords commit added
- Owner changed from obenland to johnbillion
- Status changed from assigned to reviewing
@johnbillion: Addressed your feedback in 33844.3.diff.
#12
@
9 years ago
- Keywords commit removed
This doesn't work when signing up a user account and a blog at the same time. Also the WPLANG option doesn't persist if there's an error with the form submission.
New patch coming up.
#13
@
9 years ago
33844.4.diff addresses the following:
- Ensures the language value persists between page loads when entering invalid information into the signup form.
- Uses the language option when a user is signing up for an account and a blog at the same time (visiting
wp-signup.php
while not logged in and both user and site creation are open).
This probably needs some DRYing at this point.
#14
@
9 years ago
@johnbillion: 33844.5.diff encapsulates the filter and intersect logic into signup_get_available_languages()
to DRY up 33844.4.diff.
Let's get some screenshots of what this dropdown looks like in the last few default themes (in case the CSS needs tweaking).