Plugin Directory

Changeset 3072898


Ignore:
Timestamp:
04/18/2024 08:41:53 AM (22 months ago)
Author:
Supertext
Message:

Sync with GitHub

Location:
polylang-supertext/trunk
Files:
5 edited

Legend:

Unmodified
Added
Removed
  • polylang-supertext/trunk/plugin.php

    r3015517 r3072898  
    77Domain Path: /resources/languages
    88Author: Supertext AG
    9 Version: 4.23
     9Version: 4.24
    1010Author URI: http://www.supertext.ch
    1111License: GPLv2 or later
    1212*/
    1313
    14 define('SUPERTEXT_PLUGIN_VERSION', '4.23');
     14define('SUPERTEXT_PLUGIN_VERSION', '4.24');
    1515define('SUPERTEXT_PLUGIN_REVISION', 49);
    1616define('SUPERTEXT_BASE_PATH', __DIR__);
  • polylang-supertext/trunk/readme.txt

    r3015517 r3072898  
    33Tags: internationalization, polylang, WPML, translation, service, supertext
    44Requires at least: 4.0
    5 Tested up to: 6.1
     5Tested up to: 6.4
    66License: GPLv2 or later
    77License URI: https://www.gnu.org/licenses/gpl-2.0.html
     
    110110== Changelog ==
    111111
     112= 4.24 =
     113* Remove unused sync feature
     114
    112115= 4.23 =
    113116* 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  
    237237
    238238    //process posts
    239     $workflowSettings = $this->library->getSettingOption(Constant::SETTING_WORKFLOW);
    240239    $this->processOrder(
    241240      $orderType,
     
    246245      $targetLanguage,
    247246      $referenceHashes,
    248       $content['metaData'],
    249       isset($workflowSettings['syncTranslationChanges']) && $workflowSettings['syncTranslationChanges']
     247      $content['metaData']
    250248    );
    251249
     
    385383   * @param $syncTranslation
    386384   */
    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){
    388386    switch ($orderType) {
    389387      case 'proofreading':
     
    405403          $targetLanguage,
    406404          $referenceHashes,
    407           $metaData,
    408           $syncTranslation
     405          $metaData
    409406        );
    410407        break;
     
    421418   * @param $syncTranslationChanges
    422419   */
    423   private function processTargetPosts($order, $sourcePostIds, $targetPostIds, $sourceLanguage, $targetLanguage, $referenceHashes, $metaData, $syncTranslationChanges)
     420  private function processTargetPosts($order, $sourcePostIds, $targetPostIds, $sourceLanguage, $targetLanguage, $referenceHashes, $metaData)
    424421  {
    425422    foreach ($sourcePostIds as $sourcePostId) {
     
    442439      $meta->set(TranslationMeta::SOURCE_LANGUAGE_CODE, $sourceLanguage);
    443440      $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       }
    453441    }
    454442  }
  • polylang-supertext/trunk/views/backend/meta-box.php

    r2520480 r3072898  
    1 <?php
    2   if($status['isTranslation'] && $syncTranslationChanges){
    3 ?>
    4     <strong><?php _e('Status', 'supertext'); ?></strong>
    5     <p>
    6       <?php
    7         $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 <?php
    14   }
    15 ?>
    161<strong><?php _e('Log', 'supertext'); ?></strong>
    172<div class="sttr-log-container">
  • polylang-supertext/trunk/views/backend/settings-workflow.php

    r2520480 r3072898  
    77$publishOnCallbackChecked = isset($workflowSettings['publishOnCallback']) && $workflowSettings['publishOnCallback'] ? 'checked="checked"' : '';
    88$overridePublishedPostsChecked = isset($workflowSettings['overridePublishedPosts']) && $workflowSettings['overridePublishedPosts'] ? 'checked="checked"' : '';
    9 $syncTranslationChangesChecked = isset($workflowSettings['syncTranslationChanges']) && $workflowSettings['syncTranslationChanges'] ? 'checked="checked"' : '';
    109
    1110?>
     
    2120      <label for="sttr-override-published-posts"><?php _e('Allow Supertext to overwrite published posts', 'supertext'); ?></label>
    2221    </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>
    2722  </div>
    2823</div>
Note: See TracChangeset for help on using the changeset viewer.