Notes about WordPress Gutenberg themes development.

  • Context in translation

    Read more

    Prototype:

    _x( string $text, string $context, string $domain = 'default' ): string

    Quite a few times, there will be collisions with similar translatable text found in more than two places, but with different translated context.

    By including the context in the pot file, translators can translate the two strings differently.

    Example:

    _x( 'T', 'Tuesday', 'text-domain');
    _x( 'T', 'Thursday', 'text-domain');

    source : https://developer.wordpress.org/reference/functions/_x/