Commit ded21ff2 authored by Stephane Glondu's avatar Stephane Glondu

Translate email subjects

parent 0bc6de39
......@@ -53,7 +53,6 @@ module Make (D : ELECTION_DATA) (M : RANDOM with type 'a t = 'a Lwt.t) : WEB_ELE
let send_confirmation_email user email hash =
let title = D.election.e_params.e_name in
let subject = "Your vote for election " ^ title in
let x = (D.election.e_params.e_uuid, ()) in
let url1 = Eliom_uri.make_string_uri ~absolute:true
~service:Web_services.election_pretty_ballots x |> rewrite_prefix
......@@ -63,6 +62,7 @@ module Make (D : ELECTION_DATA) (M : RANDOM with type 'a t = 'a Lwt.t) : WEB_ELE
in
let%lwt language = Eliom_reference.get Web_state.language in
let module L = (val Web_i18n.get_lang language) in
let subject = Printf.sprintf L.mail_confirmation_subject title in
let body = Printf.sprintf L.mail_confirmation user title hash url1 url2 in
send_email email subject body
......
......@@ -100,7 +100,10 @@ module type LocalizedStrings = sig
val come_back_later : string
val cookies_are_blocked : string
val please_enable_them : string
val mail_password_subject : (string -> 'f, 'b, 'c, 'e, 'e, 'f) format6
val mail_password : (string -> string -> string -> string -> 'f, 'b, 'c, 'e, 'e, 'f) format6
val mail_credential_subject : (string -> 'f, 'b, 'c, 'e, 'e, 'f) format6
val mail_credential : (string -> string -> string -> string -> 'f, 'b, 'c, 'e, 'e, 'f) format6
val mail_confirmation_subject : (string -> 'f, 'b, 'c, 'e, 'e, 'f) format6
val mail_confirmation : (string -> string -> string -> string -> string -> 'f, 'b, 'c, 'e, 'e, 'f) format6
end
......@@ -101,6 +101,9 @@ let cookies_are_blocked = "Cookies sind deaktiviert"
let please_enable_them = "Ihr Browser nimmt keine Cookies an, bitte aktivieren Sie diese."
let mail_password_subject : ('a, 'b, 'c, 'd, 'e, 'f) format6 =
"Your password for election %s" (* FIXME *)
let mail_password : ('a, 'b, 'c, 'd, 'e, 'f) format6 =
"Sie sind für die folgende Abstimmung als Wähler eingetragen:
......@@ -121,6 +124,9 @@ Website der Abstimmung: %s
Sie können so oft abstimmen wie Sie wollen, nur die letzte Stimme zählt."
let mail_credential_subject : ('a, 'b, 'c, 'd, 'e, 'f) format6 =
"Your credential for election %s" (* FIXME *)
let mail_credential : ('a, 'b, 'c, 'd, 'e, 'f) format6 =
"Sie sind für die folgende Abstimmung als Wähler eingetragen:
......@@ -141,6 +147,9 @@ Website der Abstimmung: %s
Sie können so oft abstimmen wie Sie wollen, nur die letzte Stimme zählt."
let mail_confirmation_subject : ('a, 'b, 'c, 'd, 'e, 'f) format6 =
"Your vote for election %s" (* FIXME *)
let mail_confirmation : ('a, 'b, 'c, 'd, 'e, 'f) format6 =
"%s,
......
......@@ -101,6 +101,9 @@ let cookies_are_blocked = "Cookies are blocked"
let please_enable_them = "Your browser seems to block cookies. Please enable them."
let mail_password_subject : ('a, 'b, 'c, 'd, 'e, 'f) format6 =
"Your password for election %s"
let mail_password : ('a, 'b, 'c, 'd, 'e, 'f) format6 =
"You are listed as a voter for the election
......@@ -121,6 +124,9 @@ Note that you are allowed to vote several times. Only the last vote
counts."
let mail_credential_subject : ('a, 'b, 'c, 'd, 'e, 'f) format6 =
"Your credential for election %s"
let mail_credential : ('a, 'b, 'c, 'd, 'e, 'f) format6 =
"You are listed as a voter for the election
......@@ -141,6 +147,9 @@ Note that you are allowed to vote several times. Only the last vote
counts."
let mail_confirmation_subject : ('a, 'b, 'c, 'd, 'e, 'f) format6 =
"Your vote for election %s"
let mail_confirmation : ('a, 'b, 'c, 'd, 'e, 'f) format6 =
"Dear %s,
......
......@@ -101,6 +101,9 @@ let cookies_are_blocked = "Les cookies sont bloqués"
let please_enable_them = "Votre navigateur semble bloquer les cookies. Veuillez les activer."
let mail_password_subject : ('a, 'b, 'c, 'd, 'e, 'f) format6 =
"Votre mot de passe pour l'élection %s"
let mail_password : ('a, 'b, 'c, 'd, 'e, 'f) format6 =
"Vous êtes enregistré(e) en tant qu'électeur(trice) pour l'élection
......@@ -122,6 +125,9 @@ Notez que vous pouvez voter plusieurs fois. Seul le dernier vote est
pris en compte."
let mail_credential_subject : ('a, 'b, 'c, 'd, 'e, 'f) format6 =
"Votre code de vote pour l'élection %s"
let mail_credential : ('a, 'b, 'c, 'd, 'e, 'f) format6 =
"Vous êtes enregistré(e) en tant qu'électeur(trice) pour l'élection
......@@ -143,6 +149,9 @@ Notez que vous pouvez voter plusieurs fois. Seul le dernier vote est
pris en compte."
let mail_confirmation_subject : ('a, 'b, 'c, 'd, 'e, 'f) format6 =
"Votre vote pour l'élection %s"
let mail_confirmation : ('a, 'b, 'c, 'd, 'e, 'f) format6 =
"%s,
......
......@@ -449,7 +449,11 @@ let generate_password langs title url id =
) langs in
let body = PString.concat "\n\n----------\n\n" bodies in
let body = body ^ "\n\n-- \nBelenios" in
let subject = "Your password for election " ^ title in
let subject =
let lang = List.hd langs in
let module L = (val Web_i18n.get_lang lang) in
Printf.sprintf L.mail_password_subject title
in
send_email email subject body >>
return (salt, hashed)
......@@ -780,7 +784,11 @@ let () =
) langs in
let body = PString.concat "\n\n----------\n\n" bodies in
let body = body ^ "\n\n-- \nBelenios" in
let subject = "Your credential for election " ^ title in
let subject =
let lang = List.hd langs in
let module L = (val Web_i18n.get_lang lang) in
Printf.sprintf L.mail_credential_subject title
in
let%lwt () = send_email email subject body in
return @@ S.add pub_cred accu
) S.empty se.se_voters
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment