Documentation ¶
Index ¶
- Constants
- func CollectFromMap(dat map[string]interface{}) map[string]struct{}
- func CollectFromTempl(file_content string) map[string]struct{}
- func ExtractLocName(s string) string
- func IsLocString(s string) bool
- func Load(opt_i interface{}, root string, file []byte, ...) ([]byte, error)
- func LoadLocStrings(dat map[string]interface{}, user_langs []string, root, tplpath string, ...) (map[string]interface{}, error)
- func LoadLocTempl(file_content string, user_langs []string, root, tplpath string, ...) (map[string]interface{}, error)
- func ReadFiles(root, tplpath string, user_langs []string, locfiles map[string]struct{}, ...) (map[string]interface{}, error)
Constants ¶
View Source
const Min_loc_len = 8 // $loc.a.b
Decides if a string should be localized.
Variables ¶
This section is empty.
Functions ¶
func CollectFromMap ¶
func CollectFromTempl ¶
Extracts used multilingual variables from a template with regexp.
func ExtractLocName ¶
Extracts the name of the localization file from the given loc string.
func IsLocString ¶
func Load ¶
func Load(opt_i interface{}, root string, file []byte, get func(string, string) ([]byte, error)) ([]byte, error)
Searches all {{load modname/filename.ext}} and replaces that with the proper requires then calls the require module on the file.
func LoadLocStrings ¶
func LoadLocStrings(dat map[string]interface{}, user_langs []string, root, tplpath string, loc_reader func(s string) (map[string]interface{}, error)) (map[string]interface{}, error)
tplpath is public/default or private/127.0.0.1/default
func LoadLocTempl ¶
func LoadLocTempl(file_content string, user_langs []string, root, tplpath string, loc_reader func(s string) (map[string]interface{}, error)) (map[string]interface{}, error)
tplpath is public/default or private/127.0.0.1/default
func ReadFiles ¶
func ReadFiles(root, tplpath string, user_langs []string, locfiles map[string]struct{}, loc_reader func(s string) (map[string]interface{}, error)) (map[string]interface{}, error)
Takes a list of localization filenames and tries to load every one of them, first from the template, then from the modules.
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.