summaryrefslogtreecommitdiffci
path: root/locale
diff options
from:
to:
context:
space:
mode:
authorGravatar SayaAndy <saya.andy@posteo.com> 2025-10-23 01:15:26 +0700
committerGravatar SayaAndy <saya.andy@posteo.com> 2025-10-23 01:15:26 +0700
commit0d261d2f7d080b610f50102576073e334a89e8cb (patch)
tree3f86877a48cdb02486d6b5cb771a420c82c7eacf /locale
parent695889f42896c1e3f1290a588ac1c5483d0124f0 (diff)
downloadweb-0d261d2f7d080b610f50102576073e334a89e8cb.tar.gz
web-0d261d2f7d080b610f50102576073e334a89e8cb.zip
feat: email linking
Diffstat (limited to 'locale')
-rw-r--r--locale/localization.en.yaml27
-rw-r--r--locale/localization.go49
-rw-r--r--locale/localization.ru.yaml27
3 files changed, 98 insertions, 5 deletions
diff --git a/locale/localization.en.yaml b/locale/localization.en.yaml
index e93ab00..49d21ee 100644
--- a/locale/localization.en.yaml
+++ b/locale/localization.en.yaml
@@ -25,3 +25,30 @@ HomePage:
Metadata:
Published: 'Published'
Action: 'Took place on'
+Mail:
+ VerifyEmail:
+ Subject: 'Verification Link for SAYA.TODAY is waiting for you!'
+ Welcome: 'Greetings!'
+ Intro: 'There are 2 ways for us to validate your profile:'
+ GotoLink: 'Go by this link:'
+ InputCode: "Or input this code on the personal page:"
+ IfRandom: 'If you are unsure what this letter this, you can ignore it, and also, if you are interested, you may visit my site :)'
+ NewPost:
+ Subject: 'New post arrived at SAYA.TODAY!'
+UserProfile:
+ Header: 'Personal Settings'
+ EmailHeader: 'E-Mail'
+ VerificationCodeHeader: 'Verification Code'
+ TypeEmail: 'Please type your email'
+ SendCodeButton: 'Send Code'
+ VerifyButton: 'Verify'
+ VerificationCodeSent: 'Verification code sent! Please check your e-mail. Your next verification attempt will be possible on {}.'
+ DelayTilVerification: 'You have already requested the verification before! Please wait until {} for a new verification request.'
+ FailedEmailRender: 'Failed to render the email status message, please ask administrator for a more detailed cause.'
+ VerificationCodeSendingError: 'Failed to send a verification code, please ask administrator for a more detailed cause.'
+ EmailAlreadyValidated: 'You already have this E-Mail validated.'
+ EmailTaken: 'This E-Mail is already taken.'
+ EmailEmpty: 'E-Mail is unset or empty.'
+ VerificationSuccess: 'Success! You are now able to subscribe with your new e-mail.'
+ VerificationFailed: 'Verification code is invalid, please ask administrator for a more detailed cause.'
+ VerificationEmpty: 'Verification code is unset or empty.'
diff --git a/locale/localization.go b/locale/localization.go
index 7dbb554..9022b50 100644
--- a/locale/localization.go
+++ b/locale/localization.go
@@ -8,11 +8,13 @@ import (
)
type LocaleConfig struct {
- TagsLabel string `yaml:"TagsLabel" json:"TagsLabel"`
- BlogSearch BlogSearchConfig `yaml:"BlogSearch" json:"BlogSearch"`
- GlobalMap GlobalMapConfig `yaml:"GlobalMap" json:"GlobalMap"`
- HomePage HomePageConfig `yaml:"HomePage" json:"HomePage"`
- Metadata MetadataConfig `yaml:"Metadata" json:"Metadata"`
+ TagsLabel string `yaml:"TagsLabel" json:"TagsLabel"`
+ BlogSearch BlogSearchConfig `yaml:"BlogSearch" json:"BlogSearch"`
+ GlobalMap GlobalMapConfig `yaml:"GlobalMap" json:"GlobalMap"`
+ HomePage HomePageConfig `yaml:"HomePage" json:"HomePage"`
+ Metadata MetadataConfig `yaml:"Metadata" json:"Metadata"`
+ Mail MailConfig `yaml:"Mail" json:"Mail"`
+ UserProfile UserProfileConfig `yaml:"UserProfile" json:"UserProfile"`
}
type BlogSearchConfig struct {
@@ -49,6 +51,43 @@ type MetadataConfig struct {
Published string `yaml:"Published" json:"Published"`
}
+type MailConfig struct {
+ VerifyEmail VerifyEmailConfig `yaml:"VerifyEmail" json:"VerifyEmail"`
+ NewPost NewPostConfig `yaml:"NewPost" json:"NewPost"`
+}
+
+type VerifyEmailConfig struct {
+ Subject string `yaml:"Subject" json:"Subject"`
+ Welcome string `yaml:"Welcome" json:"Welcome"`
+ Intro string `yaml:"Intro" json:"Intro"`
+ GotoLink string `yaml:"GotoLink" json:"GotoLink"`
+ InputCode string `yaml:"InputCode" json:"InputCode"`
+ IfRandom string `yaml:"IfRandom" json:"IfRandom"`
+}
+
+type NewPostConfig struct {
+ Subject string `yaml:"Subject" json:"Subject"`
+}
+
+type UserProfileConfig struct {
+ Header string `yaml:"Header" json:"Header"`
+ EmailHeader string `yaml:"EmailHeader" json:"EmailHeader"`
+ VerificationCodeHeader string `yaml:"VerificationCodeHeader" json:"VerificationCodeHeader"`
+ TypeEmail string `yaml:"TypeEmail" json:"TypeEmail"`
+ SendCodeButton string `yaml:"SendCodeButton" json:"SendCodeButton"`
+ VerifyButton string `yaml:"VerifyButton" json:"VerifyButton"`
+ VerificationCodeSent string `yaml:"VerificationCodeSent" json:"VerificationCodeSent"`
+ DelayTilVerification string `yaml:"DelayTilVerification" json:"DelayTilVerification"`
+ FailedEmailRender string `yaml:"FailedEmailRender" json:"FailedEmailRender"`
+ VerificationCodeSendingError string `yaml:"VerificationCodeSendingError" json:"VerificationCodeSendingError"`
+ EmailAlreadyValidated string `yaml:"EmailAlreadyValidated" json:"EmailAlreadyValidated"`
+ EmailTaken string `yaml:"EmailTaken" json:"EmailTaken"`
+ EmailEmpty string `yaml:"EmailEmpty" json:"EmailEmpty"`
+ VerificationSuccess string `yaml:"VerificationSuccess" json:"VerificationSuccess"`
+ VerificationFailed string `yaml:"VerificationFailed" json:"VerificationFailed"`
+ VerificationEmpty string `yaml:"VerificationEmpty" json:"VerificationEmpty"`
+}
+
func LoadConfig(path string, config *LocaleConfig) error {
fileBytes, err := os.ReadFile(path)
if err != nil {
diff --git a/locale/localization.ru.yaml b/locale/localization.ru.yaml
index a1a9a6c..fe6d55f 100644
--- a/locale/localization.ru.yaml
+++ b/locale/localization.ru.yaml
@@ -25,3 +25,30 @@ HomePage:
Metadata:
Published: 'Опубликовано'
Action: 'Время действия'
+Mail:
+ VerifyEmail:
+ Subject: 'Ссылка для верификации для подтверждения вашей почты SAYA.TODAY'
+ Welcome: 'Приветствую!'
+ Intro: 'Есть 2 способа, чтобы подтвердить свою электронную почту:'
+ GotoLink: 'Перейти по этой ссылке:'
+ InputCode: 'Либо ввести этот код на странице подписок:'
+ IfRandom: 'Если ты не понимаешь, что это за спам, можешь проигнорировать это письмо, а ещё, если интересно, можешь посетить мой сайт :)'
+ NewPost:
+ Subject: 'Новый пост на SAYA.TODAY!'
+UserProfile:
+ Header: 'Личные настройки'
+ EmailHeader: 'E-Mail'
+ VerificationCodeHeader: 'Код верификации'
+ TypeEmail: 'Пожалуйста, введите свою почту'
+ SendCodeButton: 'Отправить код'
+ VerifyButton: 'Верифицировать'
+ VerificationCodeSent: 'Выслали вам код верификации! Проверьте свою почту. Следующая попытка верификации будет возможна {}.'
+ DelayTilVerification: 'Вы уже запрашивали недавно верификацию! Дождитесь {} для новой попытки.'
+ FailedEmailRender: 'Неудачная попытка создать электронное письмо, более подробно спрашивайте у администратора.'
+ VerificationCodeSendingError: 'Неудачная попытка прислать код для верификации, более подробно спрашивайте у администратора.'
+ EmailAlreadyValidated: 'Эту почту вы уже подтверждали.'
+ EmailTaken: 'Эта почта уже занята.'
+ EmailEmpty: 'Почта не введена.'
+ VerificationSuccess: 'Поздравляем! Теперь по этой почте можно подписаться на блог.'
+ VerificationFailed: 'Код для верификации невалиден, при вопросах, пожалуйста, обращайтесь к администратору.'
+ VerificationEmpty: 'Код для верификации не введён.'