Do not depend on chat package from en_us.go

Language generator should either compare PkgName with "en-us" or Name
with "en_us". I chose "Name" here.
This commit is contained in:
BuildTools
2021-06-09 00:06:40 -06:00
parent 220857ab76
commit 704efd9282

View File

@ -124,7 +124,7 @@ func readLang(name string, r io.Reader) {
tmpl := template.Must(template.New("code_template").Parse( tmpl := template.Must(template.New("code_template").Parse(
`// Code generated by downloader.go; DO NOT EDIT. `// Code generated by downloader.go; DO NOT EDIT.
package {{.Name}} package {{.Name}}
{{if ne .PkgName "en_us"}} {{if ne .Name "en_us"}}
import "github.com/Tnze/go-mc/chat" import "github.com/Tnze/go-mc/chat"
func init() { chat.SetLanguage(Map) } func init() { chat.SetLanguage(Map) }