{
    "mode": "man",
    "parameter": "textdomain",
    "section": "3",
    "url": "https://www.chedong.com/phpMan.php/man/textdomain/3/json",
    "generated": "2026-11-08T00:30:18Z",
    "synopsis": "",
    "sections": {
        "NAME": {
            "content": "textdomain - set domain for future gettext() calls\n",
            "subsections": []
        },
        "SYNOPSIS": {
            "content": "",
            "subsections": [
                {
                    "name": "#include <libintl.h>",
                    "content": "char * textdomain (const char * domainname);\n"
                }
            ]
        },
        "DESCRIPTION": {
            "content": "The textdomain function sets or retrieves the current message domain.\n\nA message domain is a set of translatable msgid messages. Usually, every software package has\nits  own  message  domain.  The  domain name is used to determine the message catalog where a\ntranslation is looked up; it must be a non-empty string.\n\nThe current message domain is used by the gettext, ngettext functions, and by  the  dgettext,\ndcgettext, dngettext and dcngettext functions when called with a NULL domainname argument.\n\nIf  domainname  is  not NULL, the current message domain is set to domainname. The string the\nfunction stores internally is a copy of the domainname argument.\n\nIf domainname is NULL, the function returns the current message domain.\n",
            "subsections": []
        },
        "RETURN VALUE": {
            "content": "If successful, the textdomain function returns the current  message  domain,  after  possibly\nchanging  it.  The  resulting  string is valid until the next textdomain call and must not be\nmodified or freed. If a memory allocation failure occurs, it sets errno to ENOMEM and returns\nNULL.\n",
            "subsections": []
        },
        "ERRORS": {
            "content": "The following error can occur, among others:\n\nENOMEM Not enough memory available.\n",
            "subsections": []
        },
        "BUGS": {
            "content": "The return type ought to be const char *, but is char * to avoid warnings in C code predating\nANSI C.\n",
            "subsections": []
        },
        "SEE ALSO": {
            "content": "gettext(3), ngettext(3), bindtextdomain(3), bindtextdomaincodeset(3)\n\nGNU gettext 0.20.1.124-32cf                   May 2001                                 TEXTDOMAIN(3)",
            "subsections": []
        }
    },
    "summary": "textdomain - set domain for future gettext() calls",
    "flags": [],
    "examples": [],
    "see_also": [
        {
            "name": "gettext",
            "section": "3",
            "url": "https://www.chedong.com/phpMan.php/man/gettext/3/json"
        },
        {
            "name": "ngettext",
            "section": "3",
            "url": "https://www.chedong.com/phpMan.php/man/ngettext/3/json"
        },
        {
            "name": "bindtextdomain",
            "section": "3",
            "url": "https://www.chedong.com/phpMan.php/man/bindtextdomain/3/json"
        },
        {
            "name": "bindtextdomaincodeset",
            "section": "3",
            "url": "https://www.chedong.com/phpMan.php/man/bindtextdomaincodeset/3/json"
        }
    ]
}