relay/internal/language/text_c.go
2022-08-27 21:02:45 -07:00

112 lines
2.6 KiB
Go

package language
import "github.com/nicksnyder/go-i18n/v2/i18n"
// TextChatID returns a translated phrase.
func (l *Localizer) TextChatID() *LocalizedString {
text, tag, err := l.localizer.LocalizeWithTag(&i18n.LocalizeConfig{
DefaultMessage: &i18n.Message{
ID: "ChatID",
Other: "Chat ID",
},
})
if err != nil {
logger.WithField("func", "TextChatID").Warningf(missingTranslationWarning, err.Error())
}
return &LocalizedString{
language: tag,
string: text,
}
}
// TextClose returns a translated phrase.
func (l *Localizer) TextClose() *LocalizedString {
text, tag, err := l.localizer.LocalizeWithTag(&i18n.LocalizeConfig{
DefaultMessage: &i18n.Message{
ID: "Close",
Other: "Close",
},
})
if err != nil {
logger.WithField("func", "TextClose").Warningf(missingTranslationWarning, err.Error())
}
return &LocalizedString{
language: tag,
string: text,
}
}
// TextConfiguration returns a translated phrase.
func (l *Localizer) TextConfiguration() *LocalizedString {
text, tag, err := l.localizer.LocalizeWithTag(&i18n.LocalizeConfig{
DefaultMessage: &i18n.Message{
ID: "Configuration",
Other: "Configuration",
},
})
if err != nil {
logger.WithField("func", "TextConfiguration").Warningf(missingTranslationWarning, err.Error())
}
return &LocalizedString{
language: tag,
string: text,
}
}
// TextContact returns a translated phrase.
func (l *Localizer) TextContact() *LocalizedString {
text, tag, err := l.localizer.LocalizeWithTag(&i18n.LocalizeConfig{
DefaultMessage: &i18n.Message{
ID: "Contact",
Other: "Contact",
},
})
if err != nil {
logger.WithField("func", "TextContact").Warningf(missingTranslationWarning, err.Error())
}
return &LocalizedString{
language: tag,
string: text,
}
}
// TextContactFor returns a translated phrase.
func (l *Localizer) TextContactFor() *LocalizedString {
text, tag, err := l.localizer.LocalizeWithTag(&i18n.LocalizeConfig{
DefaultMessage: &i18n.Message{
ID: "ContactFor",
Other: "Contact For",
},
})
if err != nil {
logger.WithField("func", "TextContactFor").Warningf(missingTranslationWarning, err.Error())
}
return &LocalizedString{
language: tag,
string: text,
}
}
// TextCreate returns a translated phrase.
func (l *Localizer) TextCreate() *LocalizedString {
text, tag, err := l.localizer.LocalizeWithTag(&i18n.LocalizeConfig{
DefaultMessage: &i18n.Message{
ID: "Create",
Other: "Create",
},
})
if err != nil {
logger.WithField("func", "TextCreate").Warningf(missingTranslationWarning, err.Error())
}
return &LocalizedString{
language: tag,
string: text,
}
}