示例#1
0
文件: gettext.go 项目: gosexy/gettext
// DGettext is like Gettext(), but looks up the message in the specified
// domain.
func DGettext(domain string, msgid string) string {
	cdomain := cDomainName(domain)
	defer C.free(unsafe.Pointer(cdomain))

	cmsgid := C.CString(msgid)
	defer C.free(unsafe.Pointer(cmsgid))

	return C.GoString(C.dgettext(cdomain, cmsgid))
}
示例#2
0
// Like Gettext(), but looking up the message in the specified domain.
func DGettext(domain string, msgid string) string {
	cdomain := C.CString(domain)
	cmsgid := C.CString(msgid)

	res := C.GoString(C.dgettext(cdomain, cmsgid))

	C.free(unsafe.Pointer(cdomain))
	C.free(unsafe.Pointer(cmsgid))
	return res
}