diff options
author | José Carlos Nieto <jose.carlos@menteslibres.net> | 2016-02-20 07:48:13 -0600 |
---|---|---|
committer | José Carlos Nieto <jose.carlos@menteslibres.net> | 2016-02-20 07:48:13 -0600 |
commit | e50212caf308008a60db6a294e4099162b910885 (patch) | |
tree | d45ab3fd845215325d523605bc51aeb3898caf0c /_examples/gettext.go | |
parent | Adding a note on #1. (diff) | |
download | gotext-e50212caf308008a60db6a294e4099162b910885.tar.gz gotext-e50212caf308008a60db6a294e4099162b910885.tar.xz |
Updating example.
Diffstat (limited to '_examples/gettext.go')
-rw-r--r-- | _examples/gettext.go | 22 |
1 files changed, 6 insertions, 16 deletions
diff --git a/_examples/gettext.go b/_examples/gettext.go index a01e0d5..9fa63b2 100644 --- a/_examples/gettext.go +++ b/_examples/gettext.go @@ -1,31 +1,21 @@ package main import ( - "github.com/gosexy/gettext" "fmt" - "os" + + "github.com/gosexy/gettext" ) func main() { - gettext.BindTextdomain("example", ".") + gettext.BindTextdomain("example", "./") gettext.Textdomain("example") - os.Setenv("LANGUAGE", "es_MX.utf8") - - gettext.SetLocale(gettext.LC_ALL, "") - + gettext.SetLocale(gettext.LcAll, "es_MX.utf8") fmt.Println(gettext.Gettext("Hello, world!")) - os.Setenv("LANGUAGE", "de_DE.utf8") - - gettext.SetLocale(gettext.LC_ALL, "") - + gettext.SetLocale(gettext.LcAll, "de_DE.utf8") fmt.Println(gettext.Gettext("Hello, world!")) - os.Setenv("LANGUAGE", "en_US.utf8") - - gettext.SetLocale(gettext.LC_ALL, "") - + gettext.SetLocale(gettext.LcAll, "en_US.utf8") fmt.Println(gettext.Gettext("Hello, world!")) } - |