Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
var ( Root fs.FS Locale fs.FS )
var URLBase = "/"
URLBase is the base URL of the application. It is set by the server and injected into the frontend using a cookie.
Functions ¶
func IndexHandler ¶
func IndexHandler(resp http.ResponseWriter, req *http.Request)
IndexHandler returns an asset from the file system if it exists, otherwise the index page. Useful for a single page app.
Types ¶
type Languages ¶
type Languages map[string]map[string]LocalizedLanguage
Languages is a map of the available languages and their display names localized to the parent language. The key is the parent language, and the value is a map of the available languages and their display names localized to the parent language.
func Translations ¶
func Translations() Languages
Translations returns all the configured frontend languages. The frontend uses this to populate the language dropdown localized to the currently selected language.
type LocalizedLanguage ¶
type LocalizedLanguage struct {
// Lang is the parent language code this language Name is localized to.
Lang string `json:"lang"`
// Code is the language code of the language.
Code string `json:"code"`
// Name is the display name of the language localized to the parent (Lang) language.
Name string `json:"name"`
// Self is the display name of the language localized in its own language.
Self string `json:"self"`
}
LocalizedLanguage is a language and its display name localized to itself and another (parent) language.