is_post_type_screen( Tribe__Events__Main::POSTTYPE ) ) { return false; } $domain = 'the-events-calendar'; $translations = get_translations_for_domain( $domain ); $locale = [ '' => (object) [], 'prevent-empty' => 'prevent-empty', ]; foreach ( $translations->entries as $msgid => $entry ) { $locale[ $msgid ] = $entry->translations; } // Prepare Jed locale data. wp_add_inline_script( 'tribe-events-editor-elements', 'wp.i18n.setLocaleData( ' . json_encode( $locale ) . ', "' . $domain . '" );', 'before' ); } }