t

package
v0.20.0 Latest Latest
Warning

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

Go to latest
Published: Oct 15, 2024 License: Apache-2.0 Imports: 11 Imported by: 0

Documentation

Overview

templ: version: v0.2.747

Package t wraps around i18n and l10n configuration.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func L

func L(a any) templ.Component

L localizes a GOBL num.Amount, num.Percentage, cal.DateTime, or cal.Date according to the rules defined in the context.

func LC

LC localizes and amount using the formatting defined by the specified currency, ignoring any formatter defined in the context.

func LCD added in v0.6.0

func LCD(a num.Amount, cur currency.Code) templ.Component

LCD localizes and amount using the formatting defined by the specified currency, and uses the disembiguate symbol.

func LM

func LM(a num.Amount) templ.Component

LM localizes amounts using the currency and formatter defined in the context.

func Lang

func Lang(ctx context.Context) gi18n.Lang

Lang provides the current locale code from the context.

func Localize

func Localize(ctx context.Context, a any) string

Localize returns a localized string representation of the given value.

func LocalizeCurrency added in v0.11.0

func LocalizeCurrency(_ context.Context, a num.Amount, cur currency.Code, opts ...currency.FormatOption) string

LocalizeCurrency will produce a localized string representation of the given amount for the provided currency.

func LocalizeMoney added in v0.11.0

func LocalizeMoney(ctx context.Context, a num.Amount) string

LocalizeMoney will localise a monetary amount using the context's currency and formatter.

func N

func N(key string, n int, args ...any) templ.Component

N wraps around the i18n N method

func Scope

func Scope(key string) templ.Component

Scope helps set a scope around the context

func T

func T(key string, args ...any) templ.Component

T wraps around the i18n T method

Types

This section is empty.

Jump to

Keyboard shortcuts

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