Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func NewLocalizer ¶
func NewLocalizer(localeFS embed.FS, defaultDomain string, locale string) (*spreak.Localizer, error)
NewLocalizer creates a new localizer for the application, the localizer is used to localize strings in the application. The localizer requires the application and the locale to be passed in, the locale is the language the user wants to use. If the locale is not found or is empty, the localizer will default to English, assuming it as the fallback.
Example:
t, err := i18n.NewLocalizer(app, "") if err != nil { fmt.Printf("Error: %v\n", err) return } fmt.Println(t.Get("I am Batman!"))
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.