Lingotek Translation - Version 1.3.2

Version Description

(2017-8-8) =

  • Updated string group action links to support multi-word titles
  • Stabilized the relationship between the auto-updater and the Lingotek Professional Workflow UI
  • Added tutorial for the Lingotek Professional Translation workflow
Download this release

Release Info

Developer erichie
Plugin Icon 128x128 Lingotek Translation
Version 1.3.2
Comparing to
See all releases

Code changes from version 1.3.1 to 1.3.2

admin/actions.php CHANGED
@@ -254,6 +254,9 @@ abstract class Lingotek_Actions {
254
  */
255
  public function upload_icon( $object_id, $confirm = false ) {
256
  $args = array( $this->type => $object_id, 'action' => 'lingotek-upload', 'noheader' => true );
 
 
 
257
  $link = wp_nonce_url( defined( 'DOING_AJAX' ) && DOING_AJAX ? add_query_arg( $args, wp_get_referer() ) : add_query_arg( $args ), 'lingotek-upload' );
258
  self::link_to_settings_if_not_connected($link);
259
  return self::display_icon( 'upload', $link, $confirm ? self::$confirm_message : '' );
@@ -330,6 +333,9 @@ abstract class Lingotek_Actions {
330
  $action = $args['action'];
331
  $args['action'] = 'lingotek-' . $action;
332
  $args['noheader'] = true;
 
 
 
333
  $link = wp_nonce_url( defined( 'DOING_AJAX' ) && DOING_AJAX ? add_query_arg( $args, wp_get_referer() ) : add_query_arg( $args ), 'lingotek-' . $action );
334
  self::link_to_settings_if_not_connected($link);
335
 
254
  */
255
  public function upload_icon( $object_id, $confirm = false ) {
256
  $args = array( $this->type => $object_id, 'action' => 'lingotek-upload', 'noheader' => true );
257
+ if (isset($args['string'])) {
258
+ $args['string'] = urlencode($args['string']);
259
+ }
260
  $link = wp_nonce_url( defined( 'DOING_AJAX' ) && DOING_AJAX ? add_query_arg( $args, wp_get_referer() ) : add_query_arg( $args ), 'lingotek-upload' );
261
  self::link_to_settings_if_not_connected($link);
262
  return self::display_icon( 'upload', $link, $confirm ? self::$confirm_message : '' );
333
  $action = $args['action'];
334
  $args['action'] = 'lingotek-' . $action;
335
  $args['noheader'] = true;
336
+ if (isset($args['string'])) {
337
+ $args['string'] = urlencode($args['string']);
338
+ }
339
  $link = wp_nonce_url( defined( 'DOING_AJAX' ) && DOING_AJAX ? add_query_arg( $args, wp_get_referer() ) : add_query_arg( $args ), 'lingotek-' . $action );
340
  self::link_to_settings_if_not_connected($link);
341
 
admin/admin.php CHANGED
@@ -485,7 +485,7 @@ class Lingotek_Admin {
485
  );
486
  }
487
  if (Lingotek_Professional_Translation_Workflow::is_allowed_user()) {
488
- $workflows['ab6c522a-7645-4317-9284-3fbddf516151'] = 'Lingotek Professional Translation';
489
  }
490
  natcasesort( $workflows ); // order by title (case-insensitive).
491
  $refresh_success['workflows'] = true;
485
  );
486
  }
487
  if (Lingotek_Professional_Translation_Workflow::is_allowed_user()) {
488
+ $workflows['ltk-professional-translation'] = 'Lingotek Professional Translation';
489
  }
490
  natcasesort( $workflows ); // order by title (case-insensitive).
491
  $refresh_success['workflows'] = true;
admin/filters-post.php CHANGED
@@ -271,10 +271,10 @@ class Lingotek_Filters_Post extends PLL_Admin_Filters_Post {
271
  wp_delete_post($tr_id, true); // forces deletion for the translations which are not already in the list
272
  }
273
  }
274
- if ($group !== 0 && $group->source == $post_id) {
275
  $group->disassociate();
276
  }
277
- else if ($group->source !== null) {
278
  $post_lang = pll_get_post_language($post_id, 'locale');
279
  if ($this->lingotek_prefs['delete_document_from_tms']) {
280
  unset($group->desc_array['lingotek']['translations'][$post_lang]);
271
  wp_delete_post($tr_id, true); // forces deletion for the translations which are not already in the list
272
  }
273
  }
274
+ if (is_object($group) && $group->source == $post_id) {
275
  $group->disassociate();
276
  }
