2021-11-05 07:21:57 +00:00
|
|
|
package devicemngmt
|
|
|
|
|
|
|
|
import (
|
2021-11-05 08:40:07 +00:00
|
|
|
ua "github.com/mssola/user_agent"
|
2021-11-05 07:21:57 +00:00
|
|
|
)
|
|
|
|
|
2021-11-08 02:46:17 +00:00
|
|
|
func getUserAgentData(userAgent string) (string, string, bool) {
|
2021-11-05 08:40:07 +00:00
|
|
|
uaData := ua.New(userAgent)
|
2021-11-08 02:46:17 +00:00
|
|
|
return uaData.OSInfo().Name, uaData.OSInfo().Version, uaData.Mobile()
|
2021-11-05 08:40:07 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
func getLanguage(lang string) string {
|
|
|
|
// Language, default is vietnamese(vi)
|
|
|
|
if lang == langEn {
|
|
|
|
return langEn
|
|
|
|
}
|
|
|
|
return langVi
|
2021-11-05 07:21:57 +00:00
|
|
|
}
|