github.com/df-mc/dragonfly@v0.9.13/server/internal/packbuilder/lang.go (about) 1 package packbuilder 2 3 import ( 4 "os" 5 "path/filepath" 6 "strings" 7 ) 8 9 // buildLanguageFile creates a lang file and writes all of the language entries to the pack. 10 func buildLanguageFile(dir string, lang []string) { 11 if err := os.Mkdir(filepath.Join(dir, "texts"), os.ModePerm); err != nil { 12 panic(err) 13 } 14 if err := os.WriteFile(filepath.Join(dir, "texts/en_US.lang"), []byte(strings.Join(lang, "\n")), 0666); err != nil { 15 panic(err) 16 } 17 }