diff options
author | José Carlos <jose.carlos@menteslibres.net> | 2016-02-20 07:33:14 -0600 |
---|---|---|
committer | José Carlos <jose.carlos@menteslibres.net> | 2016-02-20 07:33:14 -0600 |
commit | ea584c8c09c390260b68a9e1a15d60f7ffe480c5 (patch) | |
tree | d84ea7ec068b7998adae2bd4580db9dc78584c56 /README.md | |
parent | Merge branch 'master' of github.com:gosexy/gettext (diff) | |
parent | Code cleaning. (diff) | |
download | gotext-ea584c8c09c390260b68a9e1a15d60f7ffe480c5.tar.gz gotext-ea584c8c09c390260b68a9e1a15d60f7ffe480c5.tar.xz |
Merge pull request #9 from gosexy/issue-5
Code cleaning.
Diffstat (limited to 'README.md')
-rw-r--r-- | README.md | 30 |
1 files changed, 22 insertions, 8 deletions
@@ -5,8 +5,22 @@ library for writing multilingual systems. ## Requeriments -The GNU C library. If you're using GNU/Linux, FreeBSD or OSX you probably -already have it. +* [GNU gettext][1] + +### OSX + +Installing gettext on a Mac is a bit awkward: + +``` +brew install gettext + +export CGO_LDFLAGS=-L/usr/local/opt/gettext/lib +export CGO_CPPFLAGS=-I/usr/local/opt/gettext/include + +go get github.com/gosexy/gettext +``` + +Installation should be straightforward on Linux. ## Installation @@ -25,18 +39,18 @@ This is an example program showing the `BindTextdomain`, `Textdomain` and package main import ( - "github.com/gosexy/gettext" "fmt" - "os" + + "github.com/gosexy/gettext" ) func main() { - gettext.BindTextdomain("example", ".") - gettext.Textdomain("example") + textDomain := "default" - os.Setenv("LANGUAGE", "es_MX.utf8") + gettext.BindTextdomain(textDomain, "path/to/domains") + gettext.Textdomain(textDomain) - gettext.SetLocale(gettext.LC_ALL, "") + gettext.SetLocale(gettext.LcAll, "es_MX.utf8") fmt.Println(gettext.Gettext("Hello, world!")) } |