aboutsummaryrefslogtreecommitdiff
path: root/_examples
diff options
context:
space:
mode:
Diffstat (limited to '_examples')
-rw-r--r--_examples/gettext.go22
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!"))
}
-