Procházet zdrojové kódy

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

jguer před 4 roky
rodič
revize
c221d5ebbd
1 změnil soubory, kde provedl 5 přidání a 1 odebrání
  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) {