Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type FilesystemCatalog ¶
type FilesystemCatalog struct {
// contains filtered or unexported fields
}
FilesystemCatalog loads messages from JSON files.
File names must be: <textDomain>.<languageCode>.json. Nested directories are not supported.
func (*FilesystemCatalog) LoadMessages ¶
func (f *FilesystemCatalog) LoadMessages( languageCode string, textDomain string, messages any, ) error
type Translator ¶
Translator loads messages into a struct of your choosing.
Text domain groups messages. There should be one text domain per message struct type.
func NewTranslator ¶
func NewTranslator(languageCode string, catalog Catalog) Translator
NewTranslator creates a translator loading messages from the catalog with the given language code.
Click to show internal directories.
Click to hide internal directories.