gtspec

package
v0.1.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jan 20, 2016 License: MIT Imports: 6 Imported by: 9

Documentation

Index

Constants

This section is empty.

Variables

View Source
var CFGFN = "POGO.toml"
View Source
var Plurals map[string]PRule

Keyed by ISO tag

Functions

func GetPluralIdx added in v0.0.4

func GetPluralIdx(locale string, ct int) (int, error)

GetPluralIdx returns the index of a plural translation, determined by locale and count

func GetPluralNum added in v0.0.4

func GetPluralNum(locale string) int

GetPluralNum returns number of singular/plural forms for given locale or 2 on failure

Types

type CommentPack

type CommentPack map[string][]string

CommentsPack groups comments keyed by classification (i.e. CommentSpec.key)

type CommentSpec

type CommentSpec struct {
	Key, Prefix string
}

Classifaction of a comment

type Config

type Config struct {
	General confGeneral
	Parsing confParsing
	Po      confPo
	Meta    confMeta
}

func LoadOptions

func LoadOptions() (Config, error)

func LoadOptionsGOPATH

func LoadOptionsGOPATH(path string) (Config, error)

type Msg

type Msg struct {
	Ctxt      string   // msgctxt: message context, if any
	Id        string   // msgid: untranslated singular string
	IdPlural  string   // msgid_plural: untranslated plural string
	Str       string   // msgstr: translated singular string
	StrPlural []string // msgstr[n]: translated plural strings
	Comments  CommentPack
	Filename  string // Name of file extracted from (to be shoved into comments)
	Line      int    // Line number within file (to be shoved into comment)
}

type PRAR

type PRAR struct{ Lang string }

PRAR is the pluralization rule for Arabic

func (PRAR) Header

func (r PRAR) Header() string

func (PRAR) Idx

func (r PRAR) Idx(n int) int

func (PRAR) Name

func (r PRAR) Name() string

type PRCS

type PRCS struct{ Lang string }

PRCS is the pluralization rule for Czech and Slovak

func (PRCS) Header

func (r PRCS) Header() string

func (PRCS) Idx

func (r PRCS) Idx(n int) int

func (PRCS) Name

func (r PRCS) Name() string

type PRCSB

type PRCSB struct{ Lang string }

PRCS is the pluralization rule for Kashubian

func (PRCSB) Header

func (r PRCSB) Header() string

func (PRCSB) Idx

func (r PRCSB) Idx(n int) int

func (PRCSB) Name

func (r PRCSB) Name() string

type PRCY

type PRCY struct{ Lang string }

PRCY is the pluralization rule for Welsh

func (PRCY) Header

func (r PRCY) Header() string

func (PRCY) Idx

func (r PRCY) Idx(n int) int

func (PRCY) Name

func (r PRCY) Name() string

type PRGA

type PRGA struct{ Lang string }

PRGA is the pluralization rule for Irish

func (PRGA) Header

func (r PRGA) Header() string

func (PRGA) Idx

func (r PRGA) Idx(n int) int

func (PRGA) Name

func (r PRGA) Name() string

type PRGD

type PRGD struct{ Lang string }

PRGD is the pluralization rule for Scottish Gaelic

func (PRGD) Header

func (r PRGD) Header() string

func (PRGD) Idx

func (r PRGD) Idx(n int) int

func (PRGD) Name

func (r PRGD) Name() string

type PRIS

type PRIS struct{ Lang string }

PRIS is the pluralization rule for Icelandic

func (PRIS) Header

func (r PRIS) Header() string

func (PRIS) Idx

func (r PRIS) Idx(n int) int

func (PRIS) Name

func (r PRIS) Name() string

type PRKW

type PRKW struct{ Lang string }

PRKW is the pluralization rule for Cornish

func (PRKW) Header

func (r PRKW) Header() string

func (PRKW) Idx

func (r PRKW) Idx(n int) int

func (PRKW) Name

func (r PRKW) Name() string

type PRLT

type PRLT struct{ Lang string }

