Documentation ¶
Index ¶
- Variables
- func Get(ctx context.Context, original string, formatArgs ...interface{}) string
- func GetPlural(ctx context.Context, original string, originalPlural string, count int, ...) string
- func TranslateMissingWithOpenAI(apiKey string, potFile string, targetPoFilesGlob string)
- type Matcher
- type Module
- type NoTranslations
- type Pod
- type TextExtractor
- type TextMatch
- type Translations
Constants ¶
This section is empty.
Variables ¶
View Source
var ForContext func(ctx context.Context) Translations
Functions ¶
Types ¶
type Module ¶
func (*Module) FindTranslations ¶
func (d *Module) FindTranslations(locale string) Translations
type NoTranslations ¶
type NoTranslations struct {
// contains filtered or unexported fields
}
func (*NoTranslations) Get ¶
func (t *NoTranslations) Get(original string, formatArgs ...interface{}) string
type Pod ¶
Pod contains a string translated into multiple languages. It's ment to be serialized and stored on entities in databases, such as on "product description" or "title" columns.
func ParsePod ¶
func ParsePod(msg json.RawMessage) Pod
func (Pod) JSON ¶
func (t Pod) JSON() json.RawMessage
type TextExtractor ¶
type TextExtractor struct {
// contains filtered or unexported fields
}
func NewTextExtractor ¶
func NewTextExtractor(basepath string) *TextExtractor
func (*TextExtractor) Exclude ¶
func (e *TextExtractor) Exclude(pathGlob string)
func (*TextExtractor) ExtractTo ¶
func (e *TextExtractor) ExtractTo(outputFile string, printStatus bool) error
func (*TextExtractor) ExtractToP ¶
func (e *TextExtractor) ExtractToP(outputFile string, printStatus bool)
func (*TextExtractor) Include ¶
func (e *TextExtractor) Include(pathGlob string)
func (*TextExtractor) Match ¶
func (e *TextExtractor) Match(matcher Matcher)
type Translations ¶
type Translations interface { Get(original string, formatArgs ...interface{}) string GetPlural(original string, originalPlural string, count int, formatArgs ...interface{}) string }
func ReadPoFile ¶
func ReadPoFile(filepath string, lazyLoad bool) (Translations, error)
Click to show internal directories.
Click to hide internal directories.