277
+ else if (is_object($group) && $group->source !== null) {
278
  $post_lang = pll_get_post_language($post_id, 'locale');
279
  if ($this->lingotek_prefs['delete_document_from_tms']) {
280
  unset($group->desc_array['lingotek']['translations'][$post_lang]);
admin/post-actions.php CHANGED
@@ -46,6 +46,9 @@ class Lingotek_Post_actions extends Lingotek_Actions {
46
  add_action( 'load-edit.php', array( &$this, 'manage_actions' ) );
47
  add_action( 'load-upload.php', array( &$this, 'manage_actions' ) );
48
 
 
 
 
49
  // add meta box on post and page edit pages, and hook on save.
50
  add_action( 'add_meta_boxes', array( &$this, 'lingotek_add_meta_boxes' ) );
51
  add_action( 'save_post', array( &$this, 'lingotek_save_meta_boxes' ) );
@@ -109,6 +112,27 @@ class Lingotek_Post_actions extends Lingotek_Actions {
109
  }
110
  }
111
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
112
  /**
113
  * Manages Lingotek specific actions before WordPress acts
114
  *
46
  add_action( 'load-edit.php', array( &$this, 'manage_actions' ) );
47
  add_action( 'load-upload.php', array( &$this, 'manage_actions' ) );
48
 
49
+ // handle promotional banner
50
+ add_action( 'load-edit.php', array( &$this, 'manage_promotions' ) );
51
+
52
  // add meta box on post and page edit pages, and hook on save.
53
  add_action( 'add_meta_boxes', array( &$this, 'lingotek_add_meta_boxes' ) );
54
  add_action( 'save_post', array( &$this, 'lingotek_save_meta_boxes' ) );
112
  }
113
  }
114
 
115
+ public function manage_promotions() {
116
+ if (null !== filter_input(INPUT_GET, 'ltk-promotion') && 'dismiss' === filter_input(INPUT_GET, 'ltk-promotion')) {
117
+ update_option('lingotek_professional_promotion_shown', true);
118
+ } else if (null !== filter_input(INPUT_GET, 'ltk-promotion') && 'view' === filter_input(INPUT_GET, 'ltk-promotion')) {
119
+ update_option('lingotek_professional_promotion_shown', true);
120
+ wp_safe_redirect( 'admin.php?page=lingotek-translation_tutorial&sm=content&tutorial=ltk-prof#ltk-prof-trans-header' );
121
+ die();
122
+ }
123
+ function lingotek_professional_translation_notice() {
124
+ echo sprintf( '<div style="height: 45px;" class="notice notice-success"><p>%s <a style="float:right;" class="button" href="%s" >Dismiss</a><a style="float:right; margin-right: 6px;" class="button button-primary" href="%s" >Learn More</a></p></div>',
125
+ __( '<b>NEW FEATURE!</b> Lingotek Professional Translation is now available.', 'lingotek-translation' ),
126
+ admin_url( 'edit.php?ltk-promotion=dismiss' ),
127
+ admin_url( 'edit.php?ltk-promotion=view' )
128
+ );
129
+ }
130
+ // update_option('lingotek_professional_promotion_shown', false);
131
+ if (!get_option('lingotek_professional_promotion_shown')) {
132
+ add_action( 'admin_notices', 'lingotek_professional_translation_notice' );
133
+ }
134
+ }
135
+
136
  /**
137
  * Manages Lingotek specific actions before WordPress acts
138
  *
admin/settings/view-account.php CHANGED
@@ -156,7 +156,7 @@ if ( ! $community_id ) {
156
  <div class='payment-method-setup last-four-digits-div'><span id='last-four-digits' class='payment-method-setup'><?php echo $cc; ?></span></div>
157
  <div class='payment-method-setup credit-card-image-div'><img id='credit-card-image' class='payment-method-setup' src="<?php echo Lingotek_Credit_Card_To_Path::get_cc_type_asset_url($cc_type) ?>"/></div>
158
  </div>
159
- <div style="height:37px; display:inline-block;padding-left: 10px;"><a id="professional-payment-info-link" href="<?php echo esc_url_raw( BRIDGE_URL ); ?>/#/billing/payment?redirect_url=<?php echo urlencode( home_url( add_query_arg( NULL, NULL ) ) ); ?>" style="display: table-cell;padding-top: 7%;"><?php echo ($payment_method_set) ? 'Edit Payment Method' : 'Setup Payment Method'; ?></a></div>
160
  </td>
161
  </tr>
162
  </table>
156
  <div class='payment-method-setup last-four-digits-div'><span id='last-four-digits' class='payment-method-setup'><?php echo $cc; ?></span></div>
157
  <div class='payment-method-setup credit-card-image-div'><img id='credit-card-image' class='payment-method-setup' src="<?php echo Lingotek_Credit_Card_To_Path::get_cc_type_asset_url($cc_type) ?>"/></div>
158
  </div>
159
+ <div style="height:37px; display:inline-block;padding-left: 10px;"><a id="professional-payment-info-link" href="<?php echo esc_url_raw( BRIDGE_URL ); ?>/#/billing/payment?redirect_url=<?php echo urlencode( home_url( add_query_arg( NULL, NULL ) ) ); ?>" style="display: table-cell;padding-top: 7%;"><?php echo ($payment_method_set) ? 'Edit Payment Method' : 'Set Up Payment Method'; ?></a></div>
160
  </td>
161
  </tr>
162
  </table>
admin/settings/view-defaults.php CHANGED
@@ -136,5 +136,6 @@ if ( $default_filters_exist ) { ?>
136
  <p>
137
  <?php submit_button( __( 'Save Changes', 'lingotek-translation' ), 'primary', 'submit', false ); ?>
138
  <?php submit_button( __( 'Refresh Resources', 'lingotek-translation' ), 'secondary', 'refresh', false ); ?>
 
139
  </p>
140
  </form>
136
  <p>
137
  <?php submit_button( __( 'Save Changes', 'lingotek-translation' ), 'primary', 'submit', false ); ?>
138
  <?php submit_button( __( 'Refresh Resources', 'lingotek-translation' ), 'secondary', 'refresh', false ); ?>
139
+ <script>jQuery(document).ready(function($) { $('#wpfooter').remove(); } );</script>
140
  </p>
141
  </form>
admin/tutorial/content.php CHANGED
@@ -18,41 +18,51 @@
18
  padding-left: 10px;
19
  }
20
  </style>
 
 
 
 
 
 
21
 
22
- <p><?php _e('', 'lingotek-translation') ?></p>
23
-
24
- <div>
25
- <h4><?php _e('1. Create content', 'lingotek-translation') ?></h4>
26
- <p><?php _e('Whether you write a blog post, create a page for your site, or have existing posts and pages, any of your Wordpress content can be uploaded to <i>Lingotek</i>.', 'lingotek-translation') ?>
27
- <?php _e('The examples shown below are for Pages but translation for other content types works the same way!', 'lingotek-translation') ?></p>
28
- <img class="lingotek-bordered" src="<?php echo LINGOTEK_URL . '/admin/tutorial/img/add-page.png'; ?>">
29
- <p class="img-caption"><?php _e('Create a new page for translation.', 'lingotek-translation') ?></p>
30
- </div>
31
- <div>
32
- <h4><?php _e('2. Upload content to Lingotek', 'lingotek-translation') ?></h4>
33
- <p><?php _e('Your Wordpress content can be uploaded to <i>Lingotek</i> with the simple push of a button.', 'lingotek-translation') ?></p>
34
- <img class="lingotek-bordered" src="<?php echo LINGOTEK_URL . '/admin/tutorial/img/ready-to-upload.png'; ?>">
35
- <p class="img-caption"><?php _e('Content has been created and is ready for upload to Lingotek.', 'lingotek-translation') ?></p>
36
- </div>
37
- <div>
38
- <h4><?php _e('3. Request translations for target languages', 'lingotek-translation') ?></h4>
39
- <p><?php _e('Request translation for a specific language by clicking on the orange plus icon, for all languages at once, or in bulk by using the <i>Bulk Actions</i> dropdown.', 'lingotek-translation') ?></p>
40
- <img class="lingotek-bordered" src="<?php echo LINGOTEK_URL . '/admin/tutorial/img/request-translations.png'; ?>">
41
- <p class="img-caption"><?php _e('The source content is uploaded and ready for target languages.', 'lingotek-translation') ?></p>
42
- </div>
43
- <div>
44
- <h4><?php _e('4. Translate your content', 'lingotek-translation') ?></h4>
45
- <p><?php _e('Your content will now be translated into your selected target languages by free machine translation or, if you contract with <i>Lingotek</i>, professional translation services.', 'lingotek-translation') ?></p>
46
- <img class="lingotek-bordered" src="<?php echo LINGOTEK_URL . '/admin/tutorial/img/translations-underway.png'; ?>">
47
- <p class="img-caption"><?php _e('Your translations are underway.', 'lingotek-translation') ?></p>
48
- </div>
49
- <div>
50
- <h4><?php _e('5. Download translations', 'lingotek-translation') ?></h4>
51
- <p><?php _e('Once your translations are complete they will be marked ready for download. You can download translations for all languages, each language individually, or in bulk (using the <i>Bulk Actions</i> dropdown).', 'lingotek-translation') ?></p>
52
- <img class="lingotek-bordered" src="<?php echo LINGOTEK_URL . '/admin/tutorial/img/translations-ready-for-download.png'; ?>">
53
- <p class="img-caption"><?php _e('Your translations are ready for download.', 'lingotek-translation') ?></p>
54
- </div>
55
- <div>
 
 
 
 
56
  <h4><?php _e('6. Your content is translated!', 'lingotek-translation') ?></h4>
57
  <p><?php _e('The orange pencil icons indicate that your translations are finished, downloaded, and current within your Wordpress site. Clicking on any one of the pencils will direct you to the Lingotek Workbench for that specific language. Here you can make updates and changes to your translations if necessary.', 'lingotek-translation') ?></p>
58
  <img class="lingotek-bordered" src="<?php echo LINGOTEK_URL . '/admin/tutorial/img/translations-downloaded.png'; ?>">
@@ -98,3 +108,38 @@
98
  <td><?php _e('You have made changes to source content. The source must be sent to Lingotek again for additional translation.', 'lingotek-translation') ?></td>
99
  </tr>
100
  </table>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
18
  padding-left: 10px;
19
  }
20
  </style>
21
+ <h4>
22
+ <?php _e('What Does The Lingotek Translation Plugin Do?', 'lingotek-translation') ?>
23
+ <a id="cd-show-link-summary" class="dashicons dashicons-arrow-right" onclick="document.getElementById('ltk-summary').style.display = ''; document.getElementById('cd-hide-link-summary').style.display = ''; this.style.display = 'none'; return false;"></a>
24
+ <a id="cd-hide-link-summary" class="dashicons dashicons-arrow-down" onclick="document.getElementById('ltk-summary').style.display = 'none'; document.getElementById('cd-show-link-summary').style.display = ''; this.style.display = 'none'; return false;" style="display: none;"></a>
25
+ </h4>
26
+ <p id="ltk-summary" style="display:none; margin-left: 25px;"><?php _e('Lingotek works in conjunction with the Polylang plugin (the plumbing to make WordPress multilingual ready) simplifying the process of creating and maintaining your multilingual website. You write posts, pages, and create categories and post tags as usual, and then define the language for each of them.', 'lingotek-translation') ?></p>
27
 
28
+ <h4>
29
+ <?php _e('Lingotek Translation General Overview', 'lingotek-translation') ?>
30
+ <a id="cd-show-link-gen" class="dashicons dashicons-arrow-right" onclick="document.getElementById('gen-overview-tut').style.display = ''; document.getElementById('cd-hide-link-gen').style.display = ''; this.style.display = 'none'; return false;"></a>
31
+ <a id="cd-hide-link-gen" class="dashicons dashicons-arrow-down" onclick="document.getElementById('gen-overview-tut').style.display = 'none'; document.getElementById('cd-show-link-gen').style.display = ''; this.style.display = 'none'; return false;" style="display: none;"></a>
32
+ </h4>
33
+ <div id="gen-overview-tut" style="display:none;margin-left: 25px;">
34
+ <div>
35
+ <h4><?php _e('1. Create content', 'lingotek-translation') ?></h4>
36
+ <p><?php _e('Whether you write a blog post, create a page for your site, or have existing posts and pages, any of your Wordpress content can be uploaded to <i>Lingotek</i>.', 'lingotek-translation') ?>
37
+ <?php _e('The examples shown below are for Pages but translation for other content types works the same way!', 'lingotek-translation') ?></p>
38
+ <img class="lingotek-bordered" src="<?php echo LINGOTEK_URL . '/admin/tutorial/img/add-page.png'; ?>">
39
+ <p class="img-caption"><?php _e('Create a new page for translation.', 'lingotek-translation') ?></p>
40
+ </div>
41
+ <div>
42
+ <h4><?php _e('2. Upload content to Lingotek', 'lingotek-translation') ?></h4>
43
+ <p><?php _e('Your Wordpress content can be uploaded to <i>Lingotek</i> with the simple push of a button.', 'lingotek-translation') ?></p>
44
+ <img class="lingotek-bordered" src="<?php echo LINGOTEK_URL . '/admin/tutorial/img/ready-to-upload.png'; ?>">
45
+ <p class="img-caption"><?php _e('Content has been created and is ready for upload to Lingotek.', 'lingotek-translation') ?></p>
46
+ </div>
47
+ <div>
48
+ <h4><?php _e('3. Request translations for target languages', 'lingotek-translation') ?></h4>
49
+ <p><?php _e('Request translation for a specific language by clicking on the orange plus icon, for all languages at once, or in bulk by using the <i>Bulk Actions</i> dropdown.', 'lingotek-translation') ?></p>
50
+ <img class="lingotek-bordered" src="<?php echo LINGOTEK_URL . '/admin/tutorial/img/request-translations.png'; ?>">
51
+ <p class="img-caption"><?php _e('The source content is uploaded and ready for target languages.', 'lingotek-translation') ?></p>
52
+ </div>
53
+ <div>
54
+ <h4><?php _e('4. Translate your content', 'lingotek-translation') ?></h4>
55
+ <p><?php _e('Your content will now be translated into your selected target languages by free machine translation or, if you contract with <i>Lingotek</i>, professional translation services.', 'lingotek-translation') ?></p>
56
+ <img class="lingotek-bordered" src="<?php echo LINGOTEK_URL . '/admin/tutorial/img/translations-underway.png'; ?>">
57
+ <p class="img-caption"><?php _e('Your translations are underway.', 'lingotek-translation') ?></p>
58
+ </div>
59
+ <div>
60
+ <h4><?php _e('5. Download translations', 'lingotek-translation') ?></h4>
61
+ <p><?php _e('Once your translations are complete they will be marked ready for download. You can download translations for all languages, each language individually, or in bulk (using the <i>Bulk Actions</i> dropdown).', 'lingotek-translation') ?></p>
62
+ <img class="lingotek-bordered" src="<?php echo LINGOTEK_URL . '/admin/tutorial/img/translations-ready-for-download.png'; ?>">
63
+ <p class="img-caption"><?php _e('Your translations are ready for download.', 'lingotek-translation') ?></p>
64
+ </div>
65
+ <div>
66
  <h4><?php _e('6. Your content is translated!', 'lingotek-translation') ?></h4>
67
  <p><?php _e('The orange pencil icons indicate that your translations are finished, downloaded, and current within your Wordpress site. Clicking on any one of the pencils will direct you to the Lingotek Workbench for that specific language. Here you can make updates and changes to your translations if necessary.', 'lingotek-translation') ?></p>
68
  <img class="lingotek-bordered" src="<?php echo LINGOTEK_URL . '/admin/tutorial/img/translations-downloaded.png'; ?>">
108
  <td><?php _e('You have made changes to source content. The source must be sent to Lingotek again for additional translation.', 'lingotek-translation') ?></td>
109
  </tr>
110
  </table>
111
+ </div>
112
+ <h4 id="ltk-prof-trans-header">
113
+ <?php _e('Lingotek Professional Translation Overview', 'lingotek-translation') ?>
114
+ <a id="cd-show-link" class="dashicons dashicons-arrow-right" onclick="document.getElementById('pro-translation-tut').style.display = ''; document.getElementById('cd-hide-link').style.display = ''; this.style.display = 'none'; return false;" style="<?php if ('ltk-prof' === filter_input(INPUT_GET, 'tutorial')) { echo 'display: none;'; } ?>"></a>
115
+ <a id="cd-hide-link" class="dashicons dashicons-arrow-down" onclick="document.getElementById('pro-translation-tut').style.display = 'none'; document.getElementById('cd-show-link').style.display = ''; this.style.display = 'none'; return false;" style="<?php if ('ltk-prof' !== filter_input(INPUT_GET, 'tutorial')) { echo 'display: none;'; } ?>"></a>
116
+ </h4>
117
+ <div id="pro-translation-tut" style="<?php if ('ltk-prof' != filter_input(INPUT_GET, 'tutorial')) { echo 'display: none;'; } ?> margin-left: 25px;">
118
+ <h4><?php _e('What Is Lingotek Professional Translation?', 'lingotek-translation') ?></h4>
119
+ <p><?php _e('Lingotek Professional Translation is a workflow that allows you to connect with audiences around the globe using Lingotek\'s network of 5000+ professional, in-country, translators. Professional Translation ensures that your audiences will feel the sentiment of your content.', 'lingotek-translation') ?></p>
120
+ <h4><?php _e('How To Use', 'lingotek-translation') ?></h4>
121
+ <p><?php _e('Use the "Lingotek Professional Translation" workflow to enable this feature. This can be done from any of the following area in the Lingotek plugin settings:', 'lingotek-translation') ?></p>
122
+ <ul>
123
+ <li><strong><?php _e('Translation > Manage > Translation Profiles', 'lingotek-translation') ?></strong></li>
124
+ <li><strong><?php _e('Translation > Settings > Defaults', 'lingotek-translation') ?></strong></li>
125
+ </ul>
126
+ <img class="lingotek-bordered" src="<?php echo LINGOTEK_URL . '/admin/tutorial/img/combined-selection.png'; ?>">
127
+ <p><?php _e('After selecting this workflow a dialog box will pop up prompting you to enter a payment method. Clicking LATER will close the dialog box and allow you to come back later to add a payment method.', 'lingotek-translation') ?></p>
128
+ <img class="lingotek-bordered" src="<?php echo LINGOTEK_URL . '/admin/tutorial/img/selection-workflow-from-list.png'; ?>">
129
+ <p><?php _e('Clicking the ADD PAYMENT METHOD button will redirect you to the Lingotek Secure Payment Portal.', 'lingotek-translation') ?></p>
130
+ <img class="lingotek-bordered" src="<?php echo LINGOTEK_URL . '/admin/tutorial/img/redirected-to-payment-portal-screen.png'; ?>">
131
+ <p><?php _e('From the Payment Portal you will enter your payment information. Then you will be redirected back to your WordPress site.', 'lingotek-translation') ?></p>
132
+ <img class="lingotek-bordered" src="<?php echo LINGOTEK_URL . '/admin/tutorial/img/redirected-to-payment-portal.png'; ?>">
133
+ <p><?php _e('After the workflow has been set you can access the professional translation request menu by clicking on the orange plus icon located on any page that contains your posts.', 'lingotek-translation') ?></p>
134
+ <img class="lingotek-bordered" src="<?php echo LINGOTEK_URL . '/admin/tutorial/img/request-translations.png'; ?>">
135
+ <p><?php _e('When requesting a document for translation with the Lingotek Professional Translation workflow enabled you will see one of two dialog boxes. If you don\'t have a payment method set up you will see the following dialog box allowing you to view translation quotes on your selected documents.' , 'lingotek-translation') ?></p>
136
+ <img class="lingotek-bordered" src="<?php echo LINGOTEK_URL . '/admin/tutorial/img/quote-calculator.png'; ?>">
137
+ <p><?php _e('If you do have a payment method enabled you will see the following dialog box that will allow you to purchase your professional translations.', 'lingotek-translation') ?></p>
138
+ <img class="lingotek-bordered" src="<?php echo LINGOTEK_URL . '/admin/tutorial/img/higher-res-buy-now.png'; ?>">
139
+ <p><?php _e('After purchasing one or more professional translations you will see a success message and will receive a payment confirmation email.', 'lingotek-translation') ?></p>
140
+ <img class="lingotek-bordered" src="<?php echo LINGOTEK_URL . '/admin/tutorial/img/purchased.png'; ?>">
141
+ <p><?php _e('The status of your translation will change to the Translator icon while your document is being processed and translated.', 'lingotek-translation') ?></p>
142
+ <img class="lingotek-bordered" src="<?php echo LINGOTEK_URL . '/admin/tutorial/img/professional-translation-icon.png'; ?>">
143
+ <p><?php _e('You can set up or edit your payment method from the Translation > Settings > Account page.', 'lingotek-translation') ?></p>
144
+ <img class="lingotek-bordered" src="<?php echo LINGOTEK_URL . '/admin/tutorial/img/change-account-settings.png'; ?>">
145
+ </div>
admin/tutorial/features.php CHANGED
@@ -11,15 +11,20 @@
11
  <p><?php _e( "Machine translation is an excellent option if you're on a tight budget, looking for near-instant results, and are okay with less-than-perfect quality. The plugin allows you to quickly and automatically translate your site (the cost is covered by Lingotek for up to 100,000 characters).", 'lingotek-translation'); ?></p>
12
  </div>
13
  <div class="col">
14
- <img src="<?php echo LINGOTEK_URL . '/admin/tutorial/img/polylang-compatible.png'; ?>">
15
- <h3><?php _e( 'Fully compatible with Polylang', 'lingotek-translation' ); ?></h3>
16
- <p><?php printf( __( 'Polylang and Lingotek work together seamlessly. Continue to use Polylang for content that you want to translate inside WordPress, while sending other content to be translated by Lingotek. The <b style="color: %s">orange</b> icons indicate Lingotek statuses/actions while the <b style="color: %s">blue</b> icons continue to represent Polylang actions.', 'lingotek-translation' ), 'darkorange', '#0473a8' ); ?></p>
 
17
  </div>
18
-
19
  </div>
20
 
21
 
22
  <div class="feature-section three-col">
 
 
 
 
 
23
  <div class="col">
24
  <a href="admin.php?page=lingotek-translation_manage&amp;sm=profiles"><img src="<?php echo LINGOTEK_URL . '/admin/tutorial/img/translation-profiles.png'; ?>"></a>
25
  <h3><?php _e( 'Use translation profiles', 'lingotek-translation'); ?></h3>
@@ -30,12 +35,7 @@
30
  <h3><?php _e( 'Content type profiles', 'lingotek-translation'); ?></h3>
31
  <p><?php _e( 'Content type profiles. Manually choosing which content to upload and download is rarely what a content administrator wants to do, and automating the upload of every change is not workable because there are various types of content. Each type of translatable content can be assigned to a customizable profile. For example, by default, we like to have Posts use an <i>Automatic</i> profile so that content will automatically be uploaded for translation and the resulting translations automatically be downloaded back into WordPress.', 'lingotek-translation'); ?></p>
32
  </div>
33
- <div class="col">
34
- <img src="<?php echo LINGOTEK_URL . '/admin/tutorial/img/professional-translation.png'; ?>">
35
- <h3><?php _e( 'Request professional translation', 'lingotek-translation'); ?></h3>
36
- <p><?php _e( "Use your own translation agency or tap into Lingotek's network of more than 5,000+ in-country translators. Content transfer is fully automated between WordPress and Lingotek. You'll have full visibility into the translation process every step of the way. And once the translations are completed, they'll automatically download and publish to your website according to the preferences you've set.", 'lingotek-translation'); ?></p>
37
- <a href="http://www.lingotek.com/wordpress/request-professional-translation" class="button button-primary" target="_blank"><?php _e('Request Translation', 'lingotek-translation'); ?></a>
38
- </div>
39
  </div>
40
 
41
 
11
  <p><?php _e( "Machine translation is an excellent option if you're on a tight budget, looking for near-instant results, and are okay with less-than-perfect quality. The plugin allows you to quickly and automatically translate your site (the cost is covered by Lingotek for up to 100,000 characters).", 'lingotek-translation'); ?></p>
12
  </div>
13
  <div class="col">
14
+ <img src="<?php echo LINGOTEK_URL . '/admin/tutorial/img/professional-translation.png'; ?>">
15
+ <h3><?php _e( 'Request professional translation', 'lingotek-translation'); ?></h3>
16
+ <p><?php _e( "Use your own translation agency or tap into Lingotek's network of more than 5,000+ in-country translators. Content transfer is fully automated between WordPress and Lingotek. You'll have full visibility into the translation process every step of the way. And once the translations are completed, they'll automatically download and publish to your website according to the preferences you've set.", 'lingotek-translation'); ?></p>
17
+ <a href="<?php echo admin_url( 'admin.php?page=lingotek-translation_tutorial&sm=content&tutorial=ltk-prof#ltk-prof-trans-header' ) ?>" class="button button-primary"><?php _e('Learn More', 'lingotek-translation'); ?></a>
18
  </div>
 
19
  </div>
20
 
21
 
22
  <div class="feature-section three-col">
23
+ <div class="col">
24
+ <img src="<?php echo LINGOTEK_URL . '/admin/tutorial/img/polylang-compatible.png'; ?>">
25
+ <h3><?php _e( 'Fully compatible with Polylang', 'lingotek-translation' ); ?></h3>
26
+ <p><?php printf( __( 'Polylang and Lingotek work together seamlessly. Continue to use Polylang for content that you want to translate inside WordPress, while sending other content to be translated by Lingotek. The <b style="color: %s">orange</b> icons indicate Lingotek statuses/actions while the <b style="color: %s">blue</b> icons continue to represent Polylang actions.', 'lingotek-translation' ), 'darkorange', '#0473a8' ); ?></p>
27
+ </div>
28
  <div class="col">
29
  <a href="admin.php?page=lingotek-translation_manage&amp;sm=profiles"><img src="<?php echo LINGOTEK_URL . '/admin/tutorial/img/translation-profiles.png'; ?>"></a>
30
  <h3><?php _e( 'Use translation profiles', 'lingotek-translation'); ?></h3>
35
  <h3><?php _e( 'Content type profiles', 'lingotek-translation'); ?></h3>
36
  <p><?php _e( 'Content type profiles. Manually choosing which content to upload and download is rarely what a content administrator wants to do, and automating the upload of every change is not workable because there are various types of content. Each type of translatable content can be assigned to a customizable profile. For example, by default, we like to have Posts use an <i>Automatic</i> profile so that content will automatically be uploaded for translation and the resulting translations automatically be downloaded back into WordPress.', 'lingotek-translation'); ?></p>
37
  </div>
38
+
 
 
 
 
 
39
  </div>
40
 
41
 
admin/tutorial/img/change-account-settings.png ADDED
Binary file
admin/tutorial/img/combined-selection.png ADDED
Binary file
admin/tutorial/img/higher-res-buy-now.png ADDED
Binary file
admin/tutorial/img/payment-portal.png ADDED
Binary file
admin/tutorial/img/professional-translation-icon.png ADDED
Binary file
admin/tutorial/img/purchased.png ADDED
Binary file
admin/tutorial/img/quote-calculator.png ADDED
Binary file
admin/tutorial/img/redirected-to-payment-portal-screen.png ADDED
Binary file
admin/tutorial/img/redirected-to-payment-portal.png ADDED
Binary file
admin/tutorial/img/selecting-lingotek-prof-workflow.png ADDED
Binary file
admin/tutorial/img/selection-workflow-from-list.png ADDED
Binary file
admin/tutorial/img/with-payment-method.png ADDED
Binary file
admin/tutorial/img/workflow-select.png ADDED
Binary file
admin/workflows/workflow-factory.php CHANGED
@@ -26,8 +26,7 @@ class Lingotek_Workflow_Factory {
26
  * @var array
27
  */
28
  private static $map = array(
29
- 'ab6c522a-7645-4317-9284-3fbddf516151' => 'Lingotek_Professional_Translation_Workflow', // prod.
30
- '2e3694ae-9912-4a57-be47-cd1f8a08c469' => 'Lingotek_Professional_Translation_Workflow', // cms.
31
  );
32
 
33
  /**
26
  * @var array
27
  */
28
  private static $map = array(
29
+ 'ltk-professional-translation' => 'Lingotek_Professional_Translation_Workflow', // prod.
 
30
  );
31
 
32
  /**
css/admin.css CHANGED
@@ -94,3 +94,7 @@ a.dashicons {
94
  #utility_delete_documents {
95
  margin-left: 20px;
96
  }
 
 
 
 
94
  #utility_delete_documents {
95
  margin-left: 20px;
96
  }
97
+
98
+ .form-table {
99
+ clear: none !important;
100
+ }
js/updater.js CHANGED
@@ -44,6 +44,7 @@ jQuery(document).ready(function($) {
44
  },10000);
45
 
46
  function update_indicators(data){
 
47
  var doc_id_present = false;
48
  for(var key in data){
49
  if(data[key].doc_id !== null && data[key].doc_id !== undefined){
@@ -130,6 +131,21 @@ jQuery(document).ready(function($) {
130
  }
131
  }
132
  }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
133
  }
134
 
135
  function updateWorkbenchIcon(td, data, key, locale, title, icon){
44
  },10000);
45
 
46
  function update_indicators(data){
47
+ ignoreClicks();
48
  var doc_id_present = false;
49
  for(var key in data){
50
  if(data[key].doc_id !== null && data[key].doc_id !== undefined){
131
  }
132
  }
133
  }
134
+ Workflow.reload();
135
+ listenForClicks();
136
+ }
137
+
138
+ function ignoreClicks()
139
+ {
140
+ $(document).on('click', '.lingotek-color', ignoreClickHandler)
141
+ }
142
+ function listenForClicks()
143
+ {
144
+ $(document).off('click', '.lingotek-color', ignoreClickHandler);
145
+ }
146
+ function ignoreClickHandler(e)
147
+ {
148
+ e.preventDefault();
149
  }
150
 
151
  function updateWorkbenchIcon(td, data, key, locale, title, icon){
js/workflow/professional-workflow-defaults.js CHANGED
@@ -3,7 +3,7 @@ jQuery(document).ready(function() {
3
  if (Workflow.modals.get_url_parameter('success', window.location) &&
4
  Workflow.modals.get_url_parameter('page', window.location) === 'lingotek-translation_settings' &&
5
  Workflow.modals.get_url_parameter('sm', window.location) === 'defaults') {
6
- jQuery('#workflow_id').attr('value','ab6c522a-7645-4317-9284-3fbddf516151');
7
  jQuery('#submit').trigger('click');
8
  }
9
 
3
  if (Workflow.modals.get_url_parameter('success', window.location) &&
4
  Workflow.modals.get_url_parameter('page', window.location) === 'lingotek-translation_settings' &&
5
  Workflow.modals.get_url_parameter('sm', window.location) === 'defaults') {
6
+ jQuery('#workflow_id').attr('value','ltk-professional-translation');
7
  jQuery('#submit').trigger('click');
8
  }
9
 
js/workflow/professional-workflow.js CHANGED
@@ -5,26 +5,22 @@ jQuery(document).ready(function() {
5
  * auto updater.js
6
  */
7
  setInterval(function() {
8
- if (jQuery('#TB_ajaxWindowTitle').length === 0 )
9
- {
10
- tear_down();
11
- }
12
- else
13
- {
14
- if (jQuery('#TB_window').find('.request-table').length > 0)
15
- {
16
- jQuery('#TB_window').removeAttr('style');
17
- jQuery('#TB_window').addClass('ltk-thickbox');
18
- }
19
- else if (jQuery('#TB_window').find('.professional-upload-warning-header-container').length > 0)
20
- {
21
- jQuery('#TB_window').removeAttr('style');
22
- jQuery('#TB_window').addClass('ltk-thickbox-warning');
23
- }
24
- }
25
  },1000);
26
 
27
- var up = false;
 
 
 
28
 
29
  const MINIMUM = 59.99;
30
  const DEFAULT_MINIMUM_DELIVERY_DAYS = 3;
@@ -288,9 +284,8 @@ jQuery(document).ready(function() {
288
  row = get_post_or_taxonomy_row(post_id);
289
  }
290
 
291
-
292
  row.find('.dashicons-plus-lingotek').each(function(index, element) {
293
- var href = Workflow.modals.replace_href(element); /**jQuery(element).attr('href');*/
294
  var locale = Workflow.modals.get_url_parameter('locale', href);
295
  if (is_valid_locale(locale, valid_locales))
296
  {
5
  * auto updater.js
6
  */
7
  setInterval(function() {
8
+ if (jQuery('#TB_window').find('.request-table').length > 0)
9
+ {
10
+ jQuery('#TB_window').removeAttr('style');
11
+ jQuery('#TB_window').addClass('ltk-thickbox');
12
+ }
13
+ else if (jQuery('#TB_window').find('.professional-upload-warning-header-container').length > 0)
14
+ {
15
+ jQuery('#TB_window').removeAttr('style');
16
+ jQuery('#TB_window').addClass('ltk-thickbox-warning');
17
+ }
 
 
 
 
 
 
 
18
  },1000);
19
 
20
+ Workflow.reload_list.push(function() {
21
+ if (jQuery('#TB_ajaxWindowTitle').length === 0 )
22
+ tear_down();
23
+ });
24
 
25
  const MINIMUM = 59.99;
26
  const DEFAULT_MINIMUM_DELIVERY_DAYS = 3;
284
  row = get_post_or_taxonomy_row(post_id);
285
  }
286
 
 
287
  row.find('.dashicons-plus-lingotek').each(function(index, element) {
288
+ var href = jQuery(element).attr('href') !== '#' ? jQuery(element).attr('href') : jQuery(element).attr('url');
289
  var locale = Workflow.modals.get_url_parameter('locale', href);
290
  if (is_valid_locale(locale, valid_locales))
291
  {
js/workflow/workflow.js CHANGED
@@ -68,7 +68,7 @@ Workflow.modals.get_relative_url = function() {
68
  }
69
 
70
  Workflow.workflows = {
71
- 'ab6c522a-7645-4317-9284-3fbddf516151' : 'https://www.lingotek.com/'
72
  }
73
 
74
  Workflow.modals.show_payment_portal_loading_modal = function() {
@@ -78,6 +78,24 @@ Workflow.modals.show_payment_portal_loading_modal = function() {
78
  jQuery('.tb-close-icon').css('color','white');
79
  }
80
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
81
  function get_relative_url() {
82
  var url = window.location.href;
83
  var end = url.indexOf('wp-admin') + 'wp-admin'.length;
68
  }
69
 
70
  Workflow.workflows = {
71
+ 'ltk-professional-translation' : 'https://www.lingotek.com/'
72
  }
73
 
74
  Workflow.modals.show_payment_portal_loading_modal = function() {
78
  jQuery('.tb-close-icon').css('color','white');
79
  }
80
 
81
+ /**
82
+ * This is a list of functions that can be executed via the Workflow.reload() function. The updater removes and adds elements
83
+ * to the DOM and if you have any handlers on any elements they could be lost during the update.
84
+ */
85
+ Workflow.reload_list = [];
86
+
87
+ /**
88
+ * Refer to Workflow.reload_list[]. Any script can add a method to the reload_list array that will be executed as soon as the updater finishes.
89
+ */
90
+ Workflow.reload = function() {
91
+ jQuery.each(Workflow.reload_list, function(index, func) {
92
+ if (typeof func === 'function') {
93
+ func();
94
+ }
95
+ });
96
+ }
97
+
98
+
99
  function get_relative_url() {
100
  var url = window.location.href;
101
  var end = url.indexOf('wp-admin') + 'wp-admin'.length;
lingotek.php CHANGED
@@ -2,7 +2,7 @@
2
  /**
3
  Plugin name: Lingotek Translation
4
  Plugin URI: http://lingotek.com/wordpress#utm_source=wpadmin&utm_medium=plugin&utm_campaign=wplingotektranslationplugin
5
- Version: 1.3.1
6
  Author: Lingotek and Frédéric Demarle
7
  Author uri: http://lingotek.com
8
  Description: Lingotek offers convenient cloud-based localization and translation.
@@ -16,7 +16,7 @@ if ( ! function_exists( 'add_action' ) ) {
16
  exit();
17
  }
18
 
19
- define( 'LINGOTEK_VERSION', '1.3.1' ); // plugin version (should match above meta).
20
  define( 'LINGOTEK_MIN_PLL_VERSION', '1.8' );
21
  define( 'LINGOTEK_BASENAME', plugin_basename( __FILE__ ) ); // plugin name as known by WP.
22
  define( 'LINGOTEK_PLUGIN_SLUG', 'lingotek-translation' );// plugin slug (should match above meta: Text Domain).
@@ -188,7 +188,7 @@ class Lingotek {
188
  'si_LK' => 'si-LK',
189
  'sk_SK' => 'sk-SK',
190
  'sl_SI' => 'sl-SI',
191
- // 'so_SO' => 'so-SO',
192
  'sq' => 'sq-SQ',
193
  'sr_RS' => 'sr-CS',
194
  'su_ID' => 'su-ID',
@@ -298,6 +298,7 @@ class Lingotek {
298
  if ( ! get_option( 'lingotek_token' ) ) {
299
  add_action( 'init', array( &$this, 'lingotek_activation_pointer' ) );
300
  }
 
301
 
302
  // adds extra plugin compatibility - borrowed from Polylang.
303
  if ( ! defined( 'LINGOTEK_PLUGINS_COMPAT' ) || LINGOTEK_PLUGINS_COMPAT ) {
@@ -319,7 +320,10 @@ class Lingotek {
319
  $cr = get_option('lingotek_community_resources');
320
  if (is_array($cr) && isset($cr['workflows'])) {
321
  // put Lingotek Professional Translation at the top of the select box.
322
- $cr['workflows'] = array_merge(array('ab6c522a-7645-4317-9284-3fbddf516151' => 'Lingotek Professional Translation'), $cr['workflows']);
 
 
 
323
  update_option('lingotek_community_resources', $cr);
324
  }
325
  }
@@ -805,6 +809,36 @@ class Lingotek {
805
  new Lingotek_Pointer( $args );
806
  }
807
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
808
  public static function get_default_profiles() {
809
  $default_profiles = array();
810
 
2
  /**
3
  Plugin name: Lingotek Translation
4
  Plugin URI: http://lingotek.com/wordpress#utm_source=wpadmin&utm_medium=plugin&utm_campaign=wplingotektranslationplugin
5
+ Version: 1.3.2
6
  Author: Lingotek and Frédéric Demarle
7
  Author uri: http://lingotek.com
8
  Description: Lingotek offers convenient cloud-based localization and translation.
16
  exit();
17
  }
18
 
19
+ define( 'LINGOTEK_VERSION', '1.3.2' ); // plugin version (should match above meta).
20
  define( 'LINGOTEK_MIN_PLL_VERSION', '1.8' );
21
  define( 'LINGOTEK_BASENAME', plugin_basename( __FILE__ ) ); // plugin name as known by WP.
22
  define( 'LINGOTEK_PLUGIN_SLUG', 'lingotek-translation' );// plugin slug (should match above meta: Text Domain).
188
  'si_LK' => 'si-LK',
189
  'sk_SK' => 'sk-SK',
190
  'sl_SI' => 'sl-SI',
191
+ 'so_SO' => 'so-SO',
192
  'sq' => 'sq-SQ',
193
  'sr_RS' => 'sr-CS',
194
  'su_ID' => 'su-ID',
298
  if ( ! get_option( 'lingotek_token' ) ) {
299
  add_action( 'init', array( &$this, 'lingotek_activation_pointer' ) );
300
  }
301
+ add_action( 'init', array( &$this, 'lingotek_professional_translation_pointer' ) );
302
 
303
  // adds extra plugin compatibility - borrowed from Polylang.
304
  if ( ! defined( 'LINGOTEK_PLUGINS_COMPAT' ) || LINGOTEK_PLUGINS_COMPAT ) {
320
  $cr = get_option('lingotek_community_resources');
321
  if (is_array($cr) && isset($cr['workflows'])) {
322
  // put Lingotek Professional Translation at the top of the select box.
323
+ $cr['workflows'] = array_flip($cr['workflows']);
324
+ unset($cr['workflows']['Lingotek Professional Translation']);
325
+ $cr['workflows'] = array_flip($cr['workflows']);
326
+ $cr['workflows'] = array_merge(array('ltk-professional-translation' => 'Lingotek Professional Translation'), $cr['workflows']);
327
  update_option('lingotek_community_resources', $cr);
328
  }
329
  }
809
  new Lingotek_Pointer( $args );
810
  }
811
 
812
+ public function lingotek_professional_translation_pointer()
813
+ {
814
+ $content = __( 'Lingotek Professional Translation is now available!', 'lingotek-translation' );
815
+
816
+ $buttons = array(
817
+ array(
818
+ 'label' => __( 'Close' ),
819
+ ),
820
+ array(
821
+ 'label' => __( 'Learn More', 'lingotek-translation' ),
822
+ 'link' => admin_url( 'admin.php?page=lingotek-translation_tutorial&sm=content&tutorial=ltk-prof#ltk-prof-trans-header' ),
823
+ ),
824
+ );
825
+
826
+ $args = array(
827
+ 'pointer' => 'lingotek-professional-translation',
828
+ 'id' => 'toplevel_page_lingotek-translation',
829
+ 'position' => array(
830
+ 'edge' => 'bottom',
831
+ 'align' => 'left',
832
+ ),
833
+ 'width' => 380,
834
+ 'title' => __( 'New Feature', 'lingotek-translation' ),
835
+ 'content' => $content,
836
+ 'buttons' => $buttons,
837
+ );
838
+
839
+ new Lingotek_Pointer( $args );
840
+ }
841
+
842
  public static function get_default_profiles() {
843
  $default_profiles = array();
844
 
readme.txt CHANGED
@@ -4,7 +4,7 @@ Donate link: http://lingotek.com/
4
  Tags: automation, bilingual, international, language, Lingotek, localization, multilanguage, multilingual, translate, translation
5
  Requires at least: 3.8
6
  Tested up to: 4.8
7
- Stable tag: 1.3.1
8
  License: GPLv2 or later
9
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
10
 
@@ -122,6 +122,12 @@ For more, visit the [Lingotek documentation site](https://lingotek.atlassian.net
122
 
123
  == Changelog ==
124
 
 
 
 
 
 
 
125
  = 1.3.1 (2017-7-13) =
126
 
127
  * Added the ability to trigger auto-uploading of custom post statuses (Thanks to Soluto for contributing this feature!)
4
  Tags: automation, bilingual, international, language, Lingotek, localization, multilanguage, multilingual, translate, translation
5
  Requires at least: 3.8
6
  Tested up to: 4.8
7
+ Stable tag: 1.3.2
8
  License: GPLv2 or later
9
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
10
 
122
 
123
  == Changelog ==
124
 
125
+ = 1.3.2 (2017-8-8) =
126
+
127
+ * Updated string group action links to support multi-word titles
128
+ * Stabilized the relationship between the auto-updater and the Lingotek Professional Workflow UI
129
+ * Added tutorial for the Lingotek Professional Translation workflow
130
+
131
  = 1.3.1 (2017-7-13) =
132
 
133
  * Added the ability to trigger auto-uploading of custom post statuses (Thanks to Soluto for contributing this feature!)