Page MenuHomePhabricator

Set user language to current UI language when creating accounts, not only when defined by uselang
Open, MediumPublicFeature

Description

When using something like the Universal Language Selector to give anonymous users a persistent user language, the user should just keep that language when creating an account.

Technically, this means initializing the new user's language setting to the current UI setting.


Version: unspecified
Severity: enhancement

Details

Reference
bz40379

Event Timeline

bzimport raised the priority of this task from to Medium.Nov 22 2014, 1:02 AM
bzimport set Reference to bz40379.
bzimport added a subscriber: Unknown Object (MLST).

Rohit, I know you were looking at this bug, so I'm assigning it to you in case someone else thinks about working on it. If you drop it, unassign yourself and no hard feelings :)

Remember to come and hang out in MediaWiki-General if you need any help!

Unassigning. No apparent progress.

Maybe I'm confused, but doesn't the account creation form already do this? (In LoginForm::addNewAccount on line 247 it sets the user's language.)

"A" language is set, being uselang, per:

105: $this->mLanguage = $request->getText( 'uselang' );

However, with for example ULS, there are other options that determine the language. setlang could be one, the value of the language cookie or the value of the Accept-Language.

[replacing wikidata keyword by adding CC - see bug 56417]

step.zhou wrote:

Hi. Just to clarify: this bug is to address the fact that user language preference is not set upon account creation after choosing a language via the ULS? So the changes should be done in ULS, not SpecialUserLogin?

(In reply to Stephen Zhou from comment #7)

Hi. Just to clarify: this bug is to address the fact that user language
preference is not set upon account creation after choosing a language via
the ULS? So the changes should be done in ULS, not SpecialUserLogin?

No. Comment 0 says "something like the Universal Language Selector", more common in the wild is setting [[mw:uselang]]. The login/signup process itself needs to set in the language preference of the newly created account whatever language is the interface language.

step.zhou wrote:

Ah, I see. Makes sense now.

It looks like uselang is already handled, so what needs to be handled in addition is setlang, the wikilanguage cookie, and Accept-Language value like Siebrand mentioned. The cookie one was not hard so I'll just figure out the other two. Thanks!

Change 120475 had a related patch set uploaded by Nemo bis:
Tries to use wikilanguage cookie, HTTP request Accept Header, and then the get preferred variant in that order

https://gerrit.wikimedia.org/r/120475

Hello @MarkTraceur, is this task still open to new contributors? I am new to wikimedia open source and would love to help with this issue.

Thanks,
Chaitanya

Aklapper changed the subtype of this task from "Task" to "Feature Request".Feb 4 2022, 12:24 PM
Aklapper removed a subscriber: wikibugs-l-list.