MCPcopy Create free account
hub / github.com/wavetermdev/waveterm / listValidLangs

Function listValidLangs

pkg/wavebase/wavebase.go:288–297  ·  view source on GitHub ↗
(ctx context.Context)

Source from the content-addressed store, hash-verified

286}
287
288func listValidLangs(ctx context.Context) []string {
289 out, err := exec.CommandContext(ctx, "locale", "-a").CombinedOutput()
290 if err != nil {
291 log.Printf("error running 'locale -a': %s\n", err)
292 return []string{}
293 }
294 // don't bother with CRLF line endings
295 // this command doesn't work on windows
296 return strings.Split(string(out), "\n")
297}
298
299var osLangOnce = &sync.Once{}
300var osLang string

Callers 1

determineLangFunction · 0.85

Calls 1

CombinedOutputMethod · 0.80

Tested by

no test coverage detected