25
1
mirror of https://github.com/processone/ejabberd.git synced 2024-12-22 17:28:25 +01:00

Revert "mod_register language reworked"

This reverts commit 3906b5300c.

# Conflicts:
#	src/mod_register_web.erl
This commit is contained in:
Badlop 2021-01-22 14:21:57 +01:00
parent e4155b6f16
commit 8098b83114

View File

@ -115,11 +115,11 @@ process([<<"new">>],
{success, ok, {Username, Host, _Password}} -> {success, ok, {Username, Host, _Password}} ->
Jid = jid:make(Username, Host), Jid = jid:make(Username, Host),
mod_register:send_registration_notifications(?MODULE, Jid, Ip), mod_register:send_registration_notifications(?MODULE, Jid, Ip),
Text = translate:translate(Lang, ?T("XMPP account registered.")), Text = translate:translate(Lang, ?T("Your XMPP account was successfully registered.")),
{200, [], Text}; {200, [], Text};
Error -> Error ->
ErrorText = ErrorText =
list_to_binary([translate:translate(Lang, ?T("Could not register the account: ")), list_to_binary([translate:translate(Lang, ?T("There was an error creating the account: ")),
translate:translate(Lang, get_error_text(Error))]), translate:translate(Lang, get_error_text(Error))]),
{404, [], ErrorText} {404, [], ErrorText}
end; end;
@ -128,11 +128,11 @@ process([<<"delete">>],
host = _HTTPHost}) -> host = _HTTPHost}) ->
case form_del_post(Q) of case form_del_post(Q) of
{atomic, ok} -> {atomic, ok} ->
Text = translate:translate(Lang, ?T("XMPP account unregistered.")), Text = translate:translate(Lang, ?T("Your XMPP account was successfully unregistered.")),
{200, [], Text}; {200, [], Text};
Error -> Error ->
ErrorText = ErrorText =
list_to_binary([translate:translate(Lang, ?T("Could not unregister the account: ")), list_to_binary([translate:translate(Lang, ?T("There was an error deleting the account: ")),
translate:translate(Lang, get_error_text(Error))]), translate:translate(Lang, get_error_text(Error))]),
{404, [], ErrorText} {404, [], ErrorText}
end; end;
@ -143,11 +143,11 @@ process([<<"change_password">>],
host = _HTTPHost}) -> host = _HTTPHost}) ->
case form_changepass_post(Q) of case form_changepass_post(Q) of
{atomic, ok} -> {atomic, ok} ->
Text = translate:translate(Lang, ?T("XMPP account password changed.")), Text = translate:translate(Lang, ?T("The password of your XMPP account was successfully changed.")),
{200, [], Text}; {200, [], Text};
Error -> Error ->
ErrorText = ErrorText =
list_to_binary([translate:translate(Lang, ?T("Could not change the password: ")), list_to_binary([translate:translate(Lang, ?T("There was an error changing the password: ")),
translate:translate(Lang, get_error_text(Error))]), translate:translate(Lang, get_error_text(Error))]),
{404, [], ErrorText} {404, [], ErrorText}
end; end;
@ -184,7 +184,7 @@ css() ->
{ok, Data} -> {ok, Data} ->
{ok, Data}; {ok, Data};
{error, Why} -> {error, Why} ->
?ERROR_MSG("Could not read ~ts: ~ts", [File, file:format_error(Why)]), ?ERROR_MSG("Failed to read ~ts: ~ts", [File, file:format_error(Why)]),
error error
end. end.
@ -232,7 +232,7 @@ form_new_get(Host, Lang, IP) ->
form_new_get2(Host, Lang, CaptchaEls) form_new_get2(Host, Lang, CaptchaEls)
catch catch
throw:Result -> throw:Result ->
?DEBUG("Unexpected result when creating a CAPTCHA: ~p", [Result]), ?DEBUG("Unexpected result when creating a captcha: ~p", [Result]),
ejabberd_web:error(not_allowed) ejabberd_web:error(not_allowed)
end. end.
@ -249,11 +249,11 @@ form_new_get2(Host, Lang, CaptchaEls) ->
{<<"style">>, <<"text-align:center;">>}], {<<"style">>, <<"text-align:center;">>}],
?T("Register an XMPP account")), ?T("Register an XMPP account")),
?XCT(<<"p">>, ?XCT(<<"p">>,
?T("This page allows registering an XMPP " ?T("This page allows to register an XMPP "
"account on this XMPP server. Your " "account in this XMPP server. Your "
"JID (Jabber ID) will be of the " "JID (Jabber ID) will be of the "
"form: username@server. Please read the " "form: username@server. Please read carefully "
"instructions carefully before filling in the " "the instructions to fill correctly the "
"fields.")), "fields.")),
?XAE(<<"form">>, ?XAE(<<"form">>,
[{<<"action">>, <<"">>}, {<<"method">>, <<"post">>}], [{<<"action">>, <<"">>}, {<<"method">>, <<"post">>}],
@ -265,8 +265,8 @@ form_new_get2(Host, Lang, CaptchaEls) ->
?BR, ?BR,
?XE(<<"ul">>, ?XE(<<"ul">>,
[?XCT(<<"li">>, [?XCT(<<"li">>,
?T("This is case insensitive: \"macbeth\" is " ?T("This is case insensitive: macbeth is "
"the same as \"MacBeth\" and \"Macbeth\".")), "the same that MacBeth and Macbeth.")),
?XC(<<"li">>, ?XC(<<"li">>,
<<(translate:translate(Lang, ?T("Characters not allowed:")))/binary, <<(translate:translate(Lang, ?T("Characters not allowed:")))/binary,
" \" & ' / : < > @ ">>)])]), " \" & ' / : < > @ ">>)])]),
@ -284,15 +284,15 @@ form_new_get2(Host, Lang, CaptchaEls) ->
"not even the administrators of the XMPP " "not even the administrators of the XMPP "
"server.")), "server.")),
?XCT(<<"li">>, ?XCT(<<"li">>,
?T("You can change your password using " ?T("You can later change your password using "
"an XMPP client later.")), "an XMPP client.")),
?XCT(<<"li">>, ?XCT(<<"li">>,
?T("Some XMPP clients can store your password " ?T("Some XMPP clients can store your password "
"on the computer, but for safety reasons " "in the computer, but you should do this only "
"you should do this on your personal computers .")), "in your personal computer for safety reasons.")),
?XCT(<<"li">>, ?XCT(<<"li">>,
?T("Memorize your password, or write it " ?T("Memorize your password, or write it "
"on a paper placed in a safe place. In " "in a paper placed in a safe place. In "
"XMPP there isn't an automated way " "XMPP there isn't an automated way "
"to recover your password if you forget " "to recover your password if you forget "
"it."))])]), "it."))])]),
@ -504,8 +504,8 @@ form_del_get(Host, Lang) ->
{<<"style">>, <<"text-align:center;">>}], {<<"style">>, <<"text-align:center;">>}],
?T("Unregister an XMPP account")), ?T("Unregister an XMPP account")),
?XCT(<<"p">>, ?XCT(<<"p">>,
?T("This page allows unregistering an XMPP " ?T("This page allows to unregister an XMPP "
"account on this XMPP server.")), "account in this XMPP server.")),
?XAE(<<"form">>, ?XAE(<<"form">>,
[{<<"action">>, <<"">>}, {<<"method">>, <<"post">>}], [{<<"action">>, <<"">>}, {<<"method">>, <<"post">>}],
[?XE(<<"ol">>, [?XE(<<"ol">>,
@ -596,7 +596,7 @@ unregister_account(Username, Host, Password) ->
%%%---------------------------------------------------------------------- %%%----------------------------------------------------------------------
get_error_text({error, captcha_non_valid}) -> get_error_text({error, captcha_non_valid}) ->
?T("Wrong CAPTCHA entered"); ?T("The captcha you entered is wrong");
get_error_text({error, exists}) -> get_error_text({error, exists}) ->
?T("The account already exists"); ?T("The account already exists");
get_error_text({error, password_incorrect}) -> get_error_text({error, password_incorrect}) ->
@ -627,11 +627,11 @@ mod_doc() ->
?T("- Unregister an existing account on the server."), "", ?T("- Unregister an existing account on the server."), "",
?T("This module supports CAPTCHA image to register a new account. " ?T("This module supports CAPTCHA image to register a new account. "
"To enable this feature, configure the options 'captcha\_cmd' " "To enable this feature, configure the options 'captcha\_cmd' "
"and 'captcha\_url', documented in the section with " "and 'captcha\_url', which are documented in the section with "
"top-level options."), "", "top-level options."), "",
?T("As a usage example, users of the host 'example.org' can " ?T("As an example usage, the users of the host 'example.org' can "
"visit the page: 'https://example.org:5281/register/' It is " "visit the page: 'https://example.org:5281/register/' It is "
"important to include the last \"/\" character in the URL, " "important to include the last / character in the URL, "
"otherwise the URLs for subpages will be incorrect."), "", "otherwise the subpages URL will be incorrect."), "",
?T("The module depends on 'mod_register' where all the configuration " ?T("The module depends on 'mod_register' where all the configuration "
"is performed.")]}. "is performed.")]}.