浏览代码

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

jguer 4 年之前
父节点
当前提交
c221d5ebbd
共有 1 个文件被更改,包括 5 次插入1 次删除
  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) {