Kaynağa Gözat

fix(yay): give priority to LC_MESSAGES. fixes #1442

jguer 4 yıl önce
ebeveyn
işleme
c221d5ebbd
1 değiştirilmiş dosya ile 5 ekleme ve 1 silme
  1. 5 1
      main.go

+ 5 - 1
main.go

@@ -19,7 +19,11 @@ func initGotext() {
 		localePath = envLocalePath
 	}
 
-	gotext.Configure(localePath, os.Getenv("LANG"), "yay")
+	if os.Getenv("LC_MESSAGES") != "" {
+		gotext.Configure(localePath, os.Getenv("LC_MESSAGES"), "yay")
+	} else {
+		gotext.Configure(localePath, os.Getenv("LANG"), "yay")
+	}
 }
 
 func initAlpm(cmdArgs *settings.Arguments, pacmanConfigPath string) (*pacmanconf.Config, bool, error) {