mirror of
https://github.com/ChuckNorrison/LightningTipBot.git
synced 2026-08-13 12:33:14 +02:00
* lnurl comments for RECEIVING * fix import cycle * fix import * rename WebhookServer to Server * rename LNURLInvoice to Invoice * add str package. MarkdownEscape lnurl.Invoice comment * add str package * check for comment length * lnurl pay with comment * lnurl pay with comment * check for wallet existence * repackage main to internal Co-authored-by: lngohumble <lngohumble@gmail.com>
24 lines
618 B
Go
24 lines
618 B
Go
package telegram
|
|
|
|
import (
|
|
"context"
|
|
|
|
"github.com/nicksnyder/go-i18n/v2/i18n"
|
|
log "github.com/sirupsen/logrus"
|
|
)
|
|
|
|
func Translate(ctx context.Context, MessgeID string) string {
|
|
str, err := LoadPublicLocalizer(ctx).Localize(&i18n.LocalizeConfig{MessageID: MessgeID})
|
|
if err != nil {
|
|
log.Warnf("Error translating message %s: %s", MessgeID, err)
|
|
}
|
|
return str
|
|
}
|
|
|
|
func TranslateUser(ctx context.Context, MessgeID string) string {
|
|
str, err := LoadUserLocalizer(ctx).Localize(&i18n.LocalizeConfig{MessageID: MessgeID})
|
|
if err != nil {
|
|
log.Warnf("Error translating message %s: %s", MessgeID, err)
|
|
}
|
|
return str
|
|
}
|