Merge pull request #4552 from sharifelgamal/translation-fix

Suppress error message when translation file doesn't exist
pull/4559/head
Sharif Elgamal 2019-06-21 16:34:45 -07:00 committed by GitHub
commit 42498d179a
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 4 additions and 4 deletions

View File

@ -60,12 +60,12 @@ func T(s string) string {
func DetermineLocale() {
locale, err := jibber_jabber.DetectIETF()
if err != nil {
glog.Warningf("Getting system locale failed: %s", err)
glog.Infof("Getting system locale failed: %v", err)
locale = ""
}
err = SetPreferredLanguage(locale)
if err != nil {
glog.Warningf("Setting locale failed: %s", err)
glog.Infof("Setting locale failed: %v", err)
preferredLanguage = defaultLanguage
}
@ -77,13 +77,13 @@ func DetermineLocale() {
translationFile := "pkg/minikube/translate/translations/" + preferredLanguage.String() + ".json"
t, err := ioutil.ReadFile(translationFile)
if err != nil {
glog.Errorf("Failed to load transalation file for %s: %s", preferredLanguage.String(), err)
glog.Infof("Failed to load translation file for %s: %v", preferredLanguage.String(), err)
return
}
err = json.Unmarshal(t, &Translations)
if err != nil {
glog.Errorf("Failed to populate translation map: %s", err)
glog.Infof("Failed to populate translation map: %v", err)
}
}