Documentation

    Interface Args

    Create a POT file for a WordPress project.

    Scans PHP, Blade-PHP, and JavaScript files for translatable strings, as well as theme stylesheets and plugin files if the source directory is detected as either a plugin or theme.

    Directory to scan for string extraction.

    Name of the resulting POT file.

    Plugin or theme slug. Defaults to the source directory's basename.

    Text domain to look for in the source code, unless the ignoreDomain option is used. By default, the "Text Domain" header of the plugin or theme is used. If none is provided, it falls back to the project slug.

    Ignore the text domain completely and extract strings with any text domain.

    Array in JSON format of custom headers which will be added to the POT file. Defaults to empty array.

    Whether to write #: filename:line lines. Defaults to true, use --no-location to skip the removal. Note that disabling this option makes it harder for technically skilled translators to understand each message’s context.

    Skips JavaScript string extraction. Useful when this is done in another build step, e.g. through Babel.

    Skips PHP string extraction.

    Skips Blade-PHP string extraction.

    Skips string extraction from block.json files.

    Skips string extraction from theme.json files.

    Skips string audit where it tries to find possible mistakes in translatable strings. Useful when running in an automated environment.

    String that should be added as a comment to the top of the resulting POT file. By default, a copyright comment is added for WordPress plugins and themes.

    Name to use for the package name in the resulting POT file's Project-Id-Version header. Overrides the plugin or theme name, if applicable.

    Whether to hide progress information.

    interface Args {
        domain: DomainType;
        headers?: {
            author: string;
            authorEmail: string;
            authors: string;
            authorUri: string;
            bugs: string;
            "bugs.email": string;
            "bugs.url": string;
            description: string;
            domain: string;
            domainPath: string;
            email: string;
            language: string;
            license: string;
            licenseUri: string;
            name: string;
            repository: string;
            slug: string;
            tags: string;
            textDomain: string;
            updateUri: string;
            url: string;
            version: string;
        };
        options?: {
            charset?: string;
            fileComment?: string;
            ignoreDomain?: boolean;
            json?: boolean;
            location?: boolean;
            output?: boolean;
            packageName?: string;
            silent?: boolean;
            skip: {
                audit?: boolean;
                blade?: boolean;
                blockJson?: boolean;
                js?: boolean;
                php?: boolean;
                themeJson?: boolean;
            };
        };
        paths: { cwd: string; out: string; root?: string };
        patterns: Patterns;
        slug: string;
    }
    Index

    Properties

    domain: DomainType
    headers?: {
        author: string;
        authorEmail: string;
        authors: string;
        authorUri: string;
        bugs: string;
        "bugs.email": string;
        "bugs.url": string;
        description: string;
        domain: string;
        domainPath: string;
        email: string;
        language: string;
        license: string;
        licenseUri: string;
        name: string;
        repository: string;
        slug: string;
        tags: string;
        textDomain: string;
        updateUri: string;
        url: string;
        version: string;
    }
    options?: {
        charset?: string;
        fileComment?: string;
        ignoreDomain?: boolean;
        json?: boolean;
        location?: boolean;
        output?: boolean;
        packageName?: string;
        silent?: boolean;
        skip: {
            audit?: boolean;
            blade?: boolean;
            blockJson?: boolean;
            js?: boolean;
            php?: boolean;
            themeJson?: boolean;
        };
    }
    paths: { cwd: string; out: string; root?: string }
    patterns: Patterns
    slug: string
    MMNEPVFCICPMFPCPTTAAATR