chai2010/gettext-go là một trong những repo phía máy chủ mà TopGit theo dõi, hiện có 95 sao, viết chủ yếu bằng Go. :ab: GNU gettext for Go (Imported By Kubernetes)
Tóm tắt dựng từ metadata GitHub của chính dự án — chưa có bài review TopGit. Trang sẽ tự động cập nhật khi bài review đầy đủ được xuất bản.
VÌ SAO CHƯA CÓ REVIEW
TopGit viết bài đầy đủ cho repo có nhiều sao nhất và được yêu cầu nhiều nhất. Trang này là snapshot trong thời gian chờ — xem README gốc ở tab READ ME.
package main
import (
"fmt"
"github.com/chai2010/gettext-go"
)
func main() {
gettext.SetLanguage("zh_CN")
gettext.BindLocale(gettext.New("hello", "locale"))
// gettext.BindLocale("hello", "locale") // from locale dir
// gettext.BindLocale("hello", "locale.zip") // from locale zip file
// gettext.BindLocale("hello", "locale.zip", zipData) // from embedded zip data
// translate source text
fmt.Println(gettext.Gettext("Hello, world!"))
// Output: 你好, 世界!
// if no msgctxt in PO file (only msgid and msgstr),
// specify context as "" by
fmt.Println(gettext.PGettext("", "Hello, world!"))
// Output: 你好, 世界!
// translate resource
fmt.Println(string(gettext.Getdata("poems.txt"))))
// Output: ...
}
Go file: hello.go; PO file: hello.po;
API Changes (v0.1.0 vs v1.0.0)
Renamed package path
v0.1.0 (old)
v1.0.0 (new)
github.com/chai2010/gettext-go/gettext
github.com/chai2010/gettext-go
github.com/chai2010/gettext-go/gettext/po
github.com/chai2010/gettext-go/po
github.com/chai2010/gettext-go/gettext/mo
github.com/chai2010/gettext-go/mo
github.com/chai2010/gettext-go/gettext/plural
github.com/chai2010/gettext-go/plural
Renamed functions
v0.1.0 (old)
v1.0.0 (new)
gettext-go/gettext.*
gettext-go.*
gettext-go/gettext.DefaultLocal
gettext-go.DefaultLanguage
gettext-go/gettext.BindTextdomain
gettext-go.BindLocale
gettext-go/gettext.Textdomain
gettext-go.SetDomain
gettext-go/gettext.SetLocale
gettext-go.SetLanguage
gettext-go/gettext/po.Load
gettext-go/po.LoadFile
gettext-go/gettext/po.LoadData
gettext-go/po.Load
gettext-go/gettext/mo.Load
gettext-go/mo.LoadFile
gettext-go/gettext/mo.LoadData
gettext-go/mo.Load
Use empty string as the default context for gettext.Gettext
package main
// v0.1.0
// if the **context** missing, use `callerName(2)` as the context:
// v1.0.0
// if the **context** missing, use empty string as the context:
func main() {
gettext.Gettext("hello")
// v0.1.0 => gettext.PGettext("main.main", "hello")
// v1.0.0 => gettext.PGettext("", "hello")
gettext.DGettext("domain", "hello")
// v0.1.0 => gettext.DPGettext("domain", "main.main", "hello")
// v1.0.0 => gettext.DPGettext("domain", "", "hello")
gettext.NGettext("domain", "hello", "hello2", n)
// v0.1.0 => gettext.PNGettext("domain", "main.main", "hello", "hello2", n)
// v1.0.0 => gettext.PNGettext("domain", "", "hello", "hello2", n)
gettext.DNGettext("domain", "hello", "hello2", n)
// v0.1.0 => gettext.DPNGettext("domain", "main.main", "hello", "hello2", n)
// v1.0.0 => gettext.DPNGettext("domain", "", "hello", "hello2", n)
}
GitHub topics của chai2010/gettext-go: "gettext", "go", "golang", "i18n", "k8s", "kubernetes", "language", "mo-files", "po-files", "translation". TopGit xếp repo vào nhóm Backend.
chai2010/gettext-go có phải mã nguồn mở không?
Có — chai2010/gettext-go phát hành theo license BSD-3-Clause, nghĩa là mã nguồn mở để đọc, fork và (tùy license) tái sử dụng. Mã: github.com/chai2010/gettext-go.
chai2010/gettext-go có trang demo không?
Dự án có trang chủ ở http://pkg.go.dev/github.com/chai2010/gettext-go. Tab "Readme" ở trang này thường có ảnh chụp và hướng dẫn bắt đầu nhanh.
chai2010/gettext-go còn đang phát triển không?
Commit gần nhất trên chai2010/gettext-go là 2.6 năm trước (theo timestamp GitHub). Repo có 26 fork — một chỉ báo về mức độ quan tâm của cộng đồng.
chai2010/gettext-go dùng license gì?
chai2010/gettext-go phát hành theo license BSD-3-Clause. Nên mở file LICENSE trên GitHub để xác nhận — license metadata đôi khi lệch với thực tế dự án.
Đọc thêm về chai2010/gettext-go ở đâu?
Trang TopGit này là một snapshot — tab "Readme" hiển thị nguyên văn README của repo (đã bỏ link, giữ ảnh). Repo GitHub ở github.com/chai2010/gettext-go là nguồn chính thức.
Đọc đầy đủ README ở tab phía trên.
Vẫn đang phân vân về gettext-go?
Một cú bấm sẽ gửi câu hỏi kèm trang này cho AI — xem AI nói gì về gettext-go.