Created
July 11, 2017 09:57
-
-
Save Niq1982/d9eb43a8fedf055b755d97350d6500d2 to your computer and use it in GitHub Desktop.
Find out what WordPress translation text domains an element is using
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
add_filter( 'gettext', 'debug_translations', 30, 3 ); | |
function debug_translations( $translated_text, $text, $domain ) { | |
if ( $translated_text ) { | |
$output = $translated_text; | |
$output .= '<span style="font-size: 18px; color: white; line-height: 1; background-color: red; width: 24px; padding: 3px; border-radius: 18px;" title="text-domain: '; | |
$output .= $domain; | |
$output .= '">�</span>'; | |
} | |
return $output; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment