diff options
| author | 2025-10-25 23:25:31 +0700 | |
|---|---|---|
| committer | 2025-10-25 23:25:31 +0700 | |
| commit | dd69b45d3a41be2b5c38892c3b107770a0f859f2 (patch) | |
| tree | d2b6ed2bd645eef448f987e57b97ff918909ea48 /locale/localization.go | |
| parent | 69b868a7655a25c82ce4a2bd444812be69c8b998 (diff) | |
| parent | 629e275e5270ed146f9cd6dba25383cf80022909 (diff) | |
| download | web-0.11.0.tar.gz web-0.11.0.zip | |
v0.11.0 (#17)v0.11.0
- [feat: send new blog posts to
subscribers](https://github.com/SayaAndy/saya-today-web/commit/adcd8cf82f7ec4027701643c545b1f27a7cfc221)
- [feat: email
linking](https://github.com/SayaAndy/saya-today-web/commit/0d261d2f7d080b610f50102576073e334a89e8cb)
- [feat: subscription
settings](https://github.com/SayaAndy/saya-today-web/commit/4b2da2abbc7376ce0de71a00b18b7091b00dbcd1)
- [feat: allow to unsubscribe from an
email](https://github.com/SayaAndy/saya-today-web/commit/df7a0ae1c0fc177cba2eae8cc73fe21d2afdd229)
Diffstat (limited to 'locale/localization.go')
| -rw-r--r-- | locale/localization.go | 72 |
1 files changed, 67 insertions, 5 deletions
diff --git a/locale/localization.go b/locale/localization.go index 7dbb554..c6467c4 100644 --- a/locale/localization.go +++ b/locale/localization.go @@ -8,11 +8,14 @@ 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"` + UnsubscribePage UnsubscribePageConfig `yaml:"UnsubscribePage" json:"UnsubscribePage"` + Metadata MetadataConfig `yaml:"Metadata" json:"Metadata"` + Mail MailConfig `yaml:"Mail" json:"Mail"` + UserProfile UserProfileConfig `yaml:"UserProfile" json:"UserProfile"` } type BlogSearchConfig struct { @@ -44,11 +47,70 @@ type HomePageConfig struct { Hymn4 string `yaml:"Hymn4" json:"Hymn4"` } +type UnsubscribePageConfig struct { + Header string `yaml:"Header" json:"Header"` + UnsetCode string `yaml:"UnsetCode" json:"UnsetCode"` + InvalidCode string `yaml:"InvalidCode" json:"InvalidCode"` + OnServerError string `yaml:"OnServerError" json:"OnServerError"` + Success string `yaml:"Success" json:"Success"` +} + type MetadataConfig struct { Action string `yaml:"Action" json:"Action"` Published string `yaml:"Published" json:"Published"` } +type MailConfig struct { + UnsubscribeFooter string `yaml:"UnsubscribeFooter" json:"UnsubscribeFooter"` + 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"` + CapturedOn string `yaml:"CapturedOn" json:"CapturedOn"` + Intro string `yaml:"Intro" json:"Intro"` +} + +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"` + SubscriptionHeader string `yaml:"SubscriptionHeader" json:"SubscriptionHeader"` + TagsNone string `yaml:"TagsNone" json:"TagsNone"` + TagsAll string `yaml:"TagsAll" json:"TagsAll"` + TagsSpecific string `yaml:"TagsSpecific" json:"TagsSpecific"` + TagDoesNotExist string `yaml:"TagDoesNotExist" json:"TagDoesNotExist"` + TagAlreadyAdded string `yaml:"TagAlreadyAdded" json:"TagAlreadyAdded"` + SaveButton string `yaml:"SaveButton" json:"SaveButton"` + SubscribeInvalidType string `yaml:"SubscribeInvalidType" json:"SubscribeInvalidType"` + FailedToSubscribe string `yaml:"FailedToSubscribe" json:"FailedToSubscribe"` + SubscribedSuccessfully string `yaml:"SubscribedSuccessfully" json:"SubscribedSuccessfully"` + RefreshPage string `yaml:"RefreshPage" json:"RefreshPage"` +} + func LoadConfig(path string, config *LocaleConfig) error { fileBytes, err := os.ReadFile(path) if err != nil { |