hugo: github.com/spf13/hugo/tpl/lang Index | Files

package lang

import "github.com/spf13/hugo/tpl/lang"

Index

Package Files

init.go lang.go

type Namespace Uses

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

Namespace provides template functions for the "lang" namespace.

func New Uses

func New(deps *deps.Deps) *Namespace

New returns a new instance of the lang-namespaced template functions.

func (*Namespace) NumFmt Uses

func (ns *Namespace) NumFmt(precision, number interface{}, options ...interface{}) (string, error)

NumFmt formats a number with the given precision using the negative, decimal, and grouping options. The `options` parameter is a string consisting of `<negative> <decimal> <grouping>`. The default `options` value is `- . ,`.

Note that numbers are rounded up at 5 or greater. So, with precision set to 0, 1.5 becomes `2`, and 1.4 becomes `1`.

func (*Namespace) Translate Uses

func (ns *Namespace) Translate(id interface{}, args ...interface{}) (string, error)

Translate ...

Package lang imports 7 packages (graph) and is imported by 1 packages. Updated 2017-05-22. Refresh now. Tools for package owners.