k3s/vendor/github.com/chai2010/gettext-go/gettext/hello.go

23 lines
466 B
Go
Raw Normal View History

2019-01-12 04:58:27 +00:00
// Copyright 2013 <chaishushan{AT}gmail.com>. All rights reserved.
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.
// +build ignore
package main
import (
"fmt"
"github.com/chai2010/gettext-go"
)
func main() {
gettext.SetLocale("zh_CN")
gettext.BindTextdomain("hello", "../examples/local", nil)
gettext.Textdomain("hello")
fmt.Println(gettext.Gettext("Hello, world!"))
// Output: 你好, 世界!
}