Skip to content
Cross platform locale detection for Golang
Go Makefile
Branch: master
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
.gitignore
.travis.yml
LICENSE
Makefile
README.md
go.mod
go.sum
locale.go
locale_darwin.go
locale_darwin_test.go
locale_linux.go
locale_linux_test.go
locale_test.go
locale_unix.go
locale_unix_test.go
locale_windows.go
locale_windows_test.go

README.md

go-locale

Build Status GoDoc Go Report Card codecov License

go-locale is a Golang lib for cross platform locale detection.

OS Support

Linux

Check order

  • LANGUAGE env
  • LC_ALL env
  • LC_MESSAGES env
  • LANG env
  • locale command call

Support

  • All linux distributions

Windows

Check order

  • Win32 OLE

Support

  • Windows Vista or Windows Server 2008 Later

macOS X (darwin)

Check order

  • All check for Linux
  • User Defaults System

Support

  • All macOS X version

Usage

import (
    "github.com/Xuanwo/go-locale"
)

func main() {
	tag, err := locale.Detect()
    if err != nil {
        log.Fatal(err)
    }
    // Have fun with language.Tag!
}

Acknowledgments

Inspired by jibber_jabber

You can’t perform that action at this time.