Documentation ¶
Index ¶
- Variables
- func Prepare(resources []resource.ResourceFile, view resource.EffectiveResourceView, ...) error
- func PrepareFallback(resources []resource.ResourceFile, view resource.EffectiveResourceView, ...) error
- func PrepareNonFallback(resources []resource.ResourceFile, view resource.EffectiveResourceView, ...) error
- type LanguageItem
Constants ¶
This section is empty.
Variables ¶
View Source
var ErrNoLanguageMatch = errors.New("template: no language match")
Functions ¶
func Prepare ¶
func Prepare( resources []resource.ResourceFile, view resource.EffectiveResourceView, extractLanguageTag func(resrc resource.ResourceFile) string, add func(langTag string, resrc resource.ResourceFile) error, ) error
Prepare is PrepareFallback, followed by PrepareNonFallback. Prepare ensures that the fallback resource is full and complete, by using the builtin one as the base.
func PrepareFallback ¶
func PrepareFallback( resources []resource.ResourceFile, view resource.EffectiveResourceView, extractLanguageTag func(resrc resource.ResourceFile) string, add func(langTag string, resrc resource.ResourceFile) error, ) error
PrepareFallback prepares resources in fallback language.
func PrepareNonFallback ¶
func PrepareNonFallback( resources []resource.ResourceFile, view resource.EffectiveResourceView, extractLanguageTag func(resrc resource.ResourceFile) string, add func(langTag string, resrc resource.ResourceFile) error, ) error
PrepareNonFallback prepares resources in non-fallback languages.
Types ¶
type LanguageItem ¶
type LanguageItem interface {
GetLanguageTag() string
}
func Match ¶
func Match(preferred []string, fallback string, items []LanguageItem) (matched LanguageItem, err error)
Match matches items against preferred and fallback.
Click to show internal directories.
Click to hide internal directories.