fix function name in comment (#1374)
Signed-off-by: cui fliter <imcusg@gmail.com>
This commit is contained in:
parent
92a4d9911e
commit
f94c1f34b6
4 changed files with 8 additions and 7 deletions
|
@ -237,7 +237,7 @@ func handleSubscriptionPage(c echo.Context) error {
|
||||||
return c.Render(http.StatusOK, "subscription", out)
|
return c.Render(http.StatusOK, "subscription", out)
|
||||||
}
|
}
|
||||||
|
|
||||||
// handleSubscriptionPage renders the subscription management page and
|
// handleSubscriptionPrefs renders the subscription management page and
|
||||||
// handles unsubscriptions. This is the view that {{ UnsubscribeURL }} in
|
// handles unsubscriptions. This is the view that {{ UnsubscribeURL }} in
|
||||||
// campaigns link to.
|
// campaigns link to.
|
||||||
func handleSubscriptionPrefs(c echo.Context) error {
|
func handleSubscriptionPrefs(c echo.Context) error {
|
||||||
|
@ -466,7 +466,7 @@ func handleSubscriptionForm(c echo.Context) error {
|
||||||
return c.Render(http.StatusOK, tplMessage, makeMsgTpl(app.i18n.T("public.subTitle"), "", app.i18n.Ts(msg)))
|
return c.Render(http.StatusOK, tplMessage, makeMsgTpl(app.i18n.T("public.subTitle"), "", app.i18n.Ts(msg)))
|
||||||
}
|
}
|
||||||
|
|
||||||
// handleSubscriptionForm handles subscription requests coming from public
|
// handlePublicSubscription handles subscription requests coming from public
|
||||||
// API calls.
|
// API calls.
|
||||||
func handlePublicSubscription(c echo.Context) error {
|
func handlePublicSubscription(c echo.Context) error {
|
||||||
hasOptin, err := processSubForm(c)
|
hasOptin, err := processSubForm(c)
|
||||||
|
|
|
@ -259,7 +259,7 @@ func handleUpdateSubscriber(c echo.Context) error {
|
||||||
return c.JSON(http.StatusOK, okResp{out})
|
return c.JSON(http.StatusOK, okResp{out})
|
||||||
}
|
}
|
||||||
|
|
||||||
// handleGetSubscriberSendOptin sends an optin confirmation e-mail to a subscriber.
|
// handleSubscriberSendOptin sends an optin confirmation e-mail to a subscriber.
|
||||||
func handleSubscriberSendOptin(c echo.Context) error {
|
func handleSubscriberSendOptin(c echo.Context) error {
|
||||||
var (
|
var (
|
||||||
app = c.Get("app").(*App)
|
app = c.Get("app").(*App)
|
||||||
|
|
|
@ -144,7 +144,7 @@ func getLastMigrationVersion() (string, error) {
|
||||||
return v, nil
|
return v, nil
|
||||||
}
|
}
|
||||||
|
|
||||||
// isPqNoTableErr checks if the given error represents a Postgres/pq
|
// isTableNotExistErr checks if the given error represents a Postgres/pq
|
||||||
// "table does not exist" error.
|
// "table does not exist" error.
|
||||||
func isTableNotExistErr(err error) bool {
|
func isTableNotExistErr(err error) bool {
|
||||||
if p, ok := err.(*pq.Error); ok {
|
if p, ok := err.(*pq.Error); ok {
|
||||||
|
|
|
@ -90,8 +90,9 @@ func (i *I18n) T(key string) string {
|
||||||
// The params and values are received as a pairs of succeeding strings.
|
// The params and values are received as a pairs of succeeding strings.
|
||||||
// That is, the number of these arguments should be an even number.
|
// That is, the number of these arguments should be an even number.
|
||||||
// eg: Ts("globals.message.notFound",
|
// eg: Ts("globals.message.notFound",
|
||||||
// "name", "campaigns",
|
//
|
||||||
// "error", err)
|
// "name", "campaigns",
|
||||||
|
// "error", err)
|
||||||
func (i *I18n) Ts(key string, params ...string) string {
|
func (i *I18n) Ts(key string, params ...string) string {
|
||||||
if len(params)%2 != 0 {
|
if len(params)%2 != 0 {
|
||||||
return key + `: Invalid arguments`
|
return key + `: Invalid arguments`
|
||||||
|
@ -139,7 +140,7 @@ func (i *I18n) getSingular(s string) string {
|
||||||
return strings.TrimSpace(strings.Split(s, "|")[0])
|
return strings.TrimSpace(strings.Split(s, "|")[0])
|
||||||
}
|
}
|
||||||
|
|
||||||
// getSingular returns the plural term from the vuei18n pipe separated value.
|
// getPlural returns the plural term from the vuei18n pipe separated value.
|
||||||
// singular term | plural term
|
// singular term | plural term
|
||||||
func (i *I18n) getPlural(s string) string {
|
func (i *I18n) getPlural(s string) string {
|
||||||
if !strings.Contains(s, "|") {
|
if !strings.Contains(s, "|") {
|
||||||
|
|
Loading…
Reference in a new issue