Documentation ¶
Index ¶
- func BuildJSON(trans map[string]string) string
- func GetTranslated(src map[string]string, wantedlang string) string
- func GetTranslatedFromTr(trs interface{}, wantedlang string, fieldname string) string
- func MergeIn(newTrans map[string]string, oldTrans map[string]string)
- func PlateToTree(trans map[string]string) map[string]interface{}
- func ReadTranslation(lang string, side string) (res map[string]string, err error)
- func Reinit()
- func T(lang string, key string, a ...interface{}) string
- func TWeb(lang string, key string, a ...interface{}) string
- func WriteJSON(trans map[string]interface{}, lang string, side string) (err error)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func GetTranslated ¶
GetTranslated is a helper, get a translation from a map[string][string], with fallback
func GetTranslatedFromTr ¶
GetTranslatedFromTr return the translation of a []Table_tr object style
func MergeIn ¶
MergeIn will merge oldTrans in newTrans, only key in newTrans will exists, others from oldTrans will not be imported
func PlateToTree ¶
PlateToTree convert a plate map to a tree map
func ReadTranslation ¶
ReadTranslation will load a translation file (json format). side is "server", "web" or "*" meaning server+web merged
func T ¶
T will return the translation represented by the key string and the wanted language. Translation can use fmt formats
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.