Skip to content

Rethink domain handling #7

@swissspidy

Description

@swissspidy

Right now, the script only parses gettext calls where the text domain matches the plugin slug by setting $this->translations->setDomain( $this->slug ).

This matches WordPress.org behaviour, see https://developer.wordpress.org/plugins/internationalization/how-to-internationalize-your-plugin/.

However, sometimes developers include third-party libraries in their plugins with different text domains and still expect those to be extracted.

Since I'd like to keep the current behaviour as the default, maybe we can add an --ignore-domain option to the script?

The code could look like this (simplified):

if ( ! Utils\get_flag_value( $assoc_args, 'ignore-domain' ) {
    $this->translations->setDomain( $this->slug );
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions