Allow user to register with custom language
This commit is contained in:
parent
396f036b13
commit
e644f8dea5
7 changed files with 93 additions and 3 deletions
|
|
@ -12,6 +12,8 @@ defmodule Pleroma.Web.TwitterAPI.TwitterAPI do
|
|||
alias Pleroma.UserInviteToken
|
||||
|
||||
def register_user(params, opts \\ []) do
|
||||
fallback_language = Gettext.get_locale()
|
||||
|
||||
params =
|
||||
params
|
||||
|> Map.take([:email, :token, :password])
|
||||
|
|
@ -21,6 +23,10 @@ defmodule Pleroma.Web.TwitterAPI.TwitterAPI do
|
|||
|> Map.put(:password_confirmation, params[:password])
|
||||
|> Map.put(:registration_reason, params[:reason])
|
||||
|> Map.put(:birthday, params[:birthday])
|
||||
|> Map.put(
|
||||
:language,
|
||||
Pleroma.Web.Gettext.normalize_locale(params[:language]) || fallback_language
|
||||
)
|
||||
|
||||
if Pleroma.Config.get([:instance, :registrations_open]) do
|
||||
create_user(params, opts)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue