ut

package module
v3.1.0 Latest Latest
Warning

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

Go to latest
Published: Apr 26, 2023 License: MIT Imports: 5 Imported by: 2

README

GoZix Universal Translator

License Documentation

Release Build Status Go Report Card Code Coverage

The bundle provide Universal translator integration to GoZix application.

Installation

go get github.com/gozix/universal-translator/v3

Documentation

You can find documentation on pkg.go.dev and read source code if needed.

Questions

If you have any questions, feel free to create an issue.

Documentation

Index

Constants

View Source
const (
	// TagConfigurator is tag to mark configurators.
	TagConfigurator = "universal-translator.configurator"

	// TagTranslator is a tag for marking locale translator without overriding existing.
	TagTranslator = "universal-translator.locale-translator"

	// TagTranslatorOverride is a tag for marking locale translator with overriding existing.
	TagTranslatorOverride = "universal-translator.locale-translator.override"
)
View Source
const BundleName = "universal-translator"

BundleName is default definition name.

Variables

This section is empty.

Functions

func AsConfigurator added in v3.1.0

func AsConfigurator() di.ProvideOption

AsConfigurator is syntax sugar for the di container.

func AsTranslator

func AsTranslator(override bool) di.Tags

Types

type Bundle

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

Bundle implements the glue.Bundle interface.

func NewBundle

func NewBundle(options ...Option) *Bundle

NewBundle create bundle instance.

func (*Bundle) Build

func (b *Bundle) Build(builder di.Builder) error

func (*Bundle) Name

func (b *Bundle) Name() string

type Configurator added in v3.1.0

type Configurator func(*ut.UniversalTranslator) error

Configurator configures universal translator after its creation.

type Option

type Option interface {
	// contains filtered or unexported methods
}

Option interface.

func Fallback

func Fallback(fallback locales.Translator) Option

Fallback option.

func Locales

func Locales(locales ...locales.Translator) Option

Locales option.

Jump to

Keyboard shortcuts

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