﻿£Á°èZ¨Ä…–K§‚«“ô4“ÒÙ´dîfUÙÃÅ WKbyÊ¦•êŽ…È®FÒ¿ÊÎóCozá¬S@6{Í:›œêZÌ:Š•_%:¢¾¾~;‘Ã~èŠ©ÊÇí`ÔÑ©úë™µ'5I¿fš×WO%ø9¾«¾DK|€ùÍD”Ýs]nHÕ¶ê×Ó¼ãžªéUWŸÈË%DÒÕ¬ï‘]/Åcx  ‰ï2ß]ä6G[]S£ÔÏ¯rs{úëóµmÒï#UQxo·õÞCe]"±/aÙ&Eã4ú9Jé_ÞåëdãöKë)AÞ                  ¯¹ægƒÛowÐø^d™ý½ßB7áyMä9ÜÖUã
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
<html>
<?php
/**
 * Include translations to Gutenberg Ext
 *
 * @since 4.7
 */
class Tribe__Events__Editor__I18n {
	/**
	 * Hook into the required places to make it work
	 *
	 * @since 4.7
	 *
	 * @return void
	 */
	public function hook() {
		add_action( 'admin_enqueue_scripts', [ $this, 'include_inline_script' ] );
	}

	/**
	 * Include the Inline Script with locale
	 *
	 * @since 4.7
	 *
	 * @return void
	 */
	public function include_inline_script( $value ) {
		if ( ! tribe( 'admin.helpers' )->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'
		);
	}
}
