goloc

package module
v0.0.0-...-596572c Latest Latest
Warning

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

Go to latest
Published: Mar 28, 2021 License: GPL-3.0 Imports: 21 Imported by: 0

README

goloc

Simple string extraction tool for translation purposes

Documentation

Index

Constants

This section is empty.

Variables

View Source
var DefaultLang = "en-GB"

Functions

func Add

func Add(text string) string

func Addf

func Addf(text string, format ...interface{}) string

func IsLangSupported

func IsLangSupported(s string) bool

func Languages

func Languages() (ss []string)

func Load

func Load(moduleToLoad string)

func LoadAll

func LoadAll(defLang string)

func LoadLangAll

func LoadLangAll(lang string)

func LoadLangModule

func LoadLangModule(lang string, moduleName string)

func Trnl

func Trnl(lang string, trnlVal string) string

func Trnlf

func Trnlf(lang string, trnlVal string, dataMap map[string]string) string

Types

type Locer

type Locer struct {
	DefaultLang string
	Funcs       []string
	Fmtfuncs    []string
	Checked     map[string]struct{}
	OrderedVals []string
	Fset        *token.FileSet
	Apply       bool
}

func (*Locer) Check

func (l *Locer) Check(lang string) error

func (*Locer) CheckAll

func (l *Locer) CheckAll() error

func (*Locer) Create

func (l *Locer) Create(args []string, lang language.Tag)

func (*Locer) Fix

func (l *Locer) Fix(node *ast.File)

todo: ensure import works as expected

func (*Locer) Handle

func (l *Locer) Handle(args []string, hdnl func(*ast.File)) error

func (*Locer) Inspect

func (l *Locer) Inspect(node *ast.File)

TODO: remove dup code with the fix() method

type Translation

type Translation struct {
	XMLName xml.Name `xml:"translation"`
	Rows    []Value
	Counter int
}

type Value

type Value struct {
	Id      int    `xml:"id,attr"`
	Name    string `xml:"name,attr"`
	Value   string `xml:"value"`
	Comment string `xml:",comment"`
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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