function display_translate_gui()

in admin/partials/amazonpolly-metabox.php [29:77]


function display_translate_gui($post) {
	$common = new AmazonAI_Common();


	$post_source_language = get_post_meta( $post->ID, 'amazon_ai_source_language', true );
	if ( !empty($post_source_language) ) {
		echo '<p><input type="checkbox" name="amazon_ai_deactive_translation" id="amazon_ai_deactive_translation" value="1"/><label for="amazon_polly_enable">Deactive Translation</label> </p>';
	}

	// Check if Translate (Amazon Translate) functionality is enabled.
	if ( $common->is_translation_enabled() ) {


		$number_of_translations = 0;

		foreach ($common->get_all_translatable_languages() as $language_code) {
			$number_of_translations = $number_of_translations + inc_trans($common, $language_code );
		}

		echo '<div id="amazon_ai_translate_gui">';

		if ( ! empty( $number_of_translations ) ) {
			echo '<div id="amazon_polly_trans_div">';
				echo '<p style="display:inline;"><button type="button" class="button button-primary" id="amazon_polly_trans_button">Translate</button></p>';
				echo '<div style="display:inline" id="amazon-polly-trans-info"><p style="display:inline; color: blue;">&nbsp; You will translate it into </p><div id="amazon_polly_number_of_trans" style="display:inline; color: blue;">' . $number_of_translations . '</div><p style="display:inline; color: blue;"> language(s).</p></div>';
				echo '<div id="amazon_polly_trans-progressbar"><div class="amazon_polly_trans-label"></div></div>';
			echo '</div>';
		}

		echo '</div>';

	}
    echo '<p><button type="button" class="button" id="amazon_polly_price_checker_button" >How much will this cost to convert?</button></p>';
    echo '<div id="amazon_ai_plugin_cost_info">';
    if ( $common->is_polly_enabled() ) {
        echo '<p><b>-> Text-To-Speech Functionality</b><p>';
        echo '<p>For Amazon Polly’s Standard voices, <b>the free tier includes 5 million characters per month</b> for speech or Speech Marks requests, for the first 12 months, starting from your first request for speech. For Neural voices, the free tier includes 1 million characters per month for speech or Speech Marks requests, for the first 12 months, starting from your first request. <p>';
        echo '<p>You are billed monthly for the number of characters of text that you processed. Amazon Polly’s Standard voices are priced at $4.00 per 1 million characters for speech or Speech Marks requests (when outside the free tier). Amazon Polly’s Neural voices are priced at $16.00 per 1 million characters for speech or Speech Marks requested (when outside the free tier). <p>';
        echo '<p>When you update your post, plugin needs to conver the whole content to audio again.  <p>';
        echo '<p>You can find full information about pricing of Amazon Polly here: https://aws.amazon.com/polly/pricing/ <p>';
    }
    if ( $common->is_translation_enabled() ) {
        echo '<p><b>-> Translate Functionality</b><p>';
        echo '<p>Your <b>Free Tier is 2 million characters per month for 12 months</b>, starting from the date on which you create your first translation request. When your free usage expires, or if your application use exceeds the free usage tier, you simply pay standard, pay-as-you-go service rates.  <p>';
        echo '<p>After this, you are billed monthly for the total number of characters sent to the API for processing, including white space characters. Amazon Translate is priced at $15 per million characters ($0.000015 per character). <p>';
        echo '<p>You can find full information about pricing of Amazon Translate here: https://aws.amazon.com/translate/pricing/  <p>';
    }
    echo '</div>';
}