hello.go 466 B

1234567891011121314151617181920212223
  1. // Copyright 2013 <chaishushan{AT}gmail.com>. All rights reserved.
  2. // Use of this source code is governed by a BSD-style
  3. // license that can be found in the LICENSE file.
  4. // +build ignore
  5. package main
  6. import (
  7. "fmt"
  8. "github.com/chai2010/gettext-go"
  9. )
  10. func main() {
  11. gettext.SetLocale("zh_CN")
  12. gettext.BindTextdomain("hello", "../examples/local", nil)
  13. gettext.Textdomain("hello")
  14. fmt.Println(gettext.Gettext("Hello, world!"))
  15. // Output: 你好, 世界!
  16. }