Changeset 2947778
- Timestamp:
- 08/04/2023 02:54:09 PM (3 years ago)
- Location:
- memsource-connector/trunk
- Files:
-
- 5 edited
-
memsource.php (modified) (4 diffs)
-
readme.txt (modified) (1 diff)
-
src/Page/ConnectorPage.php (modified) (2 diffs)
-
src/Service/Content/AbstractPostService.php (modified) (1 diff)
-
src/Service/OptionsService.php (modified) (4 diffs)
Legend:
- Unmodified
- Added
- Removed
-
memsource-connector/trunk/memsource.php
r2932560 r2947778 5 5 Plugin URI: https://support.phrase.com/hc/en-us/articles/5709657294620 6 6 Description: Localize WordPress websites with the help of professional translation tools: translation memories, terminology bases and quality checkers. 7 Version: 4. 4.07 Version: 4.5.0 8 8 Text Domain: memsource 9 9 Domain Path: /locale … … 18 18 19 19 define('MEMSOURCE_PLUGIN_PATH', dirname(__FILE__)); 20 define('MEMSOURCE_PLUGIN_VERSION', '4. 4.0');20 define('MEMSOURCE_PLUGIN_VERSION', '4.5.0'); 21 21 define('MEMSOURCE_PLUGIN_DIR_URL', plugin_dir_url(__FILE__)); 22 22 … … 228 228 { 229 229 global $appRegistry; 230 $optionsService = $appRegistry->getOptionsService(); 231 232 // Post statuses: 230 233 $listStatuses = []; 231 232 234 if (isset($_POST['list-status-publish'])) { 233 235 $listStatuses[] = "publish"; … … 236 238 $listStatuses[] = "draft"; 237 239 } 238 $appRegistry->getOptionsService()->updateListStatuses($listStatuses); 239 $appRegistry->getOptionsService()->updateInsertStatus($_POST['insert-status']); 240 240 $optionsService->updateListStatuses($listStatuses); 241 $optionsService->updateInsertStatus($_POST['insert-status']); 242 243 // URL rewrite: 244 isset($_POST['url-rewrite']) ? $optionsService->enableUrlRewrite() : $optionsService->disableUrlRewrite(); 245 246 // Translation workflow: 241 247 $translationWorkflowService = $appRegistry->getTranslationWorkflowService(); 242 248 -
memsource-connector/trunk/readme.txt
r2943390 r2947778 33 33 == Changelog == 34 34 35 = 4.5.0 = 36 *Release Date - 4 Aug 2023* 37 38 * Added option to keep URLs unchanged during export from Phrase TMS 39 35 40 = 4.4.0 = 36 41 *Release Date - 30 Jun 2023* -
memsource-connector/trunk/src/Page/ConnectorPage.php
r2870027 r2947778 35 35 $listStatuses = $this->optionsService->getListStatuses(); 36 36 $insertStatus = $this->optionsService->getInsertStatus(); 37 $urlRewrite = $this->optionsService->isUrlRewriteEnabled(); 37 38 ?> 38 39 <script> … … 148 149 <div class="memsource-space-big"></div> 149 150 151 <!-- URL rewriting --> 152 153 <div id="url-rewrite-section" class="checkbox-section"> 154 <strong> 155 <?php _e('URL rewriting', 'memsource'); ?>: 156 </strong> 157 <div class="memsource-space-small"></div> 158 <input type="checkbox" id="url-rewrite" name="url-rewrite" value="on" <?php echo $urlRewrite ? 'checked' : ''; ?>/> 159 <label 160 for="url-rewrite" 161 title="<?php _e('URLs or Slugs are not be localised by default, checking this box will enable the ability to localise URLs or Slugs and target copies will have changed URLs based on the WMPL behaviour setup', 'memsource'); ?>" 162 class="memsource-tooltip" 163 > 164 <?php _e('Rewrite URLs when exporting jobs from Phrase TMS', 'memsource'); ?></label> 165 <br/> 166 </div> 167 <div class="memsource-space-big"></div> 168 150 169 <!-- Translation workflow --> 151 170 -
memsource-connector/trunk/src/Service/Content/AbstractPostService.php
r2870027 r2947778 202 202 203 203 // convert internal links 204 $content = $this->translationPlugin->convertInternalLinks($content, $language); 204 if ($this->optionsService->isUrlRewriteEnabled()) { 205 $content = $this->translationPlugin->convertInternalLinks($content, $language); 206 } 205 207 206 208 // prevent wp_unslash() called during wp_insert_post()/wp_update_post() -
memsource-connector/trunk/src/Service/OptionsService.php
r2870027 r2947778 14 14 public const MULTILINGUAL_PLUGIN_MLP = 'MultilingualPress'; 15 15 16 public const URL_REWRITE_ON = 'on'; 17 public const URL_REWRITE_OFF = 'off'; 18 16 19 private $restNamespace = 'memsource/v1/connector'; 17 20 … … 23 26 private $optionListStatus = 'memsource_list_status'; 24 27 private $optionInsertStatus = 'memsource_insert_status'; 28 private $optionUrlRewrite = 'memsource_url_rewrite'; 25 29 private $optionTranslationWorkflow = 'memsource_translation_workflow'; 26 30 private $optionAutomationWidgetId = 'memsource_automation_widget_id'; … … 42 46 add_option($this->optionListStatus, 'publish'); 43 47 add_option($this->optionInsertStatus, 'publish'); 48 add_option($this->optionUrlRewrite, self::URL_REWRITE_ON); 44 49 add_option($this->optionTranslationWorkflow, '[]'); 45 50 add_option($this->optionAutomationWidgetId, null); … … 141 146 } 142 147 148 public function enableUrlRewrite() 149 { 150 update_option($this->optionUrlRewrite, self::URL_REWRITE_ON); 151 } 152 153 public function disableUrlRewrite() 154 { 155 update_option($this->optionUrlRewrite, self::URL_REWRITE_OFF); 156 } 157 158 public function isUrlRewriteEnabled(): bool 159 { 160 return get_option($this->optionUrlRewrite) !== self::URL_REWRITE_OFF; 161 } 162 143 163 public function getAdminUser() 144 164 {
Note: See TracChangeset
for help on using the changeset viewer.