Translate Dublin core meta (or other meta)

Dublin Core is a collection of meta tags to describe your content.These tags are automatically generated. Recognised by states/governments, these are used by directories, Bing, Baidu and Yandex.

Below 2 examples of how you can translate Dublin core meta :

// On this example we say weglot to translate meta who looks like this : <meta name="dc.title" content="my awesome title" />
add_filter( 'weglot_get_dom_checkers', 'dublin_core_weglot_dom_check' );
function dublin_core_weglot_dom_check( $dom_checkers  ) {
	class Dublin_Core_Meta extends Weglot\Parser\Check\Dom\AbstractDomChecker {
		const DOM       = 'meta[name="dc.title"]';
		const PROPERTY  = 'content';
		const WORD_TYPE = Weglot\Client\Api\Enum\WordType::META_CONTENT; 
	}
	$dom_checkers[] = '\Dublin_Core_Meta';
	return $dom_checkers ;
}

// If you want to translate several meta (dc.title and dc.description) :
add_filter( 'weglot_get_dom_checkers', 'dublin_core_weglot_dom_check' );
function dublin_core_weglot_dom_check( $dom_checkers  ) {
	class Dublin_Core_Meta extends Weglot\Parser\Check\Dom\AbstractDomChecker {
		const DOM       = 'meta[name="dc.title"],meta[name="dc.description"]';
		const PROPERTY  = 'content';
		const WORD_TYPE = Weglot\Client\Api\Enum\WordType::META_CONTENT; 
	}
	$dom_checkers[] = '\Dublin_Core_Meta';
	return $dom_checkers ;
}

Last updated