• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

Golang i18n.Locale类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了Golang中github.com/beego/i18n.Locale的典型用法代码示例。如果您正苦于以下问题:Golang Locale类的具体用法?Golang Locale怎么用?Golang Locale使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。



在下文中一共展示了Locale类的8个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Golang代码示例。

示例1: SendRegisterMail

// Send user register mail with active code
func SendRegisterMail(locale i18n.Locale, user *User) {
	code := CreateUserActiveCode(user, nil)

	subject := locale.Tr("Verify you email address.")
	body := locale.Tr("code: %s", code)

	msg := NewMailMessage([]string{user.Email}, subject, body)
	msg.Info = fmt.Sprintf("UID: %d, send register mail", user.Id)

	// async send mail
	mailer.SendAsync(msg)
}
开发者ID:sirithink,项目名称:beebbs,代码行数:13,代码来源:auth_mail.go


示例2: SendActiveMail

// Send email verify active email.
func SendActiveMail(locale i18n.Locale, user *User) {
	code := CreateUserActiveCode(user, nil)

	subject := locale.Tr("mail.verify_your_email_subject")
	body := locale.Tr("code: %s", code)

	msg := NewMailMessage([]string{user.Email}, subject, body)
	msg.Info = fmt.Sprintf("UID: %d, send email verify mail", user.Id)

	// async send mail
	mailer.SendAsync(msg)
}
开发者ID:thuongdinh,项目名称:beegowebapp,代码行数:13,代码来源:user_mail.go


示例3: SendResetPwdMail

// Send user reset password mail with verify code
func SendResetPwdMail(locale i18n.Locale, user *User) {
	code := CreateUserResetPwdCode(user, nil)

	subject := locale.Tr("mail.reset_passowrd_subject")
	body := locale.Tr("code: %s", code)

	msg := NewMailMessage([]string{user.Email}, subject, body)
	msg.Info = fmt.Sprintf("UID: %d, send reset password mail", user.Id)

	// async send mail
	mailer.SendAsync(msg)
}
开发者ID:thuongdinh,项目名称:beegowebapp,代码行数:13,代码来源:user_mail.go


示例4: SendActiveMail

// Send email verify active email.
func SendActiveMail(locale i18n.Locale, user *models.User) {
	code := CreateUserActiveCode(user, nil)

	subject := locale.Tr("mail.verify_your_email_subject")

	data := mailer.GetMailTmplData(locale.Lang, user)
	data["Code"] = code
	body := utils.RenderTemplate("mail/auth/active_email.html", data)

	msg := mailer.NewMailMessage([]string{user.Email}, subject, body)
	msg.Info = fmt.Sprintf("UID: %d, send email verify mail", user.Id)

	// async send mail
	mailer.SendAsync(msg)
}
开发者ID:JessonChan,项目名称:wetalk,代码行数:16,代码来源:mail.go


示例5: SendResetPwdMail

// Send user reset password mail with verify code
func SendResetPwdMail(locale i18n.Locale, user *models.User) {
	code := CreateUserResetPwdCode(user, nil)

	subject := locale.Tr("mail.reset_password_subject")

	data := mailer.GetMailTmplData(locale.Lang, user)
	data["Code"] = code
	body := utils.RenderTemplate("mail/auth/reset_password.html", data)

	msg := mailer.NewMailMessage([]string{user.Email}, subject, body)
	msg.Info = fmt.Sprintf("UID: %d, send reset password mail", user.Id)

	// async send mail
	mailer.SendAsync(msg)
}
开发者ID:JessonChan,项目名称:wetalk,代码行数:16,代码来源:mail.go


示例6: SendRegisterMail

// Send user register mail with active code
func SendRegisterMail(locale i18n.Locale, user *User) {
	code := CreateUserActiveCode(user, nil)

	subject := locale.Tr("mail.register_success_subject")

	data := GetMailTmplData(locale.Lang, user)
	data["Code"] = code
	body := utils.RenderTemplate("mail/auth/register_success.html", data)

	msg := NewMailMessage([]string{user.Email}, subject, body)
	msg.Info = fmt.Sprintf("UID: %d, send register mail", user.Id)

	// async send mail
	mailer.SendAsync(msg)
}
开发者ID:supermouseno1,项目名称:wetalk,代码行数:16,代码来源:mail_auth.go


示例7: SendActiveMail

//SendActiveMail sends email verify active email.
func SendActiveMail(locale i18n.Locale, u *user.User) {
	serv := &userServ.UserService{}
	code := serv.CreateUserActiveCode(u, nil)

	subject := locale.Tr("mail.verify_your_email_subject")

	data := GetMailTmplData(locale.Lang, u)
	data["Code"] = code
	body := utils.RenderTemplate("mail/auth/active_email.html", data)

	msg := NewMailMessage([]string{u.Email}, subject, body)
	msg.Info = fmt.Sprintf("UID: %d, send email verify mail", u.Id)

	// async send mail
	SendAsync(msg)
}
开发者ID:thanzen,项目名称:identity,代码行数:17,代码来源:usermailer.go


示例8: SendResetPwdMail

// SendResetPwdMail sends user reset password mail with verify code
func SendResetPwdMail(locale i18n.Locale, u *user.User) {
	serv := &userServ.UserService{}
	code := serv.CreateUserResetPwdCode(u, nil)

	subject := locale.Tr("mail.reset_password_subject")

	data := GetMailTmplData(locale.Lang, u)
	data["Code"] = code
	body := utils.RenderTemplate("mail/auth/reset_password.html", data)

	msg := NewMailMessage([]string{u.Email}, subject, body)
	msg.Info = fmt.Sprintf("UID: %d, send reset password mail", u.Id)

	// async send mail
	SendAsync(msg)
}
开发者ID:thanzen,项目名称:identity,代码行数:17,代码来源:usermailer.go



注:本文中的github.com/beego/i18n.Locale类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
Golang redis.Bool函数代码示例发布时间:2022-05-24
下一篇:
Golang i18n.Tr函数代码示例发布时间:2022-05-24
热门推荐
热门话题
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap