Changeset 3072898
- Timestamp:
- 04/18/2024 08:41:53 AM (22 months ago)
- Location:
- polylang-supertext/trunk
- Files:
-
- 5 edited
-
plugin.php (modified) (1 diff)
-
readme.txt (modified) (2 diffs)
-
src/Supertext/Backend/AjaxRequestHandler.php (modified) (6 diffs)
-
views/backend/meta-box.php (modified) (1 diff)
-
views/backend/settings-workflow.php (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
polylang-supertext/trunk/plugin.php
r3015517 r3072898 7 7 Domain Path: /resources/languages 8 8 Author: Supertext AG 9 Version: 4.2 39 Version: 4.24 10 10 Author URI: http://www.supertext.ch 11 11 License: GPLv2 or later 12 12 */ 13 13 14 define('SUPERTEXT_PLUGIN_VERSION', '4.2 3');14 define('SUPERTEXT_PLUGIN_VERSION', '4.24'); 15 15 define('SUPERTEXT_PLUGIN_REVISION', 49); 16 16 define('SUPERTEXT_BASE_PATH', __DIR__); -
polylang-supertext/trunk/readme.txt
r3015517 r3072898 3 3 Tags: internationalization, polylang, WPML, translation, service, supertext 4 4 Requires at least: 4.0 5 Tested up to: 6. 15 Tested up to: 6.4 6 6 License: GPLv2 or later 7 7 License URI: https://www.gnu.org/licenses/gpl-2.0.html … … 110 110 == Changelog == 111 111 112 = 4.24 = 113 * Remove unused sync feature 114 112 115 = 4.23 = 113 116 * Add additional filters and actions to allow other plugins to hook into when the translation is written back (sttr_post_meta_translation for applying filter on translated post meta value, sttr_writeback_target_content for applying filter on target content, sttr_finish_target_post_writeback for running action after the target post write back) -
polylang-supertext/trunk/src/Supertext/Backend/AjaxRequestHandler.php
r2520480 r3072898 237 237 238 238 //process posts 239 $workflowSettings = $this->library->getSettingOption(Constant::SETTING_WORKFLOW);240 239 $this->processOrder( 241 240 $orderType, … … 246 245 $targetLanguage, 247 246 $referenceHashes, 248 $content['metaData'], 249 isset($workflowSettings['syncTranslationChanges']) && $workflowSettings['syncTranslationChanges'] 247 $content['metaData'] 250 248 ); 251 249 … … 385 383 * @param $syncTranslation 386 384 */ 387 private function processOrder($orderType, $order, $sourcePostIds, $targetPostIds, $sourceLanguage, $targetLanguage, $referenceHashes, $metaData , $syncTranslation){385 private function processOrder($orderType, $order, $sourcePostIds, $targetPostIds, $sourceLanguage, $targetLanguage, $referenceHashes, $metaData){ 388 386 switch ($orderType) { 389 387 case 'proofreading': … … 405 403 $targetLanguage, 406 404 $referenceHashes, 407 $metaData, 408 $syncTranslation 405 $metaData 409 406 ); 410 407 break; … … 421 418 * @param $syncTranslationChanges 422 419 */ 423 private function processTargetPosts($order, $sourcePostIds, $targetPostIds, $sourceLanguage, $targetLanguage, $referenceHashes, $metaData , $syncTranslationChanges)420 private function processTargetPosts($order, $sourcePostIds, $targetPostIds, $sourceLanguage, $targetLanguage, $referenceHashes, $metaData) 424 421 { 425 422 foreach ($sourcePostIds as $sourcePostId) { … … 442 439 $meta->set(TranslationMeta::SOURCE_LANGUAGE_CODE, $sourceLanguage); 443 440 $meta->set(TranslationMeta::META_DATA, $metaData[$sourcePostId]); 444 445 $translationDate = $meta->get(TranslationMeta::TRANSLATION_DATE);446 if($syncTranslationChanges && $translationDate !== null && strtotime($translationDate) < strtotime($targetPost->post_modified)){447 try{448 $this->sendSyncRequest($targetPost);449 }catch (\Exception $e) {450 $this->log->addEntry($targetPost->ID, __('Post changes could not be sent to Supertext.', 'supertext'));451 }452 }453 441 } 454 442 } -
polylang-supertext/trunk/views/backend/meta-box.php
r2520480 r3072898 1 <?php2 if($status['isTranslation'] && $syncTranslationChanges){3 ?>4 <strong><?php _e('Status', 'supertext'); ?></strong>5 <p>6 <?php7 $status['isInTranslation'] ?8 _e('This post is currently being modified by Supertext.', 'supertext') :9 _e('This post is a translation.', 'supertext'); ?>10 <?php $status['hasChangedSinceLastTranslation'] && !$status['isInTranslation'] ? _e("Its content has been modified and doesn't match the original translation anymore.", 'supertext') : ''; ?>11 </p>12 <p><button type="button" class="button" <?php echo $status['hasChangedSinceLastTranslation'] && !$status['isInTranslation'] ? '' : 'disabled="disabled"'; ?> onclick="Supertext.Interface.sendSyncRequest()"><?php _e('Send changes to Supertext', 'supertext'); ?></button></p>13 <?php14 }15 ?>16 1 <strong><?php _e('Log', 'supertext'); ?></strong> 17 2 <div class="sttr-log-container"> -
polylang-supertext/trunk/views/backend/settings-workflow.php
r2520480 r3072898 7 7 $publishOnCallbackChecked = isset($workflowSettings['publishOnCallback']) && $workflowSettings['publishOnCallback'] ? 'checked="checked"' : ''; 8 8 $overridePublishedPostsChecked = isset($workflowSettings['overridePublishedPosts']) && $workflowSettings['overridePublishedPosts'] ? 'checked="checked"' : ''; 9 $syncTranslationChangesChecked = isset($workflowSettings['syncTranslationChanges']) && $workflowSettings['syncTranslationChanges'] ? 'checked="checked"' : '';10 9 11 10 ?> … … 21 20 <label for="sttr-override-published-posts"><?php _e('Allow Supertext to overwrite published posts', 'supertext'); ?></label> 22 21 </p> 23 <p>24 <input type="checkbox" id="sttr-sync-translation-changes" name="syncTranslationChanges" <?php echo $syncTranslationChangesChecked; ?>/>25 <label for="sttr-sync-translation-changes"><?php _e('Synchronize translation changes', 'supertext'); ?></label>26 </p>27 22 </div> 28 23 </div>
Note: See TracChangeset
for help on using the changeset viewer.