Documentation ¶
Index ¶
- Constants
- Variables
- type FileLoader
- type MessageSelector
- type ServiceProvider
- type Translator
- func (t *Translator) Choice(key string, number int, options ...translationcontract.Option) string
- func (t *Translator) CurrentLocale() string
- func (t *Translator) Get(key string, options ...translationcontract.Option) string
- func (t *Translator) GetFallback() string
- func (t *Translator) Has(key string, options ...translationcontract.Option) bool
- func (t *Translator) SetFallback(locale string) context.Context
- func (t *Translator) SetLocale(locale string) context.Context
Constants ¶
View Source
const Binding = "goravel.translation"
Variables ¶
View Source
var (
ErrFileNotExist = errors.New("translation file does not exist")
)
Functions ¶
This section is empty.
Types ¶
type FileLoader ¶
type FileLoader struct {
// contains filtered or unexported fields
}
func NewFileLoader ¶
func NewFileLoader(paths []string, json foundation.Json) *FileLoader
type MessageSelector ¶
type MessageSelector struct{}
func NewMessageSelector ¶
func NewMessageSelector() *MessageSelector
type ServiceProvider ¶
type ServiceProvider struct { }
func (*ServiceProvider) Boot ¶
func (translation *ServiceProvider) Boot(app foundation.Application)
func (*ServiceProvider) Register ¶
func (translation *ServiceProvider) Register(app foundation.Application)
type Translator ¶
type Translator struct {
// contains filtered or unexported fields
}
func NewTranslator ¶
func NewTranslator(ctx context.Context, loader translationcontract.Loader, locale string, fallback string, logger logcontract.Log) *Translator
func (*Translator) Choice ¶
func (t *Translator) Choice(key string, number int, options ...translationcontract.Option) string
func (*Translator) CurrentLocale ¶
func (t *Translator) CurrentLocale() string
func (*Translator) Get ¶
func (t *Translator) Get(key string, options ...translationcontract.Option) string
func (*Translator) GetFallback ¶
func (t *Translator) GetFallback() string
func (*Translator) Has ¶
func (t *Translator) Has(key string, options ...translationcontract.Option) bool
func (*Translator) SetFallback ¶
func (t *Translator) SetFallback(locale string) context.Context
Click to show internal directories.
Click to hide internal directories.