Documentation
¶
Index ¶
Constants ¶
View Source
const (
DEFAULT_LANGUAGE = "en"
)
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Catalog ¶
type Catalog struct { Header textproto.MIMEHeader // contains filtered or unexported fields }
Catalog stores translations.
type Collection ¶
type Collection struct {
// contains filtered or unexported fields
}
func NewCollection ¶
func NewCollection() *Collection
func (*Collection) Get ¶
func (c *Collection) Get(langCode string) *Catalog
func (*Collection) LoadDirectory ¶
func (c *Collection) LoadDirectory(path string) error
func (*Collection) SetDefaultLanguage ¶
func (c *Collection) SetDefaultLanguage(langCode string)
type Iterator ¶
type Iterator interface { // Size returns the amount of messages provided by the iterator. Size() int // Next returns the next message. At the end of the iteration, // io.EOF is returned as the error. Next() (*Message, error) }
Iterator iterates over gettext messages.
func ReadMo ¶
func ReadMo(r io.ReadSeeker) Iterator
ReadMo reads a MO file from r and returns a messages iterator.
type Message ¶
type Message struct { Ctxt []byte // msgctxt: message context, if any Id []byte // msgid: untranslated singular string IdPlural []byte // msgid_plural: untranslated plural string Str []byte // msgstr: translated singular string StrPlural [][]byte // msgstr[n]: translated plural strings Meta *MessageMeta // message comments from PO file }
Message stores a gettext message.
Click to show internal directories.
Click to hide internal directories.