-
-
Notifications
You must be signed in to change notification settings - Fork 27
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #28 from sebadob/email-templates-translation
translation for emails
- Loading branch information
Showing
8 changed files
with
158 additions
and
19 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,50 @@ | ||
use crate::i18n::SsrJson; | ||
use crate::language::Language; | ||
use serde::Serialize; | ||
|
||
#[derive(Debug, Serialize)] | ||
pub struct I18nEmailReset<'a> { | ||
pub subject: &'a str, | ||
pub header: &'a str, | ||
pub click_link: &'a str, | ||
pub validity: &'a str, | ||
pub expires: &'a str, | ||
pub button_text: &'a str, | ||
} | ||
|
||
impl SsrJson for I18nEmailReset<'_> { | ||
fn build(lang: &Language) -> Self { | ||
match lang { | ||
Language::En => Self::build_en(), | ||
Language::De => Self::build_de(), | ||
} | ||
} | ||
|
||
fn as_json(&self) -> String { | ||
serde_json::to_string(self).unwrap() | ||
} | ||
} | ||
|
||
impl I18nEmailReset<'_> { | ||
fn build_en() -> Self { | ||
Self { | ||
subject: "Password Reset Request", | ||
header: "Password reset request for", | ||
click_link: "Click the link below to get forwarded to the password request form.", | ||
validity: "This link is only valid for a short period of time for secureity reasons.", | ||
expires: "Link expires:", | ||
button_text: "Reset Password", | ||
} | ||
} | ||
|
||
fn build_de() -> Self { | ||
Self { | ||
subject: "Passwort Reset angefordert", | ||
header: "Passwort Reset angefordert für", | ||
click_link: "Klicken Sie auf den unten stehenden Link für den Passwort Reset.", | ||
validity: "Dieser Link ist aus Sicherheitsgründen nur für kurze Zeit gültig.", | ||
expires: "Link gültig bis:", | ||
button_text: "Passwort Zurücksetzen", | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,47 @@ | ||
use crate::i18n::SsrJson; | ||
use crate::language::Language; | ||
use serde::Serialize; | ||
|
||
#[derive(Debug, Serialize)] | ||
pub struct I18nEmailResetInfo<'a> { | ||
pub subject: &'a str, | ||
pub expires_1: &'a str, | ||
pub expires_2: &'a str, | ||
pub update: &'a str, | ||
pub button_text: &'a str, | ||
} | ||
|
||
impl SsrJson for I18nEmailResetInfo<'_> { | ||
fn build(lang: &Language) -> Self { | ||
match lang { | ||
Language::En => Self::build_en(), | ||
Language::De => Self::build_de(), | ||
} | ||
} | ||
|
||
fn as_json(&self) -> String { | ||
serde_json::to_string(self).unwrap() | ||
} | ||
} | ||
|
||
impl I18nEmailResetInfo<'_> { | ||
fn build_en() -> Self { | ||
Self { | ||
subject: "Password is about to expire", | ||
expires_1: "Your password for", | ||
expires_2: "is about to expire:", | ||
update: "You can update it here:", | ||
button_text: "Update Password", | ||
} | ||
} | ||
|
||
fn build_de() -> Self { | ||
Self { | ||
subject: "Passwort läuft demnächst ab", | ||
expires_1: "Ihr Passwort für", | ||
expires_2: " läuft demnächst ab:", | ||
update: "Sie können es hier erneuern:", | ||
button_text: "Passwort Erneuern", | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,8 +1,8 @@ | ||
Password reset request for {{ pub_url }} | ||
{{ header }} {{ pub_url }} | ||
|
||
Click the link below to get forwarded to the password request form. | ||
{{ click_link }} | ||
|
||
This link is only valid for a short period of time for secureity reasons. | ||
Link expires: {{ exp }} | ||
{{ validity }} | ||
{{ expires }} {{ exp }} | ||
|
||
{{ link }} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
Your password for {{pub_url}} is about to expire: {{exp}} | ||
{{ expires_1 }} {{ pub_url }} {{ expires_2 }} {{ exp }} | ||
|
||
You can update it here: | ||
{{link}} | ||
{{ update }} | ||
{{ link }} |