Example #1
0
// 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))
}
Example #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
}