Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Context ¶
type Context struct {
// contains filtered or unexported fields
}
Context holds a localization context (a combination of a language, a corresponding Plurr formatter, and a link back to parent localization Pool object)
func (*Context) GetContext ¶
GetContext returns a context for another language within the same localization pool. It can be used to switch languages within the same pool (think of it as of a `SetLanguage()` function which returns a new context without changing the current one).
func (*Context) GetLanguage ¶
GetLanguage returns the current language of the context.
type Pool ¶
type Pool struct { DefaultLanguage string Resources map[string]Resources // contains filtered or unexported fields }
Pool object holds all string resources and language-specific contexts. Pool can be created either for an entire project, or for each logical part of the application that has its own set of strings.
func (*Pool) GetContext ¶
GetContext returns a translation context based on the provided language. Contexts are thread-safe.