Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Message ¶
type Message struct { // ID uniquely identifies the message. ID string // Hash uniquely identifies the content of the message // that this message was translated from. Hash string // Description describes the message to give additional // context to translators that may be relevant for translation. Description string // LeftDelim is the left Go template delimiter. LeftDelim string // RightDelim is the right Go template delimiter.“ RightDelim string // Zero is the content of the message for the CLDR plural form "zero". Zero string // One is the content of the message for the CLDR plural form "one". One string // Two is the content of the message for the CLDR plural form "two". Two string // Few is the content of the message for the CLDR plural form "few". Few string // Many is the content of the message for the CLDR plural form "many". Many string // Other is the content of the message for the CLDR plural form "other". Other string }
Message is a string that can be localized.
func MustNewMessage ¶
func MustNewMessage(data interface{}) *Message
MustNewMessage is similar to NewMessage except it panics if an error happens.
func NewMessage ¶
NewMessage parses data and returns a new message.
type MessageFile ¶
MessageFile represents a parsed message file.
func ParseMessageFileBytes ¶
func ParseMessageFileBytes(buf []byte, path string, unmarshalFuncs map[string]UnmarshalFunc) (*MessageFile, error)
ParseMessageFileBytes returns the messages parsed from file.
type MessageTemplate ¶
MessageTemplate is an executable template for a message.
func NewMessageTemplate ¶
func NewMessageTemplate(m *Message) *MessageTemplate
NewMessageTemplate returns a new message template.
type Template ¶
type Template struct { Src string Template *gotemplate.Template ParseErr *error }
Template stores the template for a string.
type UnmarshalFunc ¶
UnmarshalFunc unmarshals data into v.
Directories ¶
Path | Synopsis |
---|---|
Package plural provides support for pluralizing messages according to CLDR rules http://cldr.unicode.org/index/cldr-spec/plural-rules
|
Package plural provides support for pluralizing messages according to CLDR rules http://cldr.unicode.org/index/cldr-spec/plural-rules |
Click to show internal directories.
Click to hide internal directories.