gostip: github.com/geobe/gostip/go/view Index | Files

package view

import "github.com/geobe/gostip/go/view"

Parse all templates once and make them globally available


Package Files

i18nutil.go parse.go viewutils.go



func AddDict Uses

func AddDict(dict map[string]interface{}, values ...interface{}) (map[string]interface{}, error)

function AddDict adds more key/value pairs to a dictionary. This helps to break long parameter lists to templates on several lines to make them better readable

func Concat Uses

func Concat(s ...interface{}) string

function Concat cocatenates the string representations of its parameters

func Dict Uses

func Dict(values ...interface{}) (map[string]interface{}, error)

Function Dict creates a map from its inputs for use in go templates thanks to stackoverflow user tux21b

func ExpandTemplate Uses

func ExpandTemplate(key, lang string, values map[string]interface{}) string

func GetTranslation Uses

func GetTranslation(key, lang string) string

func GetTranslations Uses

func GetTranslations(lang string) map[string]string

func GetTrtemplate Uses

func GetTrtemplate(key, lang string) *template.Template

func GetTrtemplates Uses

func GetTrtemplates(lang string) map[string]*template.Template

func I18n Uses

func I18n(key, lang string, values ...map[string]interface{}) string

func IsKind Uses

func IsKind(obj interface{}, kind string) bool

function IsKind tests an object obj for a given reflect.Kind

func IsMod Uses

func IsMod(val, mod int) bool

func LanguagesI18n Uses

func LanguagesI18n(lang string) map[model.Lang]string

func MergeDict Uses

func MergeDict(dict map[string]interface{}, more ...map[string]interface{}) (map[string]interface{}, error)

function MergeDict merges dictionaries for use in templates into a new dictionary

func OblastsI18n Uses

func OblastsI18n(lang string) []model.Oblast

func PreferedLanguages Uses

func PreferedLanguages(r *http.Request) []string

extract languages with q >= 0.5 from HTTP language header

func ReadTranslations Uses

func ReadTranslations(file string)

func SafeAtt Uses

func SafeAtt(s interface{}) template.HTMLAttr

function SaveAtt flags the string representation of an interface parameter as a safe html attribute

func Templates Uses

func Templates() *template.Template

func Views Uses

func Views() *template.Template

Package view imports 13 packages (graph) and is imported by 2 packages. Updated 2017-07-08. Refresh now. Tools for package owners.