template

package
v0.0.0-...-b3f3fbb Latest Latest
Warning

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

Go to latest
Published: Jan 2, 2015 License: Apache-2.0 Imports: 4 Imported by: 3

Documentation

Overview

Package template provides utilities to handle templates

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrTemplateNotFound    = errors.New("template not found")
	ErrInvalidTemplateFile = errors.New("invalid template file")
)

Functions

func NormalizeLocale

func NormalizeLocale(l string) string

NormalizeLocale defensively tries to normalize the locale

it does not necessarily return a valid locale. in this case the default locale will be used anyways

func TemplateFileName

func TemplateFileName(tmplDir, locale, defaultLocale, baseName string) (string, error)

TemplateFileName returns the template file name to use for the given parameters

It looks in the tmplDir directory like so:

tmplDir/locale/baseName

If the file does not exist, it will try

tmplDir/defaultLocale/baseName

If the default does not exist, it will fail.

Types

This section is empty.

Jump to

Keyboard shortcuts

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