// GetLanguage returns the language of the request
GetLanguage returns the language of the request
// GetLanguage returns the language of the request
func GetLanguage(c *gin.Context) *Language {
	langCookie, err := c.Cookie("language")
	if err != nil || langCookie == "" {
		return GetDefaultLanguage()
	}
	var lang Language
	uadminDatabase := NewUadminDatabase()
	db := uadminDatabase.Db
	db.Model(Language{}).Where(&Language{Code: langCookie}).First(&lang)
	uadminDatabase.Close()
	return &lang
}
func GetLanguage ( c * gin . Context ) * Language { langCookie , err := c . Cookie ( " " ) if err != nil || langCookie == " " { return GetDefaultLanguage ( ) } var lang Language uadminDatabase := NewUadminDatabase ( ) db := uadminDatabase . Db db . Model ( Language { } ) . Where ( & Language { Code : langCookie } ) . First ( & lang ) uadminDatabase . Close ( ) return & lang }
GetLanguage returns the language of the request
GetLanguage returns the language of the request