Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var ( ErrInvalidMagic = errors.New("gettext: magic has failed") ErrTruncated = errors.New("gettext: truncated") )
View Source
var ( // NullCatalog has no translations so can be used as a fallback NullCatalog = &Catalog{ Header: make(map[string][]string), Strings: map[string]*Translation{}, PluralFormula: GermanicPluralFormula, } )
Functions ¶
func GermanicPluralFormula ¶
Types ¶
type Catalog ¶
type Catalog struct { Header textproto.MIMEHeader Strings map[string]*Translation // TODO: Parsed from "Plural-Forms" header (e.g. 'Plural-Forms: nplurals=2; plural=n != 1;') // See: http://www.gnu.org/savannah-checkouts/gnu/gettext/manual/html_node/Plural-forms.html // NumPlurals int PluralFormula PluralFormula }
type Domain ¶
func NewDomain ¶
Create a new Domain by parsing .mo files from path which must have subdirectories matching the GLOB path/*/LC_MESSAGES/name.mo