PRLT is the pluralization rule for Lithuanian

func (PRLT) Header

func (r PRLT) Header() string

func (PRLT) Idx

func (r PRLT) Idx(n int) int

func (PRLT) Name

func (r PRLT) Name() string

type PRLV

type PRLV struct{ Lang string }

PRLV is the pluralization rule for Latvian

func (PRLV) Header

func (r PRLV) Header() string

func (PRLV) Idx

func (r PRLV) Idx(n int) int

func (PRLV) Name

func (r PRLV) Name() string

type PRMK

type PRMK struct{ Lang string }

PRMK is the pluralization rule for Macedonian

func (PRMK) Header

func (r PRMK) Header() string

func (PRMK) Idx

func (r PRMK) Idx(n int) int

func (PRMK) Name

func (r PRMK) Name() string

type PRMNK

type PRMNK struct{ Lang string }

PRMNK is the pluralization rule for Mandinka (possibly erroneous)

func (PRMNK) Header

func (r PRMNK) Header() string

func (PRMNK) Idx

func (r PRMNK) Idx(n int) int

func (PRMNK) Name

func (r PRMNK) Name() string

type PRMT

type PRMT struct{ Lang string }

PRMT is the pluralization rule for Maltese

func (PRMT) Header

func (r PRMT) Header() string

func (PRMT) Idx

func (r PRMT) Idx(n int) int

func (PRMT) Name

func (r PRMT) Name() string

type PRNG1

type PRNG1 struct{ Lang string }

PRNG1 is pluralization rule "n greater than 1"

func (PRNG1) Header

func (r PRNG1) Header() string

func (PRNG1) Idx

func (r PRNG1) Idx(n int) int

func (PRNG1) Name

func (r PRNG1) Name() string

type PRNN0

type PRNN0 struct{ Lang string }

PRNN0 is pluralization rule "n not 0"

func (PRNN0) Header

func (r PRNN0) Header() string

func (PRNN0) Idx

func (r PRNN0) Idx(n int) int

func (PRNN0) Name

func (r PRNN0) Name() string

type PRNN1

type PRNN1 struct{ Lang string }

PRNN1 is pluralization rule "n not 1"

func (PRNN1) Header

func (r PRNN1) Header() string

func (PRNN1) Idx

func (r PRNN1) Idx(n int) int

func (PRNN1) Name

func (r PRNN1) Name() string

type PRNP

type PRNP struct{ Lang string }

PRNP is pluralization rule "no plurals"

func (PRNP) Header

func (r PRNP) Header() string

func (PRNP) Idx

func (r PRNP) Idx(n int) int

func (PRNP) Name

func (r PRNP) Name() string

type PRPL

type PRPL struct{ Lang string }

PRPL is the pluralization rule for Polish

func (PRPL) Header

func (r PRPL) Header() string

func (PRPL) Idx

func (r PRPL) Idx(n int) int

func (PRPL) Name

func (r PRPL) Name() string

type PRRO

type PRRO struct{ Lang string }

PRRO is the pluralization rule for Romanian

func (PRRO) Header

func (r PRRO) Header() string

func (PRRO) Idx

func (r PRRO) Idx(n int) int

func (PRRO) Name

func (r PRRO) Name() string

type PRS1

type PRS1 struct{ Lang string }

PRS1 is pluralization rule 1 for Slavic languages (e.g. Belarusian, Bosnian, Croatian)

func (PRS1) Header

func (r PRS1) Header() string

func (PRS1) Idx

func (r PRS1) Idx(n int) int

func (PRS1) Name

func (r PRS1) Name() string

type PRSL

type PRSL struct{ Lang string }

PRSL is the pluralization rule for Slovenian

func (PRSL) Header

func (r PRSL) Header() string

func (PRSL) Idx

func (r PRSL) Idx(n int) int

func (PRSL) Name

func (r PRSL) Name() string

type PRule

type PRule interface {
	Name() string
	Idx(int) int
	Header() string
}

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL