Documentation
¶
Index ¶
- Constants
- Variables
- func MsgFromGettextMessage(pluralForms cldr.PluralForms, msg Msg, meta MsgMeta) gettext.Message
- func Parse(pathPattern, bundlePkg string, locale language.Tag, ...) (collection *Collection, bundle *Bundle, stats *Statistics, srcErrs []ErrorSrc, ...)
- type Bundle
- type Collection
- type ErrorSrc
- type Msg
- type MsgMeta
- type POFile
- type Statistics
Constants ¶
View Source
const ( FuncTypeText = "Text" FuncTypeBlock = "Block" FuncTypePlural = "Plural" FuncTypePluralBlock = "PluralBlock" )
Variables ¶
View Source
var ( ErrSource = errors.New("source code contains errors") ErrSourceTextEmpty = errors.New("text empty") ErrSourceArgType = errors.New( "non-literal argument (only string literals and constants are supported)", ) ErrMissingPluralForm = errors.New("missing required plural form") ErrUnsupportedPluralForm = errors.New( "plural form not supported by source language", ) ErrMissingQuantityPlaceholder = errors.New( "missing quantity placeholder \"%d\" in template", ) ErrTooManyQuantityPlaceholders = errors.New( "plural template strings are expected to " + `have only one quantity placeholder "%d"`, ) ErrWrongQuantityArgType = errors.New( "passing wrong type to quantity argument", ) ErrWrongPlaceholderVerb = errors.New( "wrong placeholder verb, use a numeric placeholder", ) ErrUnsupportedLocale = errors.New("unsupported locale") )
View Source
var ErrSyntax = errors.New("syntax error")
Functions ¶
func MsgFromGettextMessage ¶
Types ¶
type Bundle ¶
func ParseBundle ¶
func ParseBundle(pkg *packages.Package, collection *Collection) (*Bundle, error)
type Collection ¶
type Collection struct { GeneratorVersion int Locale language.Tag // TODO: consider turning this into map[string]MsgWithMeta for faster hash lookups // such that no new map needs to be created and copied over during catalog updates. Messages map[Msg]MsgMeta }
Collection is a collection of messages gathered from the
Click to show internal directories.
Click to hide internal directories.