parser

package
v0.0.0-...-46f419f Latest Latest
Warning

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

Go to latest
Published: Jul 28, 2024 License: BSD-3-Clause, MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Domain

type Domain struct {
	Translations        TranslationMap
	ContextTranslations map[string]TranslationMap
}

Domain holds all translations of one domain

func (*Domain) AddTranslation

func (d *Domain) AddTranslation(translation *Translation)

AddTranslation to the domain

func (*Domain) Dump

func (d *Domain) Dump(locations bool) string

Dump the domain as string

func (*Domain) Save

func (d *Domain) Save(path string, locations bool) error

Save domain to file

type DomainMap

type DomainMap struct {
	Domains map[string]*Domain
	Default string
}

DomainMap contains multiple domains as map with name as key

func (*DomainMap) AddTranslation

func (m *DomainMap) AddTranslation(domain string, translation *Translation)

AddTranslation to domain map

func (*DomainMap) Save

func (m *DomainMap) Save(directory string, locations bool) error

Save domains to directory

type Translation

type Translation struct {
	MsgId           string
	MsgIdPlural     string
	Context         string
	SourceLocations []string
}

Translation for a text to translate

func (*Translation) AddLocations

func (t *Translation) AddLocations(locations []string)

AddLocations to translation

func (*Translation) Dump

func (t *Translation) Dump(locations bool) string

Dump translation as string

type TranslationMap

type TranslationMap map[string]*Translation

TranslationMap contains a map of translations with the ID as key

func (TranslationMap) Dump

func (m TranslationMap) Dump(locations bool) string

Dump the translation map as string

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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