summaryrefslogtreecommitdiff
path: root/vendor/github.com/jmshal/go-locale/detect_locale_linux.go
diff options
context:
space:
mode:
Diffstat (limited to 'vendor/github.com/jmshal/go-locale/detect_locale_linux.go')
-rw-r--r--vendor/github.com/jmshal/go-locale/detect_locale_linux.go31
1 files changed, 0 insertions, 31 deletions
diff --git a/vendor/github.com/jmshal/go-locale/detect_locale_linux.go b/vendor/github.com/jmshal/go-locale/detect_locale_linux.go
deleted file mode 100644
index df0c33d..0000000
--- a/vendor/github.com/jmshal/go-locale/detect_locale_linux.go
+++ /dev/null
@@ -1,31 +0,0 @@
-package go_locale
-
-import (
- "strings"
- "errors"
-)
-
-func DetectLocale() (string, error) {
- out, err := getCommandOutput("locale")
- if err != nil {
- return "", err
- }
-
- lines := strings.Split(out, "\n")
- for _, line := range lines {
- if line != "" {
- parts := strings.Split(line, "=")
- value := strings.Trim(parts[1], `"`)
-
- if value != "C" && value != "" {
- encodingIndex := strings.Index(value, ".")
- if encodingIndex != -1 {
- value = value[0:encodingIndex]
- }
- return value, nil
- }
- }
- }
-
- return "", errors.New("unable to locale locale")
-}