templatestrings

package module
v0.0.0-...-c012e3b Latest Latest
Warning

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

Go to latest
Published: Feb 11, 2022 License: MIT Imports: 5 Imported by: 1

README

template-strings

Simple Go module to manage template translations

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type TemplateStrings

type TemplateStrings struct {
	// contains filtered or unexported fields
}

func InitTemplateStrings

func InitTemplateStrings(stringsDir string, fileExt string, defaultVariant string, otherVariants ...string) (*TemplateStrings, error)

Load the strings from the specified files into memory

func InitTemplateStringsFS

func InitTemplateStringsFS(filesystem fs.FS, stringsDir string, fileExt string, defaultVariant string, otherVariants ...string) (*TemplateStrings, error)

Load the strings from the specified files using a file system into memory

func (*TemplateStrings) GetTemplateStringVariant

func (ts *TemplateStrings) GetTemplateStringVariant(input ...string) (result string)

Get a string input: language, name or just name (uses default language)

func (*TemplateStrings) GetTemplateStringVariantFunc

func (ts *TemplateStrings) GetTemplateStringVariantFunc() func(...string) string

Get a function to use in templates

Jump to

Keyboard shortcuts

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