display_model

package
v0.0.0-...-22804f9 Latest Latest
Warning

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

Go to latest
Published: Oct 20, 2012 License: BSD-2-Clause-Views Imports: 8 Imported by: 0

Documentation

Index

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 CollectFromMap(dat map[string]interface{}) map[string]struct{}

func CollectFromTempl

func CollectFromTempl(file_content string) map[string]struct{}

Extracts used multilingual variables from a template with regexp.

func ExtractLocName

func ExtractLocName(s string) string

Extracts the name of the localization file from the given loc string.

func IsLocString

func IsLocString(s string) bool

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.

Jump to

Keyboard shortcuts

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