Version Description
(2016-1-19) =
- Updated code to be compatible with Polylang 1.8 structural changes
- Minor bug fixes
Download this release
Release Info
Developer | erichie |
Plugin | Lingotek Translation |
Version | 1.1.9 |
Comparing to | |
See all releases |
Code changes from version 1.1.8 to 1.1.9
- admin/actions.php +26 -26
- admin/admin.php +34 -34
- admin/content-table.php +5 -5
- admin/custom-fields-table.php +2 -2
- admin/filters-columns.php +8 -8
- admin/filters-media.php +1 -1
- admin/filters-post.php +6 -6
- admin/filters-term.php +1 -1
- admin/manage/view-content.php +6 -6
- admin/manage/view-custom-fields.php +7 -7
- admin/manage/view-edit-profile.php +18 -18
- admin/manage/view-profiles.php +9 -9
- admin/manage/view-string-groups.php +5 -5
- admin/manage/view-strings.php +2 -2
- admin/post-actions.php +12 -12
- admin/profiles-table.php +10 -10
- admin/settings.php +8 -8
- admin/settings/connect-account.php +5 -5
- admin/settings/view-account.php +14 -14
- admin/settings/view-defaults.php +16 -16
- admin/settings/view-preferences.php +22 -22
- admin/settings/view-utilities.php +9 -9
- admin/string-actions.php +2 -2
- admin/strings-table.php +2 -2
- admin/term-actions.php +2 -2
- admin/tutorial/content.php +33 -33
- admin/tutorial/credits.php +3 -3
- admin/tutorial/faq.php +29 -29
- admin/tutorial/features.php +24 -24
- admin/utilities.php +1 -1
- admin/view-dashboard.php +1 -1
- admin/view-manage.php +8 -8
- admin/view-network.php +23 -23
- admin/view-tutorial.php +9 -9
- include/api.php +11 -11
- include/dashboard.php +6 -6
- include/group-post.php +11 -11
- include/group-term.php +7 -7
- include/model.php +13 -9
- js/updater.js +1 -0
- languages/wp-lingotek-fr_FR.po +1 -1
- lingotek.php +22 -22
- readme.txt +9 -4
admin/actions.php
CHANGED
@@ -18,85 +18,85 @@ abstract class Lingotek_Actions {
|
|
18 |
*/
|
19 |
public function __construct($type) {
|
20 |
// confirm message
|
21 |
-
self::$confirm_message = sprintf(' onclick = "return confirm(\'%s\');"', __('You are about to overwrite existing translations. Are you sure?', '
|
22 |
|
23 |
// row actions
|
24 |
self::$actions = array(
|
25 |
'upload' => array(
|
26 |
-
'action' => __('Upload to Lingotek', '
|
27 |
-
'progress' => __('Uploading...', '
|
28 |
-
'description' => __('Upload this item to Lingotek TMS', '
|
29 |
),
|
30 |
|
31 |
'request' => array(
|
32 |
-
'action' => __('Request translations', '
|
33 |
-
'progress' => __('Requesting translations...', '
|
34 |
-
'description' => __('Request translations of this item to Lingotek TMS', '
|
35 |
),
|
36 |
|
37 |
'status' => array(
|
38 |
-
'action' => __('Update translations status', '
|
39 |
-
'progress' => __('Updating translations status...', '
|
40 |
-
'description' => __('Update translations status of this item in Lingotek TMS', '
|
41 |
),
|
42 |
|
43 |
'download' => array(
|
44 |
-
'action' => __('Download translations', '
|
45 |
-
'progress' => __('Downloading translations...', '
|
46 |
-
'description' => __('Download translations of this item from Lingotek TMS', '
|
47 |
),
|
48 |
|
49 |
'delete' => array(
|
50 |
-
'action' => __('Disassociate translations', '
|
51 |
-
'progress' => __('Disassociating translations...', '
|
52 |
-
'description' => __('Disassociate the translations of this item from Lingotek TMS', '
|
53 |
),
|
54 |
);
|
55 |
|
56 |
// action icons
|
57 |
self::$icons = array(
|
58 |
'upload' => array(
|
59 |
-
'title' => __('Upload Now', '
|
60 |
'icon' => 'upload'
|
61 |
),
|
62 |
|
63 |
'importing' => array(
|
64 |
-
'title' => __('Importing source', '
|
65 |
'icon' => 'clock'
|
66 |
),
|
67 |
|
68 |
'uploaded' => array(
|
69 |
-
'title' => __('Source uploaded', '
|
70 |
'icon' => 'yes'
|
71 |
),
|
72 |
|
73 |
'request' => array(
|
74 |
-
'title' => __('Request a translation', '
|
75 |
'icon' => 'plus'
|
76 |
),
|
77 |
|
78 |
'pending' => array(
|
79 |
-
'title' => __('In Progress', '
|
80 |
'icon' => 'clock'
|
81 |
),
|
82 |
|
83 |
'ready' => array(
|
84 |
-
'title' => __('Ready to download', '
|
85 |
'icon' => 'download'
|
86 |
),
|
87 |
|
88 |
'current' => array(
|
89 |
-
'title' => __('Current', '
|
90 |
'icon' => 'edit'
|
91 |
),
|
92 |
|
93 |
'not-current' => array(
|
94 |
-
'title' => __('The target translation is no longer current as the source content has been updated', '
|
95 |
'icon' => 'edit'
|
96 |
),
|
97 |
|
98 |
'error' => array(
|
99 |
-
'title' => __('There was an error contacting Lingotek', '
|
100 |
'icon' => 'warning'
|
101 |
),
|
102 |
);
|
@@ -393,7 +393,7 @@ abstract class Lingotek_Actions {
|
|
393 |
'taxonomy' => empty($_GET['taxonomy']) || !taxonomy_exists($_GET['taxonomy']) ? '' : $_GET['taxonomy'],
|
394 |
'sendback' => remove_query_arg( array('bulk-lingotek-' . $action, 'ids', 'lingotek_warning'), wp_get_referer() ),
|
395 |
'ids' => array_map('intval', explode(',', $_GET['ids'])),
|
396 |
-
'warning' => empty($_GET['lingotek_warning']) ? '' : __('You are about to overwrite existing translations. Are you sure?', '
|
397 |
'nonce' => wp_create_nonce('lingotek_progress')
|
398 |
));
|
399 |
return;
|
18 |
*/
|
19 |
public function __construct($type) {
|
20 |
// confirm message
|
21 |
+
self::$confirm_message = sprintf(' onclick = "return confirm(\'%s\');"', __('You are about to overwrite existing translations. Are you sure?', 'lingotek-translation'));
|
22 |
|
23 |
// row actions
|
24 |
self::$actions = array(
|
25 |
'upload' => array(
|
26 |
+
'action' => __('Upload to Lingotek', 'lingotek-translation'),
|
27 |
+
'progress' => __('Uploading...', 'lingotek-translation'),
|
28 |
+
'description' => __('Upload this item to Lingotek TMS', 'lingotek-translation' ),
|
29 |
),
|
30 |
|
31 |
'request' => array(
|
32 |
+
'action' => __('Request translations', 'lingotek-translation'),
|
33 |
+
'progress' => __('Requesting translations...', 'lingotek-translation'),
|
34 |
+
'description' => __('Request translations of this item to Lingotek TMS', 'lingotek-translation' ),
|
35 |
),
|
36 |
|
37 |
'status' => array(
|
38 |
+
'action' => __('Update translations status', 'lingotek-translation'),
|
39 |
+
'progress' => __('Updating translations status...', 'lingotek-translation'),
|
40 |
+
'description' => __('Update translations status of this item in Lingotek TMS', 'lingotek-translation' ),
|
41 |
),
|
42 |
|
43 |
'download' => array(
|
44 |
+
'action' => __('Download translations', 'lingotek-translation'),
|
45 |
+
'progress' => __('Downloading translations...', 'lingotek-translation'),
|
46 |
+
'description' => __('Download translations of this item from Lingotek TMS', 'lingotek-translation' ),
|
47 |
),
|
48 |
|
49 |
'delete' => array(
|
50 |
+
'action' => __('Disassociate translations', 'lingotek-translation'),
|
51 |
+
'progress' => __('Disassociating translations...', 'lingotek-translation'),
|
52 |
+
'description' => __('Disassociate the translations of this item from Lingotek TMS', 'lingotek-translation' ),
|
53 |
),
|
54 |
);
|
55 |
|
56 |
// action icons
|
57 |
self::$icons = array(
|
58 |
'upload' => array(
|
59 |
+
'title' => __('Upload Now', 'lingotek-translation'),
|
60 |
'icon' => 'upload'
|
61 |
),
|
62 |
|
63 |
'importing' => array(
|
64 |
+
'title' => __('Importing source', 'lingotek-translation'),
|
65 |
'icon' => 'clock'
|
66 |
),
|
67 |
|
68 |
'uploaded' => array(
|
69 |
+
'title' => __('Source uploaded', 'lingotek-translation'),
|
70 |
'icon' => 'yes'
|
71 |
),
|
72 |
|
73 |
'request' => array(
|
74 |
+
'title' => __('Request a translation', 'lingotek-translation'),
|
75 |
'icon' => 'plus'
|
76 |
),
|
77 |
|
78 |
'pending' => array(
|
79 |
+
'title' => __('In Progress', 'lingotek-translation'),
|
80 |
'icon' => 'clock'
|
81 |
),
|
82 |
|
83 |
'ready' => array(
|
84 |
+
'title' => __('Ready to download', 'lingotek-translation'),
|
85 |
'icon' => 'download'
|
86 |
),
|
87 |
|
88 |
'current' => array(
|
89 |
+
'title' => __('Current', 'lingotek-translation'),
|
90 |
'icon' => 'edit'
|
91 |
),
|
92 |
|
93 |
'not-current' => array(
|
94 |
+
'title' => __('The target translation is no longer current as the source content has been updated', 'lingotek-translation'),
|
95 |
'icon' => 'edit'
|
96 |
),
|
97 |
|
98 |
'error' => array(
|
99 |
+
'title' => __('There was an error contacting Lingotek', 'lingotek-translation'),
|
100 |
'icon' => 'warning'
|
101 |
),
|
102 |
);
|
393 |
'taxonomy' => empty($_GET['taxonomy']) || !taxonomy_exists($_GET['taxonomy']) ? '' : $_GET['taxonomy'],
|
394 |
'sendback' => remove_query_arg( array('bulk-lingotek-' . $action, 'ids', 'lingotek_warning'), wp_get_referer() ),
|
395 |
'ids' => array_map('intval', explode(',', $_GET['ids'])),
|
396 |
+
'warning' => empty($_GET['lingotek_warning']) ? '' : __('You are about to overwrite existing translations. Are you sure?', 'lingotek-translation'),
|
397 |
'nonce' => wp_create_nonce('lingotek_progress')
|
398 |
));
|
399 |
return;
|
admin/admin.php
CHANGED
@@ -22,7 +22,7 @@ class Lingotek_Admin {
|
|
22 |
// adds the link to the languages panel in the wordpress admin menu
|
23 |
add_action('admin_menu', array(&$this, 'add_menus'));
|
24 |
|
25 |
-
add_action('load-
|
26 |
add_filter('set-screen-option', array($this, 'set_screen_option'), 10, 3);
|
27 |
|
28 |
add_action('wp_ajax_'.$this->ajax_dashboard_language_endpoint, array(&$this->dashboard, 'ajax_language_dashboard'));
|
@@ -74,7 +74,7 @@ class Lingotek_Admin {
|
|
74 |
$source_id = $document->source !== null ? $document->source : $object_id;
|
75 |
$source_language = $terms ? pll_get_term_language($document->source, 'locale')
|
76 |
: pll_get_post_language($document->source, 'locale');
|
77 |
-
$existing_translations = $
|
78 |
|
79 |
if(count($existing_translations) > 1){
|
80 |
$content_metadata[$id]['existing_trans'] = true;
|
@@ -170,12 +170,12 @@ class Lingotek_Admin {
|
|
170 |
// 2 => 1 if loaded in footer
|
171 |
// FIXME: check if I can load more scripts in footer
|
172 |
$scripts = array(
|
173 |
-
'progress' => array(array('edit', 'upload', 'edit-tags', '
|
174 |
'updater' => array(array('edit', 'upload', 'edit-tags'), array('jquery-ui-progressbar', 'jquery-ui-dialog', 'wp-ajax-response'), 1),
|
175 |
);
|
176 |
|
177 |
$styles = array(
|
178 |
-
'admin' => array(array('edit', 'upload', 'edit-tags', '
|
179 |
);
|
180 |
|
181 |
foreach ($scripts as $script => $v)
|
@@ -196,7 +196,7 @@ class Lingotek_Admin {
|
|
196 |
* @return array modified list of links
|
197 |
*/
|
198 |
public function plugin_action_links($links) {
|
199 |
-
array_unshift($links, '<a href="admin.php?page=
|
200 |
return $links;
|
201 |
}
|
202 |
|
@@ -207,17 +207,17 @@ class Lingotek_Admin {
|
|
207 |
*/
|
208 |
public function add_menus() {
|
209 |
add_menu_page(
|
210 |
-
$title = __('Translation', '
|
211 |
$title,
|
212 |
'manage_options',
|
213 |
$this->plugin_slug,
|
214 |
array($this, 'display_dashboard_page'), 'dashicons-translation'
|
215 |
);
|
216 |
|
217 |
-
add_submenu_page($this->plugin_slug, __('Translation Dashboard', '
|
218 |
-
add_submenu_page($this->plugin_slug, __('Translation Management', '
|
219 |
-
add_submenu_page($this->plugin_slug, __('Translation Settings', '
|
220 |
-
add_submenu_page($this->plugin_slug, __('Lingotek Tutorial', '
|
221 |
}
|
222 |
|
223 |
/*
|
@@ -241,29 +241,29 @@ class Lingotek_Admin {
|
|
241 |
$token_details = $client->get_token_details($_GET['access_token']);
|
242 |
if ($token_details && strlen($token_details->login_id)) {
|
243 |
update_option('lingotek_token', array('access_token' => $_GET['access_token'], 'login_id' => $token_details->login_id));
|
244 |
-
add_settings_error( 'lingotek_token', 'account-connection', __('Your Lingotek account has been successfully connected.', '
|
245 |
}
|
246 |
else {
|
247 |
-
add_settings_error('lingotek_token', 'account-connection', __('Your Lingotek account was not connected. The Access Token received was invalid.', '
|
248 |
}
|
249 |
}
|
250 |
|
251 |
// set page key primarily used for form submissions
|
252 |
$page_key = $this->plugin_slug.'_settings';
|
253 |
if(isset($_GET['sm'])){
|
254 |
-
$page_key .= '&sm='
|
255 |
}
|
256 |
|
257 |
// set community
|
258 |
if (!empty($_POST) && key_exists('lingotek_community', $_POST) && strlen($_POST['lingotek_community'])) {
|
259 |
check_admin_referer($page_key, '_wpnonce_' . $page_key);
|
260 |
update_option('lingotek_community', $_POST['lingotek_community']);
|
261 |
-
add_settings_error('lingotek_community', 'update', __('Your community has been successfully saved.', '
|
262 |
$this->set_community_resources($_POST['lingotek_community']);
|
263 |
}
|
264 |
$community_id = get_option('lingotek_community');
|
265 |
if (!$community_id) {
|
266 |
-
add_settings_error('lingotek_community', 'error', __('Select and save the community that you would like to use.', '
|
267 |
}
|
268 |
|
269 |
$token_details = self::has_token_details();
|
@@ -287,7 +287,7 @@ class Lingotek_Admin {
|
|
287 |
update_option('lingotek_base_url', Lingotek_API::PRODUCTION_URL);
|
288 |
}
|
289 |
$client = new Lingotek_API();
|
290 |
-
echo '<div class="wrap"><p class="description">'.__("Redirecting to Lingotek to connect your account...",'
|
291 |
|
292 |
$connect_url = (strcasecmp($_GET['connect'],'new')==0) ? $client->get_new_url($redirect_url) : $client->get_connect_url($redirect_url);
|
293 |
}
|
@@ -308,40 +308,40 @@ class Lingotek_Admin {
|
|
308 |
public function get_profiles_settings($defaults = false) {
|
309 |
$resources = get_option('lingotek_community_resources');
|
310 |
$options = array(
|
311 |
-
'manual' => __('Manual', '
|
312 |
-
'automatic' => __('Automatic', '
|
313 |
);
|
314 |
|
315 |
return array(
|
316 |
'upload' => array(
|
317 |
-
'label' => __('Upload content', '
|
318 |
'options' => $options,
|
319 |
-
'description' => __('How should new and modified content be uploaded to Lingotek?', '
|
320 |
),
|
321 |
'download' => array(
|
322 |
-
'label' => __('Download translations', '
|
323 |
'options' => $options,
|
324 |
-
'description' => __('How should completed translations be downloaded to WordPress?', '
|
325 |
),
|
326 |
'project_id' => array(
|
327 |
-
'label' => $defaults ? __('Default Project', '
|
328 |
'options' => $resources['projects'],
|
329 |
-
'description' => __('Changes will affect new entities only', '
|
330 |
),
|
331 |
'workflow_id' => array(
|
332 |
-
'label' => $defaults ? __('Default Workflow', '
|
333 |
'options' => $resources['workflows'],
|
334 |
-
'description' => __('Changes will affect new entities only', '
|
335 |
),
|
336 |
'primary_filter_id' => array(
|
337 |
-
'label' => $defaults ? __('Primary Filter', '
|
338 |
'options' => $resources['filters'],
|
339 |
-
'description' => __('Changes will affect new entities only', '
|
340 |
),
|
341 |
'secondary_filter_id' => array(
|
342 |
-
'label' => $defaults ? __('Secondary Filter', '
|
343 |
'options' => $resources['filters'],
|
344 |
-
'description' => __('Changes will affect new entities only', '
|
345 |
),
|
346 |
);
|
347 |
}
|
@@ -494,7 +494,7 @@ class Lingotek_Admin {
|
|
494 |
$num_valid_defaults = array_sum($valid_default);
|
495 |
|
496 |
if($num_valid_defaults < count($valid_default)){
|
497 |
-
add_settings_error( 'lingotek_defaults', 'community-selected', sprintf(__('Your <a href="%s"><i>Defaults</i></a> have been updated to valid options for this community.', '
|
498 |
}
|
499 |
unset($defaults['filter_id']);
|
500 |
update_option('lingotek_defaults', $defaults);
|
@@ -521,7 +521,7 @@ class Lingotek_Admin {
|
|
521 |
*/
|
522 |
public function load_manage_page() {
|
523 |
add_screen_option('per_page', array(
|
524 |
-
'label' => __('Strings groups', '
|
525 |
'default' => 10,
|
526 |
'option' => 'lingotek_strings_per_page'
|
527 |
));
|
@@ -610,7 +610,7 @@ class Lingotek_Admin {
|
|
610 |
* @since 0.1.0
|
611 |
*/
|
612 |
public function add_network_admin_menu() {
|
613 |
-
add_submenu_page('settings.php', __('Lingotek Settings', '
|
614 |
}
|
615 |
|
616 |
public function display_tutorial_page() {
|
@@ -622,4 +622,4 @@ class Lingotek_Admin {
|
|
622 |
}
|
623 |
}
|
624 |
|
625 |
-
}
|
22 |
// adds the link to the languages panel in the wordpress admin menu
|
23 |
add_action('admin_menu', array(&$this, 'add_menus'));
|
24 |
|
25 |
+
add_action('load-translation_page_lingotek-translation_manage', array(&$this, 'load_manage_page'));
|
26 |
add_filter('set-screen-option', array($this, 'set_screen_option'), 10, 3);
|
27 |
|
28 |
add_action('wp_ajax_'.$this->ajax_dashboard_language_endpoint, array(&$this->dashboard, 'ajax_language_dashboard'));
|
74 |
$source_id = $document->source !== null ? $document->source : $object_id;
|
75 |
$source_language = $terms ? pll_get_term_language($document->source, 'locale')
|
76 |
: pll_get_post_language($document->source, 'locale');
|
77 |
+
$existing_translations = $type = 'term' ? PLL()->model->term->get_translations($source_id) : PLL()->model->post->get_translations($source_id);
|
78 |
|
79 |
if(count($existing_translations) > 1){
|
80 |
$content_metadata[$id]['existing_trans'] = true;
|
170 |
// 2 => 1 if loaded in footer
|
171 |
// FIXME: check if I can load more scripts in footer
|
172 |
$scripts = array(
|
173 |
+
'progress' => array(array('edit', 'upload', 'edit-tags', 'translation_page_lingotek-translation_manage', 'translation_page_lingotek-translation_settings'), array('jquery-ui-progressbar', 'jquery-ui-dialog', 'wp-ajax-response'), 1),
|
174 |
'updater' => array(array('edit', 'upload', 'edit-tags'), array('jquery-ui-progressbar', 'jquery-ui-dialog', 'wp-ajax-response'), 1),
|
175 |
);
|
176 |
|
177 |
$styles = array(
|
178 |
+
'admin' => array(array('edit', 'upload', 'edit-tags', 'translation_page_lingotek-translation_manage', 'translation_page_lingotek-translation_settings'), array('wp-jquery-ui-dialog')),
|
179 |
);
|
180 |
|
181 |
foreach ($scripts as $script => $v)
|
196 |
* @return array modified list of links
|
197 |
*/
|
198 |
public function plugin_action_links($links) {
|
199 |
+
array_unshift($links, '<a href="admin.php?page=lingotek-translation">' . __('Settings', 'lingotek-translation') . '</a>');
|
200 |
return $links;
|
201 |
}
|
202 |
|
207 |
*/
|
208 |
public function add_menus() {
|
209 |
add_menu_page(
|
210 |
+
$title = __('Translation', 'lingotek-translation'),
|
211 |
$title,
|
212 |
'manage_options',
|
213 |
$this->plugin_slug,
|
214 |
array($this, 'display_dashboard_page'), 'dashicons-translation'
|
215 |
);
|
216 |
|
217 |
+
add_submenu_page($this->plugin_slug, __('Translation Dashboard', 'lingotek-translation'), __('Dashboard', 'lingotek-translation'), 'manage_options', $this->plugin_slug, array($this, 'display_dashboard_page'));
|
218 |
+
add_submenu_page($this->plugin_slug, __('Translation Management', 'lingotek-translation'), __('Manage', 'lingotek-translation'), 'manage_options', $this->plugin_slug . '_manage', array($this, 'display_manage_page'));
|
219 |
+
add_submenu_page($this->plugin_slug, __('Translation Settings', 'lingotek-translation'), __('Settings', 'lingotek-translation'), 'manage_options', $this->plugin_slug . '_settings', array($this, 'display_settings_page'));
|
220 |
+
add_submenu_page($this->plugin_slug, __('Lingotek Tutorial', 'lingotek-translation'), __('Tutorial', 'lingotek-translation'), 'manage_options', $this->plugin_slug . '_tutorial', array($this, 'display_tutorial_page'));
|
221 |
}
|
222 |
|
223 |
/*
|
241 |
$token_details = $client->get_token_details($_GET['access_token']);
|
242 |
if ($token_details && strlen($token_details->login_id)) {
|
243 |
update_option('lingotek_token', array('access_token' => $_GET['access_token'], 'login_id' => $token_details->login_id));
|
244 |
+
add_settings_error( 'lingotek_token', 'account-connection', __('Your Lingotek account has been successfully connected.', 'lingotek-translation'), 'updated' );
|
245 |
}
|
246 |
else {
|
247 |
+
add_settings_error('lingotek_token', 'account-connection', __('Your Lingotek account was not connected. The Access Token received was invalid.', 'lingotek-translation'), 'error');
|
248 |
}
|
249 |
}
|
250 |
|
251 |
// set page key primarily used for form submissions
|
252 |
$page_key = $this->plugin_slug.'_settings';
|
253 |
if(isset($_GET['sm'])){
|
254 |
+
$page_key .= '&sm='.sanitize_text_field($_GET['sm']);
|
255 |
}
|
256 |
|
257 |
// set community
|
258 |
if (!empty($_POST) && key_exists('lingotek_community', $_POST) && strlen($_POST['lingotek_community'])) {
|
259 |
check_admin_referer($page_key, '_wpnonce_' . $page_key);
|
260 |
update_option('lingotek_community', $_POST['lingotek_community']);
|
261 |
+
add_settings_error('lingotek_community', 'update', __('Your community has been successfully saved.', 'lingotek-translation'), 'updated');
|
262 |
$this->set_community_resources($_POST['lingotek_community']);
|
263 |
}
|
264 |
$community_id = get_option('lingotek_community');
|
265 |
if (!$community_id) {
|
266 |
+
add_settings_error('lingotek_community', 'error', __('Select and save the community that you would like to use.', 'lingotek-translation'), 'error');
|
267 |
}
|
268 |
|
269 |
$token_details = self::has_token_details();
|
287 |
update_option('lingotek_base_url', Lingotek_API::PRODUCTION_URL);
|
288 |
}
|
289 |
$client = new Lingotek_API();
|
290 |
+
echo '<div class="wrap"><p class="description">'.__("Redirecting to Lingotek to connect your account...",'lingotek-translation').'</p></div>';
|
291 |
|
292 |
$connect_url = (strcasecmp($_GET['connect'],'new')==0) ? $client->get_new_url($redirect_url) : $client->get_connect_url($redirect_url);
|
293 |
}
|
308 |
public function get_profiles_settings($defaults = false) {
|
309 |
$resources = get_option('lingotek_community_resources');
|
310 |
$options = array(
|
311 |
+
'manual' => __('Manual', 'lingotek-translation'),
|
312 |
+
'automatic' => __('Automatic', 'lingotek-translation')
|
313 |
);
|
314 |
|
315 |
return array(
|
316 |
'upload' => array(
|
317 |
+
'label' => __('Upload content', 'lingotek-translation'),
|
318 |
'options' => $options,
|
319 |
+
'description' => __('How should new and modified content be uploaded to Lingotek?', 'lingotek-translation')
|
320 |
),
|
321 |
'download' => array(
|
322 |
+
'label' => __('Download translations', 'lingotek-translation'),
|
323 |
'options' => $options,
|
324 |
+
'description' => __('How should completed translations be downloaded to WordPress?', 'lingotek-translation')
|
325 |
),
|
326 |
'project_id' => array(
|
327 |
+
'label' => $defaults ? __('Default Project', 'lingotek-translation') : __('Project', 'lingotek-translation'),
|
328 |
'options' => $resources['projects'],
|
329 |
+
'description' => __('Changes will affect new entities only', 'lingotek-translation')
|
330 |
),
|
331 |
'workflow_id' => array(
|
332 |
+
'label' => $defaults ? __('Default Workflow', 'lingotek-translation') : __('Workflow', 'lingotek-translation'),
|
333 |
'options' => $resources['workflows'],
|
334 |
+
'description' => __('Changes will affect new entities only', 'lingotek-translation')
|
335 |
),
|
336 |
'primary_filter_id' => array(
|
337 |
+
'label' => $defaults ? __('Primary Filter', 'lingotek-translation') : __('Primary Filter', 'lingotek-translation'),
|
338 |
'options' => $resources['filters'],
|
339 |
+
'description' => __('Changes will affect new entities only', 'lingotek-translation')
|
340 |
),
|
341 |
'secondary_filter_id' => array(
|
342 |
+
'label' => $defaults ? __('Secondary Filter', 'lingotek-translation') : __('Secondary Filter', 'lingotek-translation'),
|
343 |
'options' => $resources['filters'],
|
344 |
+
'description' => __('Changes will affect new entities only', 'lingotek-translation')
|
345 |
),
|
346 |
);
|
347 |
}
|
494 |
$num_valid_defaults = array_sum($valid_default);
|
495 |
|
496 |
if($num_valid_defaults < count($valid_default)){
|
497 |
+
add_settings_error( 'lingotek_defaults', 'community-selected', sprintf(__('Your <a href="%s"><i>Defaults</i></a> have been updated to valid options for this community.', 'lingotek-translation'), admin_url('admin.php?page=lingotek-translation_settings&sm=defaults')), 'updated' );
|
498 |
}
|
499 |
unset($defaults['filter_id']);
|
500 |
update_option('lingotek_defaults', $defaults);
|
521 |
*/
|
522 |
public function load_manage_page() {
|
523 |
add_screen_option('per_page', array(
|
524 |
+
'label' => __('Strings groups', 'lingotek-translation'),
|
525 |
'default' => 10,
|
526 |
'option' => 'lingotek_strings_per_page'
|
527 |
));
|
610 |
* @since 0.1.0
|
611 |
*/
|
612 |
public function add_network_admin_menu() {
|
613 |
+
add_submenu_page('settings.php', __('Lingotek Settings', 'lingotek-translation'), __('Lingotek Settings', 'lingotek-translation'), 'manage_network_options', $this->plugin_slug . '_network', array($this, 'display_network_settings_page'), 'dashicons-translation');
|
614 |
}
|
615 |
|
616 |
public function display_tutorial_page() {
|
622 |
}
|
623 |
}
|
624 |
|
625 |
+
}
|
admin/content-table.php
CHANGED
@@ -58,7 +58,7 @@ class Lingotek_Content_Table extends WP_List_Table {
|
|
58 |
|
59 |
printf('<ul class="sources-name" id="sources-name[%s]" style="display:none;">', $item['type']);
|
60 |
foreach ($polylang->model->get_languages_list() as $language) {
|
61 |
-
printf('<li>%s</li>', sprintf(__('%s source', '
|
62 |
}
|
63 |
echo '</ul>';
|
64 |
}
|
@@ -82,7 +82,7 @@ class Lingotek_Content_Table extends WP_List_Table {
|
|
82 |
}
|
83 |
echo '</select>';
|
84 |
|
85 |
-
$options = array_merge(array('default' => array('name' => __('Use content type default', '
|
86 |
|
87 |
// the source language for strings is always the default language
|
88 |
if ('string' != $item['type']) {
|
@@ -153,9 +153,9 @@ class Lingotek_Content_Table extends WP_List_Table {
|
|
153 |
*/
|
154 |
function get_columns() {
|
155 |
return array(
|
156 |
-
'name' => __('Content Type', '
|
157 |
-
'profile' => __('Profile', '
|
158 |
-
'fields' => __('Fields', '
|
159 |
);
|
160 |
}
|
161 |
|
58 |
|
59 |
printf('<ul class="sources-name" id="sources-name[%s]" style="display:none;">', $item['type']);
|
60 |
foreach ($polylang->model->get_languages_list() as $language) {
|
61 |
+
printf('<li>%s</li>', sprintf(__('%s source', 'lingotek-translation'), esc_html($language->name)));
|
62 |
}
|
63 |
echo '</ul>';
|
64 |
}
|
82 |
}
|
83 |
echo '</select>';
|
84 |
|
85 |
+
$options = array_merge(array('default' => array('name' => __('Use content type default', 'lingotek-translation'))), $this->profiles);
|
86 |
|
87 |
// the source language for strings is always the default language
|
88 |
if ('string' != $item['type']) {
|
153 |
*/
|
154 |
function get_columns() {
|
155 |
return array(
|
156 |
+
'name' => __('Content Type', 'lingotek-translation'),
|
157 |
+
'profile' => __('Profile', 'lingotek-translation'),
|
158 |
+
'fields' => __('Fields', 'lingotek-translation'),
|
159 |
);
|
160 |
}
|
161 |
|
admin/custom-fields-table.php
CHANGED
@@ -68,8 +68,8 @@ class Lingotek_Custom_Fields_Table extends WP_List_Table {
|
|
68 |
*/
|
69 |
function get_columns() {
|
70 |
return array(
|
71 |
-
'meta_key' => __('Custom Field Key', '
|
72 |
-
'setting' => __('Action', '
|
73 |
);
|
74 |
}
|
75 |
|
68 |
*/
|
69 |
function get_columns() {
|
70 |
return array(
|
71 |
+
'meta_key' => __('Custom Field Key', 'lingotek-translation'),
|
72 |
+
'setting' => __('Action', 'lingotek-translation'),
|
73 |
);
|
74 |
}
|
75 |
|
admin/filters-columns.php
CHANGED
@@ -69,7 +69,7 @@ class Lingotek_Filters_Columns extends PLL_Admin_Filters_Columns {
|
|
69 |
$inline = defined('DOING_AJAX') && $_REQUEST['action'] == $action && isset($_POST['inline_lang_choice']);
|
70 |
$lang = $inline ?
|
71 |
$this->model->get_language($_POST['inline_lang_choice']) :
|
72 |
-
|
73 |
|
74 |
if (false === strpos($column, 'language_') || !$lang) {
|
75 |
if ($custom_data) {
|
@@ -92,11 +92,11 @@ class Lingotek_Filters_Columns extends PLL_Admin_Filters_Columns {
|
|
92 |
|
93 |
$id = ($inline && $lang->slug != $this->model->get_language($_POST['old_lang'])->slug) ?
|
94 |
($language->slug == $lang->slug ? $object_id : 0) :
|
95 |
-
|
96 |
|
97 |
$document = $this->lgtm->get_group($type, $object_id);
|
98 |
if (isset($document->source)) {
|
99 |
-
$source_language = $type == 'post' ?
|
100 |
}
|
101 |
else {
|
102 |
$source_language = $lang;
|
@@ -136,15 +136,15 @@ class Lingotek_Filters_Columns extends PLL_Admin_Filters_Columns {
|
|
136 |
return 'post' == $type ? Lingotek_Post_actions::uploaded_icon($id) : Lingotek_Term_actions::uploaded_icon($id);
|
137 |
}
|
138 |
|
139 |
-
elseif ($type == 'term' && !isset($document->translations[$language->locale]) && $document->source != $object_id) {
|
140 |
-
return parent::term_column('', $column, $object_id);
|
141 |
-
}
|
142 |
-
|
143 |
// translations
|
144 |
elseif (isset($document->translations[$language->locale]) || (isset($document->source) && 'current' == $document->status)){
|
145 |
return Lingotek_Actions::translation_icon($document, $language);
|
146 |
}
|
147 |
|
|
|
|
|
|
|
|
|
148 |
// translations exist but are not managed by Lingotek TMS
|
149 |
elseif (empty($document->source)) {
|
150 |
return $object_id == $id && !$disabled ? $actions->upload_icon($object_id, true) : ('post' == $type ? parent::post_column($column, $object_id) : parent::term_column('', $column, $object_id));
|
@@ -173,7 +173,7 @@ class Lingotek_Filters_Columns extends PLL_Admin_Filters_Columns {
|
|
173 |
// checking for api errors
|
174 |
$document = $this->lgtm->get_group('post', $post_id);
|
175 |
if (isset($document->source)) {
|
176 |
-
$source_language =
|
177 |
$this->error_icon_html($column, $post_id, $source_language->locale);
|
178 |
}
|
179 |
else {
|
69 |
$inline = defined('DOING_AJAX') && $_REQUEST['action'] == $action && isset($_POST['inline_lang_choice']);
|
70 |
$lang = $inline ?
|
71 |
$this->model->get_language($_POST['inline_lang_choice']) :
|
72 |
+
$type == 'post' ? PLL()->model->post->get_language($object_id) : PLL()->model->term->get_language($object_id);
|
73 |
|
74 |
if (false === strpos($column, 'language_') || !$lang) {
|
75 |
if ($custom_data) {
|
92 |
|
93 |
$id = ($inline && $lang->slug != $this->model->get_language($_POST['old_lang'])->slug) ?
|
94 |
($language->slug == $lang->slug ? $object_id : 0) :
|
95 |
+
$type == 'post' ? PLL()->model->post->get($object_id, $language) : PLL()->model->term->get($object_id, $language);
|
96 |
|
97 |
$document = $this->lgtm->get_group($type, $object_id);
|
98 |
if (isset($document->source)) {
|
99 |
+
$source_language = $type == 'post' ? PLL()->model->post->get_language($document->source) : PLL()->model->term->get_language($document->source);
|
100 |
}
|
101 |
else {
|
102 |
$source_language = $lang;
|
136 |
return 'post' == $type ? Lingotek_Post_actions::uploaded_icon($id) : Lingotek_Term_actions::uploaded_icon($id);
|
137 |
}
|
138 |
|
|
|
|
|
|
|
|
|
139 |
// translations
|
140 |
elseif (isset($document->translations[$language->locale]) || (isset($document->source) && 'current' == $document->status)){
|
141 |
return Lingotek_Actions::translation_icon($document, $language);
|
142 |
}
|
143 |
|
144 |
+
elseif ($type == 'term' && !isset($document->translations[$language->locale]) && $document->source != $object_id) {
|
145 |
+
return parent::term_column('', $column, $object_id);
|
146 |
+
}
|
147 |
+
|
148 |
// translations exist but are not managed by Lingotek TMS
|
149 |
elseif (empty($document->source)) {
|
150 |
return $object_id == $id && !$disabled ? $actions->upload_icon($object_id, true) : ('post' == $type ? parent::post_column($column, $object_id) : parent::term_column('', $column, $object_id));
|
173 |
// checking for api errors
|
174 |
$document = $this->lgtm->get_group('post', $post_id);
|
175 |
if (isset($document->source)) {
|
176 |
+
$source_language = PLL()->model->post->get_language($document->source);
|
177 |
$this->error_icon_html($column, $post_id, $source_language->locale);
|
178 |
}
|
179 |
else {
|
admin/filters-media.php
CHANGED
@@ -50,7 +50,7 @@ class Lingotek_Filters_Media extends PLL_Admin_Filters_Media {
|
|
50 |
* @param int $post_id
|
51 |
*/
|
52 |
public function add_attachment($post_id) {
|
53 |
-
if ($this->model->is_translated_post_type('attachment') && 'automatic' == Lingotek_Model::get_profile_option('upload', 'attachment',
|
54 |
$this->lgtm->upload_post($post_id);
|
55 |
}
|
56 |
}
|
50 |
* @param int $post_id
|
51 |
*/
|
52 |
public function add_attachment($post_id) {
|
53 |
+
if ($this->model->is_translated_post_type('attachment') && 'automatic' == Lingotek_Model::get_profile_option('upload', 'attachment', PLL()->model->post->get_post_language($post_id)) && $this->lgtm->can_upload('post', $post_id))
|
54 |
$this->lgtm->upload_post($post_id);
|
55 |
}
|
56 |
}
|
admin/filters-post.php
CHANGED
@@ -84,14 +84,14 @@ class Lingotek_Filters_Post extends PLL_Admin_Filters_Post {
|
|
84 |
$profiles = Lingotek::get_profiles();
|
85 |
$content_profiles = get_option('lingotek_content_type');
|
86 |
$post_profile = Lingotek_Post_actions::get_post_profile($post_id);
|
87 |
-
$post_language =
|
88 |
$post_type = 'post';
|
89 |
if (isset($_REQUEST['post_type'])) {
|
90 |
$post_type = $_REQUEST['post_type'];
|
91 |
}
|
92 |
|
93 |
if ($post_profile) {
|
94 |
-
echo $profiles[$post_profile->description]['name'] . sprintf('<a title="%s">%s</a>', __('Not set to the content default profile', '
|
95 |
}
|
96 |
else if ($post_language && isset($content_profiles[$post_type]['sources'][$post_language->slug])) {
|
97 |
$profile = $content_profiles[$post_type]['sources'][$post_language->slug];
|
@@ -102,10 +102,10 @@ class Lingotek_Filters_Post extends PLL_Admin_Filters_Post {
|
|
102 |
}
|
103 |
else {
|
104 |
if ($post_type == 'post') {
|
105 |
-
_e('Automatic', '
|
106 |
}
|
107 |
else if ($post_type == 'page') {
|
108 |
-
_e('Manual', '
|
109 |
}
|
110 |
}
|
111 |
}
|
@@ -150,7 +150,7 @@ class Lingotek_Filters_Post extends PLL_Admin_Filters_Post {
|
|
150 |
if (!isset($_REQUEST['import'])) {
|
151 |
parent::save_post($post_id, $post, $update);
|
152 |
|
153 |
-
if (!wp_is_post_revision($post_id) && 'auto-draft' != $post->post_status && Lingotek_Group_Post::is_valid_auto_upload_post_status($post->post_status) && 'automatic' == Lingotek_Model::get_profile_option('upload', $post->post_type,
|
154 |
$this->lgtm->upload_post($post_id);
|
155 |
}
|
156 |
}
|
@@ -214,7 +214,7 @@ class Lingotek_Filters_Post extends PLL_Admin_Filters_Post {
|
|
214 |
$post_ids = array_map('intval', $_REQUEST['post']);
|
215 |
|
216 |
$post_ids[] = $post_id;
|
217 |
-
return array_diff(
|
218 |
}
|
219 |
|
220 |
/*
|
84 |
$profiles = Lingotek::get_profiles();
|
85 |
$content_profiles = get_option('lingotek_content_type');
|
86 |
$post_profile = Lingotek_Post_actions::get_post_profile($post_id);
|
87 |
+
$post_language = PLL()->model->post->get_language($post_id);
|
88 |
$post_type = 'post';
|
89 |
if (isset($_REQUEST['post_type'])) {
|
90 |
$post_type = $_REQUEST['post_type'];
|
91 |
}
|
92 |
|
93 |
if ($post_profile) {
|
94 |
+
echo $profiles[$post_profile->description]['name'] . sprintf('<a title="%s">%s</a>', __('Not set to the content default profile', 'lingotek-translation'), '*');
|
95 |
}
|
96 |
else if ($post_language && isset($content_profiles[$post_type]['sources'][$post_language->slug])) {
|
97 |
$profile = $content_profiles[$post_type]['sources'][$post_language->slug];
|
102 |
}
|
103 |
else {
|
104 |
if ($post_type == 'post') {
|
105 |
+
_e('Automatic', 'lingotek-translation');
|
106 |
}
|
107 |
else if ($post_type == 'page') {
|
108 |
+
_e('Manual', 'lingotek-translation');
|
109 |
}
|
110 |
}
|
111 |
}
|
150 |
if (!isset($_REQUEST['import'])) {
|
151 |
parent::save_post($post_id, $post, $update);
|
152 |
|
153 |
+
if (!wp_is_post_revision($post_id) && 'auto-draft' != $post->post_status && Lingotek_Group_Post::is_valid_auto_upload_post_status($post->post_status) && 'automatic' == Lingotek_Model::get_profile_option('upload', $post->post_type, PLL()->model->post->get_language($post_id), false, $post_id) && !(isset($_POST['action']) && 'heartbeat' == $_POST['action']) && $this->lgtm->can_upload('post', $post_id)) {
|
154 |
$this->lgtm->upload_post($post_id);
|
155 |
}
|
156 |
}
|
214 |
$post_ids = array_map('intval', $_REQUEST['post']);
|
215 |
|
216 |
$post_ids[] = $post_id;
|
217 |
+
return array_diff(PLL()->model->post->get_translations($post_id), $post_ids);
|
218 |
}
|
219 |
|
220 |
/*
|
admin/filters-term.php
CHANGED
@@ -53,7 +53,7 @@ class Lingotek_Filters_Term extends PLL_Admin_Filters_Term {
|
|
53 |
if (!isset($_REQUEST['import'])) {
|
54 |
parent::save_term($term_id, $tt_id, $taxonomy);
|
55 |
|
56 |
-
if ('automatic' == Lingotek_Model::get_profile_option('upload', $taxonomy,
|
57 |
$this->lgtm->upload_term($term_id, $taxonomy); {
|
58 |
}
|
59 |
}
|
53 |
if (!isset($_REQUEST['import'])) {
|
54 |
parent::save_term($term_id, $tt_id, $taxonomy);
|
55 |
|
56 |
+
if ('automatic' == Lingotek_Model::get_profile_option('upload', $taxonomy, PLL()->model->term->get_language($term_id)) && $this->lgtm->can_upload('term', $term_id))
|
57 |
$this->lgtm->upload_term($term_id, $taxonomy); {
|
58 |
}
|
59 |
}
|
admin/manage/view-content.php
CHANGED
@@ -26,7 +26,7 @@ foreach ($polylang->model->get_translated_taxonomies() as $tax) {
|
|
26 |
|
27 |
$data['string'] = array(
|
28 |
'type' => 'string',
|
29 |
-
'name' => __('Strings', '
|
30 |
);
|
31 |
|
32 |
if (empty($_POST)) {
|
@@ -65,7 +65,7 @@ else {
|
|
65 |
}
|
66 |
|
67 |
update_option('lingotek_content_type', $content_types);
|
68 |
-
add_settings_error('lingotek_content_types', 'default', __('Your content types were sucessfully saved.', '
|
69 |
settings_errors();
|
70 |
}
|
71 |
|
@@ -78,16 +78,16 @@ foreach ($data as $key => $item) {
|
|
78 |
}
|
79 |
|
80 |
?>
|
81 |
-
<h3><?php _e('Content Type Configuration', '
|
82 |
-
<p class="description"><?php _e('Content types can be configured to use any translation profile. Additionally, translation profiles can be set based on the language the content was authored in.', '
|
83 |
|
84 |
-
<form id="lingotek-content-types" method="post" action="admin.php?page=
|
85 |
wp_nonce_field('lingotek-content-types', '_wpnonce_lingotek-content-types');
|
86 |
|
87 |
$table = new Lingotek_Content_Table($content_types);
|
88 |
$table->prepare_items($data);
|
89 |
$table->display();
|
90 |
|
91 |
-
submit_button(__('Save Changes', '
|
92 |
?>
|
93 |
</form>
|
26 |
|
27 |
$data['string'] = array(
|
28 |
'type' => 'string',
|
29 |
+
'name' => __('Strings', 'lingotek-translation'),
|
30 |
);
|
31 |
|
32 |
if (empty($_POST)) {
|
65 |
}
|
66 |
|
67 |
update_option('lingotek_content_type', $content_types);
|
68 |
+
add_settings_error('lingotek_content_types', 'default', __('Your content types were sucessfully saved.', 'lingotek-translation'), 'updated');
|
69 |
settings_errors();
|
70 |
}
|
71 |
|
78 |
}
|
79 |
|
80 |
?>
|
81 |
+
<h3><?php _e('Content Type Configuration', 'lingotek-translation'); ?></h3>
|
82 |
+
<p class="description"><?php _e('Content types can be configured to use any translation profile. Additionally, translation profiles can be set based on the language the content was authored in.', 'lingotek-translation'); ?></p>
|
83 |
|
84 |
+
<form id="lingotek-content-types" method="post" action="admin.php?page=lingotek-translation_manage&sm=content" class="validate"><?php
|
85 |
wp_nonce_field('lingotek-content-types', '_wpnonce_lingotek-content-types');
|
86 |
|
87 |
$table = new Lingotek_Content_Table($content_types);
|
88 |
$table->prepare_items($data);
|
89 |
$table->display();
|
90 |
|
91 |
+
submit_button(__('Save Changes', 'lingotek-translation'), 'primary', 'submit', false);
|
92 |
?>
|
93 |
</form>
|
admin/manage/view-custom-fields.php
CHANGED
@@ -10,12 +10,12 @@ if (!empty($_POST)) {
|
|
10 |
if (!empty($_POST['submit'])) {
|
11 |
$arr = empty($_POST['settings']) ? array() : $_POST['settings'];
|
12 |
update_option('lingotek_custom_fields', $arr);
|
13 |
-
add_settings_error('lingotek_custom_fields_save', 'custom_fields', __('Your <i>Custom Fields</i> were sucessfully saved.', '
|
14 |
}
|
15 |
|
16 |
if (!empty($_POST['refresh'])) {
|
17 |
Lingotek_Group_Post::get_updated_meta_values();
|
18 |
-
add_settings_error('lingotek_custom_fields_refresh', 'custom_fields', __('Your <i>Custom Fields</i> were sucessfully identified.', '
|
19 |
}
|
20 |
settings_errors();
|
21 |
}
|
@@ -24,10 +24,10 @@ $items = Lingotek_Group_Post::get_cached_meta_values();
|
|
24 |
|
25 |
?>
|
26 |
|
27 |
-
<h3><?php _e('Custom Field Configuration', '
|
28 |
-
<p class="description"><?php _e('Custom Fields can be translated, copied, or ignored. Click "Refresh Custom Fields" to identify and enable your custom fields.', '
|
29 |
|
30 |
-
<form id="lingotek-custom-fields" method="post" action="admin.php?page=
|
31 |
wp_nonce_field('lingotek-custom-fields', '_wpnonce_lingotek-custom-fields');
|
32 |
|
33 |
$table = new Lingotek_Custom_Fields_Table();
|
@@ -36,7 +36,7 @@ $table->display();
|
|
36 |
?>
|
37 |
|
38 |
<p>
|
39 |
-
<?php submit_button(__('Save Changes', '
|
40 |
-
<?php submit_button(__( 'Refresh Custom Fields', '
|
41 |
</p>
|
42 |
</form>
|
10 |
if (!empty($_POST['submit'])) {
|
11 |
$arr = empty($_POST['settings']) ? array() : $_POST['settings'];
|
12 |
update_option('lingotek_custom_fields', $arr);
|
13 |
+
add_settings_error('lingotek_custom_fields_save', 'custom_fields', __('Your <i>Custom Fields</i> were sucessfully saved.', 'lingotek-translation'), 'updated');
|
14 |
}
|
15 |
|
16 |
if (!empty($_POST['refresh'])) {
|
17 |
Lingotek_Group_Post::get_updated_meta_values();
|
18 |
+
add_settings_error('lingotek_custom_fields_refresh', 'custom_fields', __('Your <i>Custom Fields</i> were sucessfully identified.', 'lingotek-translation'), 'updated');
|
19 |
}
|
20 |
settings_errors();
|
21 |
}
|
24 |
|
25 |
?>
|
26 |
|
27 |
+
<h3><?php _e('Custom Field Configuration', 'lingotek-translation'); ?></h3>
|
28 |
+
<p class="description"><?php _e('Custom Fields can be translated, copied, or ignored. Click "Refresh Custom Fields" to identify and enable your custom fields.', 'lingotek-translation'); ?></p>
|
29 |
|
30 |
+
<form id="lingotek-custom-fields" method="post" action="admin.php?page=lingotek-translation_manage&sm=custom-fields" class="validate"><?php
|
31 |
wp_nonce_field('lingotek-custom-fields', '_wpnonce_lingotek-custom-fields');
|
32 |
|
33 |
$table = new Lingotek_Custom_Fields_Table();
|
36 |
?>
|
37 |
|
38 |
<p>
|
39 |
+
<?php submit_button(__('Save Changes', 'lingotek-translation'), 'primary', 'submit', false); ?>
|
40 |
+
<?php submit_button(__( 'Refresh Custom Fields', 'lingotek-translation'), 'secondary', 'refresh', false ); ?>
|
41 |
</p>
|
42 |
</form>
|
admin/manage/view-edit-profile.php
CHANGED
@@ -3,7 +3,7 @@
|
|
3 |
$settings = $this->get_profiles_settings();
|
4 |
|
5 |
$defaults = get_option('lingotek_defaults');
|
6 |
-
$default = __('Use global default (%s)', '
|
7 |
foreach ($settings as $key => $setting) {
|
8 |
if (isset($defaults[$key]) && array_key_exists($defaults[$key], $settings[$key]['options'])) {
|
9 |
$default_arr = array('default' => sprintf($default, $settings[$key]['options'][$defaults[$key]]));
|
@@ -12,10 +12,10 @@ foreach ($settings as $key => $setting) {
|
|
12 |
}
|
13 |
|
14 |
$target_settings = array(
|
15 |
-
'default' => __('Use default settings', '
|
16 |
-
'custom' => __('Use custom settings', '
|
17 |
-
'copy' => __('Copy source language', '
|
18 |
-
'disabled' => __('Disabled', '
|
19 |
);
|
20 |
|
21 |
$profiles = $this->get_profiles_usage(get_option('lingotek_profiles'));
|
@@ -56,16 +56,16 @@ unset($settings['primary_filter_id']['options'][$secondary_filter_id]);
|
|
56 |
unset($settings['secondary_filter_id']['options'][$primary_filter_id]);
|
57 |
?>
|
58 |
|
59 |
-
<form id="lingotek-edit-profile" method="post" action="admin.php?page=
|
60 |
<?php wp_nonce_field('lingotek-edit-profile', '_wpnonce_lingotek-edit-profile');?>
|
61 |
<input name="profile" type="hidden" value="<?php echo empty($profile['profile']) ? '' : esc_attr($profile['profile']); ?>">
|
62 |
|
63 |
<table class="form-table">
|
64 |
<tr>
|
65 |
-
<th scope="row"><?php printf('<label for="%s">%s</label>', 'name' , __('Profile name', '
|
66 |
<td><?php
|
67 |
if (!empty($profile)) {
|
68 |
-
$profile_name = $disabled ? __($profile['name'],'
|
69 |
}
|
70 |
printf('<input name="name" id="name" type="text" value="%s" %s>',
|
71 |
empty($profile['name']) ? '' : esc_attr($profile_name),
|
@@ -75,7 +75,7 @@ unset($settings['secondary_filter_id']['options'][$primary_filter_id]);
|
|
75 |
</tr>
|
76 |
</table>
|
77 |
|
78 |
-
<h3><?php _e('Default settings', '
|
79 |
|
80 |
<table class="form-table"><?php
|
81 |
foreach ($settings as $key => $setting) { ?>
|
@@ -91,7 +91,7 @@ unset($settings['secondary_filter_id']['options'][$primary_filter_id]);
|
|
91 |
|
92 |
if ('project_id' == $key) { ?>
|
93 |
<input type="checkbox" name="update_callback" id="update_callback"/>
|
94 |
-
<label for="update_callback"><?php _e('Update the callback url for this project.', '
|
95 |
}
|
96 |
|
97 |
if (isset($setting['description']))
|
@@ -102,7 +102,7 @@ unset($settings['secondary_filter_id']['options'][$primary_filter_id]);
|
|
102 |
<script> document.getElementById("primary_filter_id_row").style.display = "none";</script>
|
103 |
<script> document.getElementById("secondary_filter_id_row").style.display = "none";</script> <?php
|
104 |
if ('primary_filter_id' == $key) { ?>
|
105 |
-
<tr id="filters_row"><th><?php _e('Filters', '
|
106 |
<?php }
|
107 |
}
|
108 |
if ($default_filters_exist) { ?>
|
@@ -115,7 +115,7 @@ unset($settings['secondary_filter_id']['options'][$primary_filter_id]);
|
|
115 |
} ?>
|
116 |
</table>
|
117 |
|
118 |
-
<h3><?php _e('Target languages', '
|
119 |
|
120 |
<table class="form-table"><?php
|
121 |
unset($settings['upload']); // we don't want this for target languages
|
@@ -141,7 +141,7 @@ unset($settings['secondary_filter_id']['options'][$primary_filter_id]);
|
|
141 |
d.style.display = 'none';
|
142 |
this.className = 'dashicons dashicons-arrow-right';
|
143 |
}",
|
144 |
-
'' //__('Show', '
|
145 |
|
146 |
); ?></th>
|
147 |
<td><?php
|
@@ -195,15 +195,15 @@ unset($settings['secondary_filter_id']['options'][$primary_filter_id]);
|
|
195 |
|
196 |
<?php
|
197 |
} ?>
|
198 |
-
</table><?php submit_button(__('Save Changes', '
|
199 |
|
200 |
<?php
|
201 |
if (!empty($profile['profile']) && !in_array($profile['profile'], array('automatic', 'manual', 'disabled')) && empty($profile['usage']))
|
202 |
printf(
|
203 |
'<a href="%s" class="button" onclick = "return confirm(\'%s\');">%s</a>',
|
204 |
-
esc_url(wp_nonce_url('admin.php?page=
|
205 |
-
__('You are about to permanently delete this profile. Are you sure?', '
|
206 |
-
__('Delete', '
|
207 |
);
|
208 |
-
?> <a href="admin.php?page=
|
209 |
</form>
|
3 |
$settings = $this->get_profiles_settings();
|
4 |
|
5 |
$defaults = get_option('lingotek_defaults');
|
6 |
+
$default = __('Use global default (%s)', 'lingotek-translation');
|
7 |
foreach ($settings as $key => $setting) {
|
8 |
if (isset($defaults[$key]) && array_key_exists($defaults[$key], $settings[$key]['options'])) {
|
9 |
$default_arr = array('default' => sprintf($default, $settings[$key]['options'][$defaults[$key]]));
|
12 |
}
|
13 |
|
14 |
$target_settings = array(
|
15 |
+
'default' => __('Use default settings', 'lingotek-translation'),
|
16 |
+
'custom' => __('Use custom settings', 'lingotek-translation'),
|
17 |
+
'copy' => __('Copy source language', 'lingotek-translation'),
|
18 |
+
'disabled' => __('Disabled', 'lingotek-translation')
|
19 |
);
|
20 |
|
21 |
$profiles = $this->get_profiles_usage(get_option('lingotek_profiles'));
|
56 |
unset($settings['secondary_filter_id']['options'][$primary_filter_id]);
|
57 |
?>
|
58 |
|
59 |
+
<form id="lingotek-edit-profile" method="post" action="admin.php?page=lingotek-translation_manage&sm=profiles" class="validate">
|
60 |
<?php wp_nonce_field('lingotek-edit-profile', '_wpnonce_lingotek-edit-profile');?>
|
61 |
<input name="profile" type="hidden" value="<?php echo empty($profile['profile']) ? '' : esc_attr($profile['profile']); ?>">
|
62 |
|
63 |
<table class="form-table">
|
64 |
<tr>
|
65 |
+
<th scope="row"><?php printf('<label for="%s">%s</label>', 'name' , __('Profile name', 'lingotek-translation')); ?></th>
|
66 |
<td><?php
|
67 |
if (!empty($profile)) {
|
68 |
+
$profile_name = $disabled ? __($profile['name'],'lingotek-translation') : $profile['name']; // localize canned profile names
|
69 |
}
|
70 |
printf('<input name="name" id="name" type="text" value="%s" %s>',
|
71 |
empty($profile['name']) ? '' : esc_attr($profile_name),
|
75 |
</tr>
|
76 |
</table>
|
77 |
|
78 |
+
<h3><?php _e('Default settings', 'lingotek-translation'); ?></h3>
|
79 |
|
80 |
<table class="form-table"><?php
|
81 |
foreach ($settings as $key => $setting) { ?>
|
91 |
|
92 |
if ('project_id' == $key) { ?>
|
93 |
<input type="checkbox" name="update_callback" id="update_callback"/>
|
94 |
+
<label for="update_callback"><?php _e('Update the callback url for this project.', 'lingotek-translation') ?></label><?php
|
95 |
}
|
96 |
|
97 |
if (isset($setting['description']))
|
102 |
<script> document.getElementById("primary_filter_id_row").style.display = "none";</script>
|
103 |
<script> document.getElementById("secondary_filter_id_row").style.display = "none";</script> <?php
|
104 |
if ('primary_filter_id' == $key) { ?>
|
105 |
+
<tr id="filters_row"><th><?php _e('Filters', 'lingotek-translation') ?></th><td><i><?php _e('Not configured', 'lingotek-translation') ?></i></td></tr>
|
106 |
<?php }
|
107 |
}
|
108 |
if ($default_filters_exist) { ?>
|
115 |
} ?>
|
116 |
</table>
|
117 |
|
118 |
+
<h3><?php _e('Target languages', 'lingotek-translation'); ?></h3>
|
119 |
|
120 |
<table class="form-table"><?php
|
121 |
unset($settings['upload']); // we don't want this for target languages
|
141 |
d.style.display = 'none';
|
142 |
this.className = 'dashicons dashicons-arrow-right';
|
143 |
}",
|
144 |
+
'' //__('Show', 'lingotek-translation')
|
145 |
|
146 |
); ?></th>
|
147 |
<td><?php
|
195 |
|
196 |
<?php
|
197 |
} ?>
|
198 |
+
</table><?php submit_button(__('Save Changes', 'lingotek-translation'), 'primary', 'submit', false); ?>
|
199 |
|
200 |
<?php
|
201 |
if (!empty($profile['profile']) && !in_array($profile['profile'], array('automatic', 'manual', 'disabled')) && empty($profile['usage']))
|
202 |
printf(
|
203 |
'<a href="%s" class="button" onclick = "return confirm(\'%s\');">%s</a>',
|
204 |
+
esc_url(wp_nonce_url('admin.php?page=lingotek-translation_manage&sm=profiles&lingotek_action=delete-profile&noheader=true&profile='.$profile['profile'], 'delete-profile')),
|
205 |
+
__('You are about to permanently delete this profile. Are you sure?', 'lingotek-translation'),
|
206 |
+
__('Delete', 'lingotek-translation')
|
207 |
);
|
208 |
+
?> <a href="admin.php?page=lingotek-translation_manage&sm=profiles" class="button"> <?php _e('Cancel', 'lingotek-translation'); ?></a>
|
209 |
</form>
|
admin/manage/view-profiles.php
CHANGED
@@ -12,9 +12,9 @@ if (isset($_GET['lingotek_action']) && 'delete-profile' == $_GET['lingotek_actio
|
|
12 |
if (!empty($profiles[$_GET['profile']]) && empty($profiles[$_GET['profile']]['usage'])) {
|
13 |
unset($profiles[$_GET['profile']]);
|
14 |
update_option('lingotek_profiles', $profiles);
|
15 |
-
add_settings_error('lingotek_profile', 'default', __('Your translation profile was sucessfully deleted.', '
|
16 |
set_transient('settings_errors', get_settings_errors(), 30);
|
17 |
-
wp_redirect(admin_url('admin.php?page=
|
18 |
exit;
|
19 |
}
|
20 |
}
|
@@ -25,7 +25,7 @@ if (!empty($_POST)) {
|
|
25 |
$defaults = get_option('lingotek_defaults');
|
26 |
|
27 |
if (empty($_POST['name']) && empty($_POST['profile'])) {
|
28 |
-
add_settings_error('lingotek_profile', 'default', __('You must provide a name for your translation profile.', '
|
29 |
}
|
30 |
else {
|
31 |
$profile_id = empty($_POST['profile']) ? uniqid(rand()) : $_POST['profile'];
|
@@ -70,27 +70,27 @@ if (!empty($_POST)) {
|
|
70 |
$profiles['automatic']['name'] = 'Automatic'; $profiles['manual']['name'] = 'Manual'; $profiles['disabled']['name'] = 'Disabled';// do not localize names here
|
71 |
|
72 |
update_option('lingotek_profiles', $profiles);
|
73 |
-
add_settings_error('lingotek_profile', 'default', __('Your translation profile was sucessfully saved.', '
|
74 |
|
75 |
if (isset($_POST['update_callback'])) {
|
76 |
$project_id = isset($profiles[$profile_id]['project_id']) ? $profiles[$profile_id]['project_id'] : $defaults['project_id'];
|
77 |
$client = new Lingotek_API();
|
78 |
if ($client->update_callback_url($project_id))
|
79 |
-
add_settings_error('lingotek_profile', 'default', __('Your callback url was successfully updated.', '
|
80 |
}
|
81 |
}
|
82 |
settings_errors();
|
83 |
}
|
84 |
|
85 |
?>
|
86 |
-
<h3><?php _e('Translation Profiles', '
|
87 |
-
<p class="description"><?php _e('Translation profiles allow you to quickly configure and re-use translation settings.', '
|
88 |
$table = new Lingotek_Profiles_Table();
|
89 |
$table->prepare_items($profiles);
|
90 |
$table->display();
|
91 |
printf(
|
92 |
'<a href="%s" class="button button-primary">%s</a>',
|
93 |
-
admin_url('admin.php?page=
|
94 |
-
__('Add New Profile', '
|
95 |
);
|
96 |
|
12 |
if (!empty($profiles[$_GET['profile']]) && empty($profiles[$_GET['profile']]['usage'])) {
|
13 |
unset($profiles[$_GET['profile']]);
|
14 |
update_option('lingotek_profiles', $profiles);
|
15 |
+
add_settings_error('lingotek_profile', 'default', __('Your translation profile was sucessfully deleted.', 'lingotek-translation'), 'updated');
|
16 |
set_transient('settings_errors', get_settings_errors(), 30);
|
17 |
+
wp_redirect(admin_url('admin.php?page=lingotek-translation_manage&sm=profiles&settings-updated=1'));
|
18 |
exit;
|
19 |
}
|
20 |
}
|
25 |
$defaults = get_option('lingotek_defaults');
|
26 |
|
27 |
if (empty($_POST['name']) && empty($_POST['profile'])) {
|
28 |
+
add_settings_error('lingotek_profile', 'default', __('You must provide a name for your translation profile.', 'lingotek-translation'), 'error');
|
29 |
}
|
30 |
else {
|
31 |
$profile_id = empty($_POST['profile']) ? uniqid(rand()) : $_POST['profile'];
|
70 |
$profiles['automatic']['name'] = 'Automatic'; $profiles['manual']['name'] = 'Manual'; $profiles['disabled']['name'] = 'Disabled';// do not localize names here
|
71 |
|
72 |
update_option('lingotek_profiles', $profiles);
|
73 |
+
add_settings_error('lingotek_profile', 'default', __('Your translation profile was sucessfully saved.', 'lingotek-translation'), 'updated');
|
74 |
|
75 |
if (isset($_POST['update_callback'])) {
|
76 |
$project_id = isset($profiles[$profile_id]['project_id']) ? $profiles[$profile_id]['project_id'] : $defaults['project_id'];
|
77 |
$client = new Lingotek_API();
|
78 |
if ($client->update_callback_url($project_id))
|
79 |
+
add_settings_error('lingotek_profile', 'default', __('Your callback url was successfully updated.', 'lingotek-translation'), 'updated');
|
80 |
}
|
81 |
}
|
82 |
settings_errors();
|
83 |
}
|
84 |
|
85 |
?>
|
86 |
+
<h3><?php _e('Translation Profiles', 'lingotek-translation'); ?></h3>
|
87 |
+
<p class="description"><?php _e('Translation profiles allow you to quickly configure and re-use translation settings.', 'lingotek-translation'); ?></p><?php
|
88 |
$table = new Lingotek_Profiles_Table();
|
89 |
$table->prepare_items($profiles);
|
90 |
$table->display();
|
91 |
printf(
|
92 |
'<a href="%s" class="button button-primary">%s</a>',
|
93 |
+
admin_url('admin.php?page=lingotek-translation_manage&sm=edit-profile'),
|
94 |
+
__('Add New Profile', 'lingotek-translation')
|
95 |
);
|
96 |
|
admin/manage/view-string-groups.php
CHANGED
@@ -1,14 +1,14 @@
|
|
1 |
-
<h3><?php _e('String Groups', '
|
2 |
|
3 |
-
<p class="description"><?php printf(__('Manage group translation of system, widget, and plugin-specific strings. View individual strings on the <a href="%s"><b>Strings</b></a> page.', '
|
4 |
<?php
|
5 |
|
6 |
$profile = Lingotek_Model::get_profile('string', $this->pllm->get_language($this->pllm->options['default_lang']));
|
7 |
|
8 |
if ('disabled' == $profile['profile']) {
|
9 |
printf('<div class="error" style="border-left: 4px solid #ffba00;"><p>%s</p></div>', // no warning class in WP 4.0, color form .update-nag
|
10 |
-
sprintf(__('The strings translation is disabled in %sContent Type Configuration%s.', '
|
11 |
-
'<a href="' . admin_url('admin.php?page=
|
12 |
'</a>'
|
13 |
)
|
14 |
);
|
@@ -28,7 +28,7 @@ else {
|
|
28 |
|
29 |
$table->prepare_items($data); ?>
|
30 |
|
31 |
-
<form id="lingotek-strings" method="post" action="admin.php?page=
|
32 |
$table->display(); ?>
|
33 |
</form><?php
|
34 |
|
1 |
+
<h3><?php _e('String Groups', 'lingotek-translation'); ?></h3>
|
2 |
|
3 |
+
<p class="description"><?php printf(__('Manage group translation of system, widget, and plugin-specific strings. View individual strings on the <a href="%s"><b>Strings</b></a> page.', 'lingotek-translation'), 'admin.php?page=lingotek-translation_manage&sm=strings'); ?></p>
|
4 |
<?php
|
5 |
|
6 |
$profile = Lingotek_Model::get_profile('string', $this->pllm->get_language($this->pllm->options['default_lang']));
|
7 |
|
8 |
if ('disabled' == $profile['profile']) {
|
9 |
printf('<div class="error" style="border-left: 4px solid #ffba00;"><p>%s</p></div>', // no warning class in WP 4.0, color form .update-nag
|
10 |
+
sprintf(__('The strings translation is disabled in %sContent Type Configuration%s.', 'lingotek-translation'),
|
11 |
+
'<a href="' . admin_url('admin.php?page=lingotek-translation_settings&sm=content') . '">',
|
12 |
'</a>'
|
13 |
)
|
14 |
);
|
28 |
|
29 |
$table->prepare_items($data); ?>
|
30 |
|
31 |
+
<form id="lingotek-strings" method="post" action="admin.php?page=lingotek-translation_manage&noheader=true&sm=string-groups"><?php
|
32 |
$table->display(); ?>
|
33 |
</form><?php
|
34 |
|
admin/manage/view-strings.php
CHANGED
@@ -1,4 +1,4 @@
|
|
1 |
-
<h3 style="padding-top:0; margin-top:0; margin-bottom:-25px;"><?php _e('Strings', '
|
2 |
|
3 |
<?php
|
4 |
$listlanguages = $GLOBALS['polylang']->model->get_languages_list();
|
@@ -42,7 +42,7 @@ $string_table->prepare_items($data); ?>
|
|
42 |
<div class="form-wrap">
|
43 |
<form id="string-translation" method="post" action="admin.php?page=mlang&tab=strings&noheader=true">
|
44 |
<input type="hidden" name="pll_action" value="string-translation" /><?php
|
45 |
-
$string_table->search_box(__('Search translations', '
|
46 |
wp_nonce_field('string-translation', '_wpnonce_string-translation');
|
47 |
$string_table->display(); ?>
|
48 |
</form>
|
1 |
+
<h3 style="padding-top:0; margin-top:0; margin-bottom:-25px;"><?php _e('Strings', 'lingotek-translation'); ?> <a href="options-general.php?page=mlang&tab=strings" title="<?php _e('Edit on Polylang Strings Translation page', 'lingotek-translation'); ?>" class="dashicons dashicons-edit"></a></h3>
|
2 |
|
3 |
<?php
|
4 |
$listlanguages = $GLOBALS['polylang']->model->get_languages_list();
|
42 |
<div class="form-wrap">
|
43 |
<form id="string-translation" method="post" action="admin.php?page=mlang&tab=strings&noheader=true">
|
44 |
<input type="hidden" name="pll_action" value="string-translation" /><?php
|
45 |
+
$string_table->search_box(__('Search translations', 'lingotek-translation'), 'translations' );
|
46 |
wp_nonce_field('string-translation', '_wpnonce_string-translation');
|
47 |
$string_table->display(); ?>
|
48 |
</form>
|
admin/post-actions.php
CHANGED
@@ -44,7 +44,7 @@ class Lingotek_Post_actions extends Lingotek_Actions {
|
|
44 |
* @return object
|
45 |
*/
|
46 |
protected function get_language($post_id) {
|
47 |
-
return
|
48 |
}
|
49 |
|
50 |
/*
|
@@ -71,7 +71,7 @@ class Lingotek_Post_actions extends Lingotek_Actions {
|
|
71 |
if ($this->pllm->is_translated_post_type($post->post_type)) {
|
72 |
$actions = $this->_row_actions($actions, $post->ID);
|
73 |
|
74 |
-
$language =
|
75 |
if (!empty($language)) {
|
76 |
$profile = Lingotek_Model::get_profile($post->post_type, $language, $post->ID);
|
77 |
if ('disabled' == $profile['profile'])
|
@@ -215,8 +215,8 @@ class Lingotek_Post_actions extends Lingotek_Actions {
|
|
215 |
}
|
216 |
}
|
217 |
|
218 |
-
add_meta_box('lingotek_post_meta_box', __('Lingotek Translation', '
|
219 |
-
add_meta_box('lingotek_page_meta_box', __('Lingotek Translation', '
|
220 |
}
|
221 |
|
222 |
/*
|
@@ -234,13 +234,13 @@ class Lingotek_Post_actions extends Lingotek_Actions {
|
|
234 |
$profiles = Lingotek::get_profiles();
|
235 |
$content_profiles = get_option('lingotek_content_type');
|
236 |
$language_profiles = self::retrieve_lang_Profiles($post_type, $profiles, $content_profiles);
|
237 |
-
$default_name = empty($content_profiles) == false ? $profiles[$content_profiles[$post->post_type]['profile']]['name'] : ($post_type == 'page' ? __('Manual', '
|
238 |
$content_default_profile = array('default' => array(
|
239 |
-
'name' => __('Content Default', '
|
240 |
));
|
241 |
$language_profiles['defaults'] = array(
|
242 |
'content_default' => $default_name,
|
243 |
-
'title' => __('Content Default', '
|
244 |
);
|
245 |
$profiles = array_merge($content_default_profile, $profiles);
|
246 |
$post_profile = self::get_post_profile($post->ID);
|
@@ -265,15 +265,15 @@ class Lingotek_Post_actions extends Lingotek_Actions {
|
|
265 |
$remove_post = 'post=' . $post->ID;
|
266 |
$disassociate_url = str_replace($remove_post, '', $disassociate_url);
|
267 |
$prefs = Lingotek_Model::get_prefs();
|
268 |
-
$confirm_message = isset($prefs['delete_document_from_tms']) === false ? __('Are you sure you want to do this?', '
|
269 |
$confirm_message = sprintf(' onclick = "return confirm(\'%s\');"', $confirm_message);
|
270 |
-
printf('<strong>%s</strong><br><br>', __('Translation Profile', '
|
271 |
-
printf('<em>%s</em><br>', __('Disassociate this content to change the Translation Profile', '
|
272 |
-
printf(('<a class="button button-small" href="%s" %s>%s</a><br><br>'), esc_url($disassociate_url), $confirm_message, __('Disassociate', '
|
273 |
printf('<select disabled class="lingotek-profile-setting" name="%1$s" id="%1$s">', 'lingotek_profile_meta');
|
274 |
}
|
275 |
else {
|
276 |
-
printf('<strong>%s</strong><br><br>', __('Translation Profile', '
|
277 |
printf('<select class="lingotek-profile-setting" name="%1$s" id="%1$s">', 'lingotek_profile_meta');
|
278 |
}
|
279 |
|
44 |
* @return object
|
45 |
*/
|
46 |
protected function get_language($post_id) {
|
47 |
+
return PLL()->model->post->get_language($post_id);
|
48 |
}
|
49 |
|
50 |
/*
|
71 |
if ($this->pllm->is_translated_post_type($post->post_type)) {
|
72 |
$actions = $this->_row_actions($actions, $post->ID);
|
73 |
|
74 |
+
$language = PLL()->model->post->get_language($post->ID);
|
75 |
if (!empty($language)) {
|
76 |
$profile = Lingotek_Model::get_profile($post->post_type, $language, $post->ID);
|
77 |
if ('disabled' == $profile['profile'])
|
215 |
}
|
216 |
}
|
217 |
|
218 |
+
add_meta_box('lingotek_post_meta_box', __('Lingotek Translation', 'lingotek-translation'), array( __CLASS__, 'lingotek_edit_meta_box_html'), 'post', 'side', 'default');
|
219 |
+
add_meta_box('lingotek_page_meta_box', __('Lingotek Translation', 'lingotek-translation'), array( __CLASS__, 'lingotek_edit_meta_box_html'), 'page', 'side', 'default');
|
220 |
}
|
221 |
|
222 |
/*
|
234 |
$profiles = Lingotek::get_profiles();
|
235 |
$content_profiles = get_option('lingotek_content_type');
|
236 |
$language_profiles = self::retrieve_lang_Profiles($post_type, $profiles, $content_profiles);
|
237 |
+
$default_name = empty($content_profiles) == false ? $profiles[$content_profiles[$post->post_type]['profile']]['name'] : ($post_type == 'page' ? __('Manual', 'lingotek-translation') : __('Automatic', 'lingotek-translation'));
|
238 |
$content_default_profile = array('default' => array(
|
239 |
+
'name' => __('Content Default', 'lingotek-translation') . ' (' . $default_name . ')', // Adds in the name of the content type default profile
|
240 |
));
|
241 |
$language_profiles['defaults'] = array(
|
242 |
'content_default' => $default_name,
|
243 |
+
'title' => __('Content Default', 'lingotek-translation'),
|
244 |
);
|
245 |
$profiles = array_merge($content_default_profile, $profiles);
|
246 |
$post_profile = self::get_post_profile($post->ID);
|
265 |
$remove_post = 'post=' . $post->ID;
|
266 |
$disassociate_url = str_replace($remove_post, '', $disassociate_url);
|
267 |
$prefs = Lingotek_Model::get_prefs();
|
268 |
+
$confirm_message = isset($prefs['delete_document_from_tms']) === false ? __('Are you sure you want to do this?', 'lingotek-translation') : __('Are you sure you want to do this? The document will be deleted from Lingotek TMS.', 'lingotek-translation');
|
269 |
$confirm_message = sprintf(' onclick = "return confirm(\'%s\');"', $confirm_message);
|
270 |
+
printf('<strong>%s</strong><br><br>', __('Translation Profile', 'lingotek-translation'));
|
271 |
+
printf('<em>%s</em><br>', __('Disassociate this content to change the Translation Profile', 'lingotek-translation'));
|
272 |
+
printf(('<a class="button button-small" href="%s" %s>%s</a><br><br>'), esc_url($disassociate_url), $confirm_message, __('Disassociate', 'lingotek-translation'));
|
273 |
printf('<select disabled class="lingotek-profile-setting" name="%1$s" id="%1$s">', 'lingotek_profile_meta');
|
274 |
}
|
275 |
else {
|
276 |
+
printf('<strong>%s</strong><br><br>', __('Translation Profile', 'lingotek-translation'));
|
277 |
printf('<select class="lingotek-profile-setting" name="%1$s" id="%1$s">', 'lingotek_profile_meta');
|
278 |
}
|
279 |
|
admin/profiles-table.php
CHANGED
@@ -41,8 +41,8 @@ class Lingotek_Profiles_Table extends WP_List_Table {
|
|
41 |
*/
|
42 |
function column_usage($item){
|
43 |
return empty($item['usage']) ?
|
44 |
-
__('No content types', '
|
45 |
-
sprintf(_n('1 content type', '%d content types', $item['usage'], '
|
46 |
}
|
47 |
|
48 |
/*
|
@@ -59,16 +59,16 @@ class Lingotek_Profiles_Table extends WP_List_Table {
|
|
59 |
if ('disabled' != $item['profile'])
|
60 |
$actions[] = sprintf(
|
61 |
'<a href=%s>%s</a>',
|
62 |
-
esc_url(admin_url('admin.php?page=
|
63 |
-
__('Edit', '
|
64 |
);
|
65 |
|
66 |
if (!in_array($item['profile'], array('automatic', 'manual', 'disabled')) && empty($item['usage']))
|
67 |
$actions[] = sprintf(
|
68 |
'<a href="%s" onclick = "return confirm(\'%s\');">%s</a>',
|
69 |
-
esc_url(wp_nonce_url('admin.php?page=
|
70 |
-
__('You are about to permanently delete this profile. Are you sure?', '
|
71 |
-
__('Delete', '
|
72 |
);
|
73 |
|
74 |
return implode(' | ', $actions);
|
@@ -83,9 +83,9 @@ class Lingotek_Profiles_Table extends WP_List_Table {
|
|
83 |
*/
|
84 |
function get_columns() {
|
85 |
return array(
|
86 |
-
'name' => __('Profile name', '
|
87 |
-
'usage' => __('Usage', '
|
88 |
-
'actions' => __('Actions', '
|
89 |
);
|
90 |
}
|
91 |
|
41 |
*/
|
42 |
function column_usage($item){
|
43 |
return empty($item['usage']) ?
|
44 |
+
__('No content types', 'lingotek-translation') :
|
45 |
+
sprintf(_n('1 content type', '%d content types', $item['usage'], 'lingotek-translation'), number_format_i18n($item['usage']));
|
46 |
}
|
47 |
|
48 |
/*
|
59 |
if ('disabled' != $item['profile'])
|
60 |
$actions[] = sprintf(
|
61 |
'<a href=%s>%s</a>',
|
62 |
+
esc_url(admin_url('admin.php?page=lingotek-translation_manage&sm=edit-profile&profile='.$item['profile'])),
|
63 |
+
__('Edit', 'lingotek-translation')
|
64 |
);
|
65 |
|
66 |
if (!in_array($item['profile'], array('automatic', 'manual', 'disabled')) && empty($item['usage']))
|
67 |
$actions[] = sprintf(
|
68 |
'<a href="%s" onclick = "return confirm(\'%s\');">%s</a>',
|
69 |
+
esc_url(wp_nonce_url('admin.php?page=lingotek-translation_manage&sm=profiles&lingotek_action=delete-profile&noheader=true&profile='.$item['profile'], 'delete-profile')),
|
70 |
+
__('You are about to permanently delete this profile. Are you sure?', 'lingotek-translation'),
|
71 |
+
__('Delete', 'lingotek-translation')
|
72 |
);
|
73 |
|
74 |
return implode(' | ', $actions);
|
83 |
*/
|
84 |
function get_columns() {
|
85 |
return array(
|
86 |
+
'name' => __('Profile name', 'lingotek-translation'),
|
87 |
+
'usage' => __('Usage', 'lingotek-translation'),
|
88 |
+
'actions' => __('Actions', 'lingotek-translation'),
|
89 |
);
|
90 |
}
|
91 |
|
admin/settings.php
CHANGED
@@ -1,5 +1,5 @@
|
|
1 |
<div class="wrap">
|
2 |
-
<h2><?php _e('Settings', '
|
3 |
|
4 |
<?php
|
5 |
if (strlen($access_token)) {
|
@@ -8,15 +8,15 @@
|
|
8 |
<?php
|
9 |
|
10 |
$menu_items = array(
|
11 |
-
'account' => __('Account', '
|
12 |
);
|
13 |
|
14 |
$community_required_menu_items = array(
|
15 |
-
'defaults' => __('Defaults', '
|
16 |
-
'preferences' => __('Preferences', '
|
17 |
-
//'advanced' => __('Advanced', '
|
18 |
-
//'logging' => __('Logging', '
|
19 |
-
'utilities' => __('Utilities', '
|
20 |
);
|
21 |
|
22 |
if($community_id !== FALSE){
|
@@ -47,7 +47,7 @@
|
|
47 |
|
48 |
<?php
|
49 |
settings_errors();
|
50 |
-
$submenu = isset($_GET['sm']) ? $_GET['sm'] : 'account';
|
51 |
$dir = dirname(__FILE__) . '/settings/';
|
52 |
$filename = $dir . 'view-' . $submenu . ".php";
|
53 |
if (file_exists($filename))
|
1 |
<div class="wrap">
|
2 |
+
<h2><?php _e('Settings', 'lingotek-translation'); ?></h2>
|
3 |
|
4 |
<?php
|
5 |
if (strlen($access_token)) {
|
8 |
<?php
|
9 |
|
10 |
$menu_items = array(
|
11 |
+
'account' => __('Account', 'lingotek-translation'),
|
12 |
);
|
13 |
|
14 |
$community_required_menu_items = array(
|
15 |
+
'defaults' => __('Defaults', 'lingotek-translation'),
|
16 |
+
'preferences' => __('Preferences', 'lingotek-translation'),
|
17 |
+
//'advanced' => __('Advanced', 'lingotek-translation'),
|
18 |
+
//'logging' => __('Logging', 'lingotek-translation'),
|
19 |
+
'utilities' => __('Utilities', 'lingotek-translation'),
|
20 |
);
|
21 |
|
22 |
if($community_id !== FALSE){
|
47 |
|
48 |
<?php
|
49 |
settings_errors();
|
50 |
+
$submenu = isset($_GET['sm']) ? sanitize_text_field($_GET['sm']) : 'account';
|
51 |
$dir = dirname(__FILE__) . '/settings/';
|
52 |
$filename = $dir . 'view-' . $submenu . ".php";
|
53 |
if (file_exists($filename))
|
admin/settings/connect-account.php
CHANGED
@@ -11,19 +11,19 @@
|
|
11 |
</script>
|
12 |
<?php /* Connect Your Account Button */ ?>
|
13 |
<div class="wrap">
|
14 |
-
<h2><?php _e('Connect Your Account', '
|
15 |
<div>
|
16 |
<p class="description">
|
17 |
-
<?php _e('Get started by clicking the button below to connect your Lingotek account to this Wordpress installation.', '
|
18 |
</p>
|
19 |
<hr/>
|
20 |
<p>
|
21 |
<a class="button button-large button-hero" href="<?php echo $connect_account_cloak_url_new ?>">
|
22 |
-
<img src="<?php echo LINGOTEK_URL; ?>/img/lingotek-icon.png" style="padding: 0 4px 2px 0;" align="absmiddle"/> <?php _e('Connect New Account', '
|
23 |
</a>
|
24 |
</p>
|
25 |
<hr/>
|
26 |
-
<p class="description"><?php echo sprintf( __('Do you already have a Lingotek account? <a href="%s">Connect Lingotek Account</a>', '
|
27 |
-
<p class="description"><?php echo sprintf( __('Do you have a Lingotek sandbox account? <a href="%s">Connect Sandbox Account</a>', '
|
28 |
</div>
|
29 |
</div>
|
11 |
</script>
|
12 |
<?php /* Connect Your Account Button */ ?>
|
13 |
<div class="wrap">
|
14 |
+
<h2><?php _e('Connect Your Account', 'lingotek-translation') ?></h2>
|
15 |
<div>
|
16 |
<p class="description">
|
17 |
+
<?php _e('Get started by clicking the button below to connect your Lingotek account to this Wordpress installation.', 'lingotek-translation') ?>
|
18 |
</p>
|
19 |
<hr/>
|
20 |
<p>
|
21 |
<a class="button button-large button-hero" href="<?php echo $connect_account_cloak_url_new ?>">
|
22 |
+
<img src="<?php echo LINGOTEK_URL; ?>/img/lingotek-icon.png" style="padding: 0 4px 2px 0;" align="absmiddle"/> <?php _e('Connect New Account', 'lingotek-translation') ?>
|
23 |
</a>
|
24 |
</p>
|
25 |
<hr/>
|
26 |
+
<p class="description"><?php echo sprintf( __('Do you already have a Lingotek account? <a href="%s">Connect Lingotek Account</a>', 'lingotek-translation'), esc_attr($connect_account_cloak_url_prod)) ?></p>
|
27 |
+
<p class="description"><?php echo sprintf( __('Do you have a Lingotek sandbox account? <a href="%s">Connect Sandbox Account</a>', 'lingotek-translation'), esc_attr($connect_account_cloak_url_test)) ?></p>
|
28 |
</div>
|
29 |
</div>
|
admin/settings/view-account.php
CHANGED
@@ -2,7 +2,7 @@
|
|
2 |
$client = new Lingotek_API();
|
3 |
$api_communities = $client->get_communities();
|
4 |
if (!isset($api_communities->entities)) {
|
5 |
-
add_settings_error('lingotek_community_resources', 'error', __('The Lingotek TMS is currently unavailable. Please try again later. If the problem persists, contact Lingotek Support.', '
|
6 |
settings_errors();
|
7 |
}
|
8 |
if (!$community_id) {
|
@@ -12,28 +12,28 @@ if (!$community_id) {
|
|
12 |
if ($ltk_num_communities == 1) {
|
13 |
$ltk_community_id = $ltk_communities->entities[0]->properties->id;
|
14 |
$this->set_community_resources($ltk_community_id);
|
15 |
-
echo '<script type="text/javascript">document.body.innerHTML = ""; window.location = "admin.php?page=
|
16 |
}
|
17 |
}
|
18 |
?>
|
19 |
|
20 |
-
<h3><?php _e('Account', '
|
21 |
-
<p class="description"><?php _e('Lingotek account connection and community selection.', '
|
22 |
|
23 |
<table class="form-table">
|
24 |
<tr>
|
25 |
<th scope="row">
|
26 |
-
<?php _e('Connected', '
|
27 |
<a id="cd-show-link" class="dashicons dashicons-arrow-right" onclick="document.getElementById('connection-details').style.display = ''; document.getElementById('cd-hide-link').style.display = ''; this.style.display = 'none'; return false;"></a>
|
28 |
<a id="cd-hide-link" class="dashicons dashicons-arrow-down" onclick="document.getElementById('connection-details').style.display = 'none'; document.getElementById('cd-show-link').style.display = ''; this.style.display = 'none'; return false;" style="display: none;"></a>
|
29 |
</th>
|
30 |
<td>
|
31 |
-
<?php _e('Yes', '
|
32 |
</td>
|
33 |
</tr>
|
34 |
<tbody id="connection-details" style="display: none;">
|
35 |
<tr>
|
36 |
-
<th scope="row"><?php echo __('Login ID', '
|
37 |
<td>
|
38 |
<label>
|
39 |
<?php
|
@@ -45,7 +45,7 @@ if (!$community_id) {
|
|
45 |
</td>
|
46 |
</tr>
|
47 |
<tr>
|
48 |
-
<th scope="row"><?php echo __('Access Token', '
|
49 |
<td>
|
50 |
<label>
|
51 |
<?php
|
@@ -60,7 +60,7 @@ if (!$community_id) {
|
|
60 |
</td>
|
61 |
</tr>
|
62 |
<tr>
|
63 |
-
<th scope="row"><?php echo __('API Endpoint', '
|
64 |
<td>
|
65 |
<label>
|
66 |
<?php
|
@@ -75,8 +75,8 @@ if (!$community_id) {
|
|
75 |
<th></th>
|
76 |
<td>
|
77 |
<?php
|
78 |
-
$confirm_message = __('Are you sure you would like to disconnect your Lingotek account? \n\nAfter disconnecting, you will need to re-connect an account to continue using Lingotek.', '
|
79 |
-
echo '<a class="button" href="' . $redirect_url . '&delete_access_token=true" onclick="return confirm(\'' . $confirm_message . '\')">' . __('Disconnect', '
|
80 |
?>
|
81 |
</td>
|
82 |
</tr>
|
@@ -90,7 +90,7 @@ if (!$community_id) {
|
|
90 |
|
91 |
<table class="form-table">
|
92 |
<tr>
|
93 |
-
<th scope="row"><label for="lingotek_community"><?php _e('Community', '
|
94 |
<td>
|
95 |
<select name="lingotek_community" id="lingotek_community">
|
96 |
<?php
|
@@ -109,7 +109,7 @@ if (!$community_id) {
|
|
109 |
update_option('lingotek_community', current(array_keys($communities)));
|
110 |
}
|
111 |
if(!$community_id && $num_communities > 1) {
|
112 |
-
echo "\n\t" . '<option value="">'.__('Select', '
|
113 |
}
|
114 |
foreach ($communities as $community_id_option => $community_title) {
|
115 |
$selected = ($default_community_id == $community_id_option) ? 'selected="selected"' : '';
|
@@ -122,5 +122,5 @@ if (!$community_id) {
|
|
122 |
</tr>
|
123 |
</table>
|
124 |
|
125 |
-
<?php submit_button(__('Save Changes', '
|
126 |
</form>
|
2 |
$client = new Lingotek_API();
|
3 |
$api_communities = $client->get_communities();
|
4 |
if (!isset($api_communities->entities)) {
|
5 |
+
add_settings_error('lingotek_community_resources', 'error', __('The Lingotek TMS is currently unavailable. Please try again later. If the problem persists, contact Lingotek Support.', 'lingotek-translation'), 'error');
|
6 |
settings_errors();
|
7 |
}
|
8 |
if (!$community_id) {
|
12 |
if ($ltk_num_communities == 1) {
|
13 |
$ltk_community_id = $ltk_communities->entities[0]->properties->id;
|
14 |
$this->set_community_resources($ltk_community_id);
|
15 |
+
echo '<script type="text/javascript">document.body.innerHTML = ""; window.location = "admin.php?page=lingotek-translation_tutorial";</script>';
|
16 |
}
|
17 |
}
|
18 |
?>
|
19 |
|
20 |
+
<h3><?php _e('Account', 'lingotek-translation'); ?></h3>
|
21 |
+
<p class="description"><?php _e('Lingotek account connection and community selection.', 'lingotek-translation'); ?></p>
|
22 |
|
23 |
<table class="form-table">
|
24 |
<tr>
|
25 |
<th scope="row">
|
26 |
+
<?php _e('Connected', 'lingotek-translation') ?>
|
27 |
<a id="cd-show-link" class="dashicons dashicons-arrow-right" onclick="document.getElementById('connection-details').style.display = ''; document.getElementById('cd-hide-link').style.display = ''; this.style.display = 'none'; return false;"></a>
|
28 |
<a id="cd-hide-link" class="dashicons dashicons-arrow-down" onclick="document.getElementById('connection-details').style.display = 'none'; document.getElementById('cd-show-link').style.display = ''; this.style.display = 'none'; return false;" style="display: none;"></a>
|
29 |
</th>
|
30 |
<td>
|
31 |
+
<?php _e('Yes', 'lingotek-translation') ?><span title="<?php _e('Connected', 'lingotek-translation') ?>" class="dashicons dashicons-yes" style="color: green;"></span>
|
32 |
</td>
|
33 |
</tr>
|
34 |
<tbody id="connection-details" style="display: none;">
|
35 |
<tr>
|
36 |
+
<th scope="row"><?php echo __('Login ID', 'lingotek-translation') ?></th>
|
37 |
<td>
|
38 |
<label>
|
39 |
<?php
|
45 |
</td>
|
46 |
</tr>
|
47 |
<tr>
|
48 |
+
<th scope="row"><?php echo __('Access Token', 'lingotek-translation') ?></th>
|
49 |
<td>
|
50 |
<label>
|
51 |
<?php
|
60 |
</td>
|
61 |
</tr>
|
62 |
<tr>
|
63 |
+
<th scope="row"><?php echo __('API Endpoint', 'lingotek-translation') ?></th>
|
64 |
<td>
|
65 |
<label>
|
66 |
<?php
|
75 |
<th></th>
|
76 |
<td>
|
77 |
<?php
|
78 |
+
$confirm_message = __('Are you sure you would like to disconnect your Lingotek account? \n\nAfter disconnecting, you will need to re-connect an account to continue using Lingotek.', 'lingotek-translation');
|
79 |
+
echo '<a class="button" href="' . $redirect_url . '&delete_access_token=true" onclick="return confirm(\'' . $confirm_message . '\')">' . __('Disconnect', 'lingotek-translation') . '</a>';
|
80 |
?>
|
81 |
</td>
|
82 |
</tr>
|
90 |
|
91 |
<table class="form-table">
|
92 |
<tr>
|
93 |
+
<th scope="row"><label for="lingotek_community"><?php _e('Community', 'lingotek-translation') ?></label></th>
|
94 |
<td>
|
95 |
<select name="lingotek_community" id="lingotek_community">
|
96 |
<?php
|
109 |
update_option('lingotek_community', current(array_keys($communities)));
|
110 |
}
|
111 |
if(!$community_id && $num_communities > 1) {
|
112 |
+
echo "\n\t" . '<option value="">'.__('Select', 'lingotek-translation').'...</option>';
|
113 |
}
|
114 |
foreach ($communities as $community_id_option => $community_title) {
|
115 |
$selected = ($default_community_id == $community_id_option) ? 'selected="selected"' : '';
|
122 |
</tr>
|
123 |
</table>
|
124 |
|
125 |
+
<?php submit_button(__('Save Changes', 'lingotek-translation'), 'primary', 'submit', false); ?>
|
126 |
</form>
|
admin/settings/view-defaults.php
CHANGED
@@ -9,16 +9,16 @@ if (!empty($_POST)) {
|
|
9 |
if (array_key_exists('refresh', $_POST)) {
|
10 |
$refresh_success = $this->set_community_resources($community_id);
|
11 |
if ($refresh_success['projects'] == TRUE && $refresh_success['workflows'] == TRUE) {
|
12 |
-
add_settings_error('lingotek_community_resources', 'options', __('Resources from Lingotek were successfully updated for projects and workflows.', '
|
13 |
}
|
14 |
else if ($refresh_success['projects'] == TRUE) {
|
15 |
-
add_settings_error('lingotek_community_resources', 'error', __('Resources from Lingotek were successfully updated for projects.', '
|
16 |
}
|
17 |
else if ($refresh_success['workflows'] == TRUE) {
|
18 |
-
add_settings_error('lingotek_community_resources', 'error', __('Resources from Lingotek were successfully updated for workflows.', '
|
19 |
}
|
20 |
else if ($refresh_success['workflows'] == FALSE || $refresh_success['projects'] == FALSE) {
|
21 |
-
add_settings_error('lingotek_community_resources', 'error', __('The Lingotek TMS is currently unavailable. Please try again later. If the problem persists, contact Lingotek Support.', '
|
22 |
}
|
23 |
}
|
24 |
else {
|
@@ -30,12 +30,12 @@ if (!empty($_POST)) {
|
|
30 |
}
|
31 |
}
|
32 |
update_option('lingotek_defaults', $options);
|
33 |
-
add_settings_error('lingotek_defaults', 'defaultgs', __('Your <i>Defaults</i> were sucessfully saved.', '
|
34 |
|
35 |
if (isset($_POST['update_callback'])) {
|
36 |
$client = new Lingotek_API();
|
37 |
if ($client->update_callback_url($options['project_id']))
|
38 |
-
add_settings_error('lingotek_defaults', 'defaultgs', __('Your callback url was successfully updated.', '
|
39 |
}
|
40 |
|
41 |
//adds new project if text box is filled out
|
@@ -44,7 +44,7 @@ if (!empty($_POST)) {
|
|
44 |
$title = stripslashes($_POST['new_project']);
|
45 |
|
46 |
if ($new_id = $client->create_project($title, $community_id)) {
|
47 |
-
add_settings_error('lingotek_defaults', 'defaultgs', __('Your new project was successfully created.', '
|
48 |
$this->set_community_resources($community_id);// updates the cache to include the newly created project
|
49 |
$options['project_id'] = $new_id;
|
50 |
update_option('lingotek_defaults', $options);
|
@@ -86,8 +86,8 @@ unset($settings['primary_filter_id']['options'][$secondary_filter_id]);
|
|
86 |
unset($settings['secondary_filter_id']['options'][$primary_filter_id]);
|
87 |
?>
|
88 |
|
89 |
-
<h3><?php _e('Defaults', '
|
90 |
-
<p class="description"><?php _e('The default automation settings and resources that should be used for this site. These settings can be overriden using translation profiles and content type configuration.', '
|
91 |
|
92 |
|
93 |
<form id="lingotek-settings" method="post" action="admin.php?page=<?php echo $page_key; ?>" class="validate">
|
@@ -108,15 +108,15 @@ unset($settings['secondary_filter_id']['options'][$primary_filter_id]);
|
|
108 |
|
109 |
if (empty($setting['options'])) { ?>
|
110 |
<script> document.getElementById('project_id').style.display = 'none';</script>
|
111 |
-
<input type="text" name="new_project" id="new_project" placeholder="<?php _e('Enter new project name', '
|
112 |
<?php }
|
113 |
else { ?>
|
114 |
|
115 |
-
<input type="text" style="display:none" name="new_project" id="new_project" placeholder="<?php _e('Enter new project name', '
|
116 |
<input type="checkbox" name="update_callback" id="update_callback"/>
|
117 |
-
<label for="update_callback" id="callback_label"><?php _e('Update the callback url for this project.', '
|
118 |
|
119 |
-
<br/><a href="#" id="create" onclick="toggleTextbox()" style="padding-left:3px; color:#999; font-size:80%; text-decoration:none"><b>+</b> <?php echo _e('Create New Project', '
|
120 |
<?php } ?>
|
121 |
<?php } ?>
|
122 |
<!-- Code to handle displaying of Primary and Secondary Filters -->
|
@@ -124,7 +124,7 @@ unset($settings['secondary_filter_id']['options'][$primary_filter_id]);
|
|
124 |
<script> document.getElementById("primary_filter_id_row").style.display = "none";</script>
|
125 |
<script> document.getElementById("secondary_filter_id_row").style.display = "none";</script> <?php
|
126 |
if ('primary_filter_id' == $key) { ?>
|
127 |
-
<tr id="filters_row"><th><?php _e('Filters', '
|
128 |
<?php }
|
129 |
}
|
130 |
if ($default_filters_exist) { ?>
|
@@ -136,7 +136,7 @@ unset($settings['secondary_filter_id']['options'][$primary_filter_id]);
|
|
136 |
</table>
|
137 |
|
138 |
<p>
|
139 |
-
<?php submit_button(__('Save Changes', '
|
140 |
-
<?php submit_button(__( 'Refresh Resources', '
|
141 |
</p>
|
142 |
</form>
|
9 |
if (array_key_exists('refresh', $_POST)) {
|
10 |
$refresh_success = $this->set_community_resources($community_id);
|
11 |
if ($refresh_success['projects'] == TRUE && $refresh_success['workflows'] == TRUE) {
|
12 |
+
add_settings_error('lingotek_community_resources', 'options', __('Resources from Lingotek were successfully updated for projects and workflows.', 'lingotek-translation'), 'updated');
|
13 |
}
|
14 |
else if ($refresh_success['projects'] == TRUE) {
|
15 |
+
add_settings_error('lingotek_community_resources', 'error', __('Resources from Lingotek were successfully updated for projects.', 'lingotek-translation'), 'updated');
|
16 |
}
|
17 |
else if ($refresh_success['workflows'] == TRUE) {
|
18 |
+
add_settings_error('lingotek_community_resources', 'error', __('Resources from Lingotek were successfully updated for workflows.', 'lingotek-translation'), 'updated');
|
19 |
}
|
20 |
else if ($refresh_success['workflows'] == FALSE || $refresh_success['projects'] == FALSE) {
|
21 |
+
add_settings_error('lingotek_community_resources', 'error', __('The Lingotek TMS is currently unavailable. Please try again later. If the problem persists, contact Lingotek Support.', 'lingotek-translation'), 'error');
|
22 |
}
|
23 |
}
|
24 |
else {
|
30 |
}
|
31 |
}
|
32 |
update_option('lingotek_defaults', $options);
|
33 |
+
add_settings_error('lingotek_defaults', 'defaultgs', __('Your <i>Defaults</i> were sucessfully saved.', 'lingotek-translation'), 'updated');
|
34 |
|
35 |
if (isset($_POST['update_callback'])) {
|
36 |
$client = new Lingotek_API();
|
37 |
if ($client->update_callback_url($options['project_id']))
|
38 |
+
add_settings_error('lingotek_defaults', 'defaultgs', __('Your callback url was successfully updated.', 'lingotek-translation'), 'updated');
|
39 |
}
|
40 |
|
41 |
//adds new project if text box is filled out
|
44 |
$title = stripslashes($_POST['new_project']);
|
45 |
|
46 |
if ($new_id = $client->create_project($title, $community_id)) {
|
47 |
+
add_settings_error('lingotek_defaults', 'defaultgs', __('Your new project was successfully created.', 'lingotek-translation'), 'updated');
|
48 |
$this->set_community_resources($community_id);// updates the cache to include the newly created project
|
49 |
$options['project_id'] = $new_id;
|
50 |
update_option('lingotek_defaults', $options);
|
86 |
unset($settings['secondary_filter_id']['options'][$primary_filter_id]);
|
87 |
?>
|
88 |
|
89 |
+
<h3><?php _e('Defaults', 'lingotek-translation'); ?></h3>
|
90 |
+
<p class="description"><?php _e('The default automation settings and resources that should be used for this site. These settings can be overriden using translation profiles and content type configuration.', 'lingotek-translation'); ?></p>
|
91 |
|
92 |
|
93 |
<form id="lingotek-settings" method="post" action="admin.php?page=<?php echo $page_key; ?>" class="validate">
|
108 |
|
109 |
if (empty($setting['options'])) { ?>
|
110 |
<script> document.getElementById('project_id').style.display = 'none';</script>
|
111 |
+
<input type="text" name="new_project" id="new_project" placeholder="<?php _e('Enter new project name', 'lingotek-translation') ?>" />
|
112 |
<?php }
|
113 |
else { ?>
|
114 |
|
115 |
+
<input type="text" style="display:none" name="new_project" id="new_project" placeholder="<?php _e('Enter new project name', 'lingotek-translation') ?>" />
|
116 |
<input type="checkbox" name="update_callback" id="update_callback"/>
|
117 |
+
<label for="update_callback" id="callback_label"><?php _e('Update the callback url for this project.', 'lingotek-translation') ?></label>
|
118 |
|
119 |
+
<br/><a href="#" id="create" onclick="toggleTextbox()" style="padding-left:3px; color:#999; font-size:80%; text-decoration:none"><b>+</b> <?php echo _e('Create New Project', 'lingotek-translation') ?></a>
|
120 |
<?php } ?>
|
121 |
<?php } ?>
|
122 |
<!-- Code to handle displaying of Primary and Secondary Filters -->
|
124 |
<script> document.getElementById("primary_filter_id_row").style.display = "none";</script>
|
125 |
<script> document.getElementById("secondary_filter_id_row").style.display = "none";</script> <?php
|
126 |
if ('primary_filter_id' == $key) { ?>
|
127 |
+
<tr id="filters_row"><th><?php _e('Filters', 'lingotek-translation') ?></th><td><i><?php _e('Not configured', 'lingotek-translation') ?></i></td></tr>
|
128 |
<?php }
|
129 |
}
|
130 |
if ($default_filters_exist) { ?>
|
136 |
</table>
|
137 |
|
138 |
<p>
|
139 |
+
<?php submit_button(__('Save Changes', 'lingotek-translation'), 'primary', 'submit', false); ?>
|
140 |
+
<?php submit_button(__( 'Refresh Resources', 'lingotek-translation'), 'secondary', 'refresh', false ); ?>
|
141 |
</p>
|
142 |
</form>
|
admin/settings/view-preferences.php
CHANGED
@@ -3,34 +3,34 @@
|
|
3 |
$setting_details = array(
|
4 |
'download_post_status' => array(
|
5 |
'type' => 'dropdown',
|
6 |
-
'label' => __('Download translation status', '
|
7 |
-
'description' => __('The post status for newly downloaded translations', '
|
8 |
'values' => array(
|
9 |
-
Lingotek_Group_Post::SAME_AS_SOURCE => __('Same as source post', '
|
10 |
-
'draft' => __('Draft', '
|
11 |
-
'pending' => __('Pending Review', '
|
12 |
-
'publish' => __('Published', '
|
13 |
-
//'future' => __('Scheduled', '
|
14 |
-
'private' => __('Privately Published', '
|
15 |
)),
|
16 |
'auto_upload_post_statuses' => array( // blacklist
|
17 |
'type' => 'checkboxes',
|
18 |
-
'label' => __('Auto upload statuses', '
|
19 |
-
'description' => __('The post statuses checked above are enabled for automatic upload (when using automatic uploading translation profiles).', '
|
20 |
'values' => array(
|
21 |
-
'draft' => __('Draft', '
|
22 |
-
'pending' => __('Pending Review', '
|
23 |
-
'publish' => __('Published', '
|
24 |
-
'future' => __('Scheduled', '
|
25 |
-
'private' => __('Privately Published', '
|
26 |
)
|
27 |
),
|
28 |
'delete_document_from_tms' => array(
|
29 |
'type' => 'checkboxes',
|
30 |
-
'label' => __('Disassociation', '
|
31 |
-
'description' => __('Your documents will remain in your WordPress site but will be deleted from the Lingotek TMS if this option is checked.', '
|
32 |
'values' => array(
|
33 |
-
'delete' => __('Delete documents from Lingotek TMS when disassociating.', '
|
34 |
)
|
35 |
),
|
36 |
);
|
@@ -50,7 +50,7 @@ if (!empty($_POST)) {
|
|
50 |
}
|
51 |
update_option('lingotek_prefs', $options);
|
52 |
|
53 |
-
add_settings_error('lingotek_prefs', 'prefs', __('Your preferences were successfully updated.', '
|
54 |
settings_errors();
|
55 |
}
|
56 |
|
@@ -58,8 +58,8 @@ $selected_options = Lingotek_Model::get_prefs();
|
|
58 |
|
59 |
?>
|
60 |
|
61 |
-
<h3><?php _e('Preferences', '
|
62 |
-
<p class="description"><?php _e('These are your preferred settings.', '
|
63 |
|
64 |
|
65 |
<form id="lingotek-settings" method="post" action="admin.php?page=<?php echo $page_key; ?>" class="validate">
|
@@ -93,5 +93,5 @@ $selected_options = Lingotek_Model::get_prefs();
|
|
93 |
</tr><?php } ?>
|
94 |
</table>
|
95 |
|
96 |
-
<?php submit_button(__('Save Changes', '
|
97 |
</form>
|
3 |
$setting_details = array(
|
4 |
'download_post_status' => array(
|
5 |
'type' => 'dropdown',
|
6 |
+
'label' => __('Download translation status', 'lingotek-translation'),
|
7 |
+
'description' => __('The post status for newly downloaded translations', 'lingotek-translation'),
|
8 |
'values' => array(
|
9 |
+
Lingotek_Group_Post::SAME_AS_SOURCE => __('Same as source post', 'lingotek-translation'),
|
10 |
+
'draft' => __('Draft', 'lingotek-translation'),
|
11 |
+
'pending' => __('Pending Review', 'lingotek-translation'),
|
12 |
+
'publish' => __('Published', 'lingotek-translation'),
|
13 |
+
//'future' => __('Scheduled', 'lingotek-translation'),
|
14 |
+
'private' => __('Privately Published', 'lingotek-translation'),
|
15 |
)),
|
16 |
'auto_upload_post_statuses' => array( // blacklist
|
17 |
'type' => 'checkboxes',
|
18 |
+
'label' => __('Auto upload statuses', 'lingotek-translation'),
|
19 |
+
'description' => __('The post statuses checked above are enabled for automatic upload (when using automatic uploading translation profiles).', 'lingotek-translation'),
|
20 |
'values' => array(
|
21 |
+
'draft' => __('Draft', 'lingotek-translation'),
|
22 |
+
'pending' => __('Pending Review', 'lingotek-translation'),
|
23 |
+
'publish' => __('Published', 'lingotek-translation'),
|
24 |
+
'future' => __('Scheduled', 'lingotek-translation'),
|
25 |
+
'private' => __('Privately Published', 'lingotek-translation'),
|
26 |
)
|
27 |
),
|
28 |
'delete_document_from_tms' => array(
|
29 |
'type' => 'checkboxes',
|
30 |
+
'label' => __('Disassociation', 'lingotek-translation'),
|
31 |
+
'description' => __('Your documents will remain in your WordPress site but will be deleted from the Lingotek TMS if this option is checked.', 'lingotek-translation'),
|
32 |
'values' => array(
|
33 |
+
'delete' => __('Delete documents from Lingotek TMS when disassociating.', 'lingotek-translation'),
|
34 |
)
|
35 |
),
|
36 |
);
|
50 |
}
|
51 |
update_option('lingotek_prefs', $options);
|
52 |
|
53 |
+
add_settings_error('lingotek_prefs', 'prefs', __('Your preferences were successfully updated.', 'lingotek-translation'), 'updated');
|
54 |
settings_errors();
|
55 |
}
|
56 |
|
58 |
|
59 |
?>
|
60 |
|
61 |
+
<h3><?php _e('Preferences', 'lingotek-translation'); ?></h3>
|
62 |
+
<p class="description"><?php _e('These are your preferred settings.', 'lingotek-translation'); ?></p>
|
63 |
|
64 |
|
65 |
<form id="lingotek-settings" method="post" action="admin.php?page=<?php echo $page_key; ?>" class="validate">
|
93 |
</tr><?php } ?>
|
94 |
</table>
|
95 |
|
96 |
+
<?php submit_button(__('Save Changes', 'lingotek-translation'), 'primary', 'submit', false); ?>
|
97 |
</form>
|
admin/settings/view-utilities.php
CHANGED
@@ -8,7 +8,7 @@ if (!empty($_POST)) {
|
|
8 |
if (!empty($_POST['utility_disassociate'])) {
|
9 |
$ids = Lingotek_Utilities::get_all_document_ids();
|
10 |
if (!empty($ids))
|
11 |
-
printf('<div id="lingotek-progressdialog" title="%s"><div id="lingotek-progressbar"></div></div>', __('Disassociating content...', '
|
12 |
}
|
13 |
|
14 |
$utilities = array();
|
@@ -22,30 +22,30 @@ if (!empty($_POST)) {
|
|
22 |
}
|
23 |
|
24 |
?>
|
25 |
-
<h3><?php _e('Utilities', '
|
26 |
-
<p class="description"><?php _e('These utilities are designed to help you prepare and maintain your multilingual content.', '
|
27 |
|
28 |
-
<h4><?php _e('Language', '
|
29 |
<form id="lingotek-utilities" method="post" action="admin.php?page=<?php echo $page_key; ?>" class="validate"><?php
|
30 |
wp_nonce_field($page_key, '_wpnonce_' . $page_key);
|
31 |
|
32 |
printf(
|
33 |
'<p><input type="checkbox" name="%1$s" id="%1$s"/><label for="%1$s">%2$s</label></p>',
|
34 |
'utility_set_default_language',
|
35 |
-
__('Set <i>default language</i> as the language for all content that has not been assigned a language.', '
|
36 |
);
|
37 |
|
38 |
?>
|
39 |
-
<h4><?php _e('Disassociation', '
|
40 |
<?php
|
41 |
|
42 |
printf(
|
43 |
'<p><input type="checkbox" name="%1$s" id="%1$s"/><label for="%1$s">%2$s</label></p>',
|
44 |
'utility_disassociate',
|
45 |
-
__('Disassociate all the content from Lingotek TMS.', '
|
46 |
);
|
47 |
|
48 |
-
$confirm_disassociate = __('You are about to disassociate all your content from Lingotek TMS. Are you sure ?', '
|
49 |
|
50 |
$confirm_js = "
|
51 |
d = document.getElementById('utility_disassociate');
|
@@ -53,7 +53,7 @@ if (!empty($_POST)) {
|
|
53 |
return confirm('$confirm_disassociate');
|
54 |
}";
|
55 |
|
56 |
-
submit_button(__('Run Utilities', '
|
57 |
</form><?php
|
58 |
|
59 |
|
8 |
if (!empty($_POST['utility_disassociate'])) {
|
9 |
$ids = Lingotek_Utilities::get_all_document_ids();
|
10 |
if (!empty($ids))
|
11 |
+
printf('<div id="lingotek-progressdialog" title="%s"><div id="lingotek-progressbar"></div></div>', __('Disassociating content...', 'lingotek-translation'));
|
12 |
}
|
13 |
|
14 |
$utilities = array();
|
22 |
}
|
23 |
|
24 |
?>
|
25 |
+
<h3><?php _e('Utilities', 'lingotek-translation'); ?></h3>
|
26 |
+
<p class="description"><?php _e('These utilities are designed to help you prepare and maintain your multilingual content.', 'lingotek-translation'); ?></p>
|
27 |
|
28 |
+
<h4><?php _e('Language', 'lingotek-translation'); ?></h4>
|
29 |
<form id="lingotek-utilities" method="post" action="admin.php?page=<?php echo $page_key; ?>" class="validate"><?php
|
30 |
wp_nonce_field($page_key, '_wpnonce_' . $page_key);
|
31 |
|
32 |
printf(
|
33 |
'<p><input type="checkbox" name="%1$s" id="%1$s"/><label for="%1$s">%2$s</label></p>',
|
34 |
'utility_set_default_language',
|
35 |
+
__('Set <i>default language</i> as the language for all content that has not been assigned a language.', 'lingotek-translation')
|
36 |
);
|
37 |
|
38 |
?>
|
39 |
+
<h4><?php _e('Disassociation', 'lingotek-translation'); ?></h4>
|
40 |
<?php
|
41 |
|
42 |
printf(
|
43 |
'<p><input type="checkbox" name="%1$s" id="%1$s"/><label for="%1$s">%2$s</label></p>',
|
44 |
'utility_disassociate',
|
45 |
+
__('Disassociate all the content from Lingotek TMS.', 'lingotek-translation')
|
46 |
);
|
47 |
|
48 |
+
$confirm_disassociate = __('You are about to disassociate all your content from Lingotek TMS. Are you sure ?', 'lingotek-translation');
|
49 |
|
50 |
$confirm_js = "
|
51 |
d = document.getElementById('utility_disassociate');
|
53 |
return confirm('$confirm_disassociate');
|
54 |
}";
|
55 |
|
56 |
+
submit_button(__('Run Utilities', 'lingotek-translation'), 'primary', 'submit', true, sprintf('onclick="%s"', $confirm_js)); ?>
|
57 |
</form><?php
|
58 |
|
59 |
|
admin/string-actions.php
CHANGED
@@ -48,7 +48,7 @@ class Lingotek_String_actions extends Lingotek_Actions {
|
|
48 |
* @return string
|
49 |
*/
|
50 |
protected function get_action_link($args, $warning = false) {
|
51 |
-
$args['page'] = '
|
52 |
$args['noheader'] = true;
|
53 |
return parent::get_action_link($args, $warning);
|
54 |
}
|
@@ -74,7 +74,7 @@ class Lingotek_String_actions extends Lingotek_Actions {
|
|
74 |
|
75 |
$redirect = remove_query_arg( array('action', 'action2'), wp_get_referer() );
|
76 |
if (!$redirect)
|
77 |
-
$redirect = admin_url("admin.php?page=
|
78 |
|
79 |
switch($action) {
|
80 |
case 'bulk-lingotek-upload':
|
48 |
* @return string
|
49 |
*/
|
50 |
protected function get_action_link($args, $warning = false) {
|
51 |
+
$args['page'] = 'lingotek-translation_manage';
|
52 |
$args['noheader'] = true;
|
53 |
return parent::get_action_link($args, $warning);
|
54 |
}
|
74 |
|
75 |
$redirect = remove_query_arg( array('action', 'action2'), wp_get_referer() );
|
76 |
if (!$redirect)
|
77 |
+
$redirect = admin_url("admin.php?page=lingotek-translation_manage&sm=strings");
|
78 |
|
79 |
switch($action) {
|
80 |
case 'bulk-lingotek-upload':
|
admin/strings-table.php
CHANGED
@@ -105,8 +105,8 @@ class Lingotek_Strings_Table extends WP_List_Table {
|
|
105 |
function get_columns() {
|
106 |
$columns = array(
|
107 |
'cb' => '<input type="checkbox" />', //checkbox
|
108 |
-
'context' => __('Group', '
|
109 |
-
'count' => __('Count', '
|
110 |
);
|
111 |
|
112 |
foreach ($GLOBALS['polylang']->model->get_languages_list() as $lang) {
|
105 |
function get_columns() {
|
106 |
$columns = array(
|
107 |
'cb' => '<input type="checkbox" />', //checkbox
|
108 |
+
'context' => __('Group', 'lingotek-translation'),
|
109 |
+
'count' => __('Count', 'lingotek-translation'),
|
110 |
);
|
111 |
|
112 |
foreach ($GLOBALS['polylang']->model->get_languages_list() as $lang) {
|
admin/term-actions.php
CHANGED
@@ -32,7 +32,7 @@ class Lingotek_Term_actions extends Lingotek_Actions {
|
|
32 |
* @return object
|
33 |
*/
|
34 |
protected function get_language($term_id) {
|
35 |
-
return
|
36 |
}
|
37 |
|
38 |
/*
|
@@ -62,7 +62,7 @@ class Lingotek_Term_actions extends Lingotek_Actions {
|
|
62 |
if ($this->pllm->is_translated_taxonomy($term->taxonomy)) {
|
63 |
$actions = $this->_row_actions($actions, $term->term_id);
|
64 |
|
65 |
-
$language =
|
66 |
if (!empty($language)) {
|
67 |
$profile = Lingotek_Model::get_profile($term->taxonomy, $language);
|
68 |
if ('disabled' == $profile['profile'])
|
32 |
* @return object
|
33 |
*/
|
34 |
protected function get_language($term_id) {
|
35 |
+
return PLL()->model->term->get_language($term_id);
|
36 |
}
|
37 |
|
38 |
/*
|
62 |
if ($this->pllm->is_translated_taxonomy($term->taxonomy)) {
|
63 |
$actions = $this->_row_actions($actions, $term->term_id);
|
64 |
|
65 |
+
$language = PLL()->model->term->get_language($term->term_id);
|
66 |
if (!empty($language)) {
|
67 |
$profile = Lingotek_Model::get_profile($term->taxonomy, $language);
|
68 |
if ('disabled' == $profile['profile'])
|
admin/tutorial/content.php
CHANGED
@@ -19,77 +19,77 @@
|
|
19 |
}
|
20 |
</style>
|
21 |
|
22 |
-
<p><?php _e('', '
|
23 |
|
24 |
<div>
|
25 |
-
<h4><?php _e('1. Create content', '
|
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>.', '
|
27 |
-
<?php _e('The examples shown below are for Pages but translation for other content types works the same way!', '
|
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.', '
|
30 |
</div>
|
31 |
<div>
|
32 |
-
<h4><?php _e('2. Upload content to Lingotek', '
|
33 |
-
<p><?php _e('Your Wordpress content can be uploaded to <i>Lingotek</i> with the simple push of a button.', '
|
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.', '
|
36 |
</div>
|
37 |
<div>
|
38 |
-
<h4><?php _e('3. Request translations for target languages', '
|
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.', '
|
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.', '
|
42 |
</div>
|
43 |
<div>
|
44 |
-
<h4><?php _e('4. Translate your content', '
|
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.', '
|
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.', '
|
48 |
</div>
|
49 |
<div>
|
50 |
-
<h4><?php _e('5. Download translations', '
|
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).', '
|
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.', '
|
54 |
</div>
|
55 |
<div>
|
56 |
-
<h4><?php _e('6. Your content is translated!', '
|
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.', '
|
58 |
<img class="lingotek-bordered" src="<?php echo LINGOTEK_URL . '/admin/tutorial/img/translations-downloaded.png'; ?>">
|
59 |
-
<p class="img-caption"><?php _e('Your content has been translated.', '
|
60 |
</div>
|
61 |
|
62 |
-
<h2><?php _e('What do all the icons mean?', '
|
63 |
|
64 |
<table>
|
65 |
<tr>
|
66 |
<td><span class="lingotek-color dashicons dashicons-upload"></span></td>
|
67 |
-
<th><?php _e('Upload Source', '
|
68 |
-
<td><?php _e('There is content ready to be uploaded to Lingotek.', '
|
69 |
</tr>
|
70 |
<tr>
|
71 |
<td><span class="lingotek-color dashicons dashicons-clock"></span></td>
|
72 |
-
<th><?php _e('In Progress', '
|
73 |
-
<td><?php _e('Content is importing to Lingotek or a target language is being added to source content.', '
|
74 |
</tr>
|
75 |
<tr>
|
76 |
<td><span class="lingotek-color dashicons dashicons-yes"></span></td>
|
77 |
-
<th><?php _e('Source Uploaded', '
|
78 |
-
<td><?php _e('The source content has been uploaded to Lingotek.', '
|
79 |
</tr>
|
80 |
<tr>
|
81 |
<td><span class="lingotek-color dashicons dashicons-plus"></span></td>
|
82 |
-
<th><?php _e('Request Translation', '
|
83 |
-
<td><?php _e('Request a translation of the source content. (Add a target language)', '
|
84 |
</tr>
|
85 |
<tr>
|
86 |
<td><span class="lingotek-color dashicons dashicons-download"></span></td>
|
87 |
-
<th><?php _e('Download Translation', '
|
88 |
-
<td><?php _e('Download the translated content to Wordpress.', '
|
89 |
</tr>
|
90 |
<tr>
|
91 |
<td><span class="lingotek-color dashicons dashicons-edit"></span></td>
|
92 |
-
<th><?php _e('Translation Current', '
|
93 |
-
<td><?php _e('The translation is complete. (Clicking on this icon will allow you to edit translations in the Lingotek Workbench)', '
|
94 |
</tr>
|
95 |
</table>
|
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'; ?>">
|
59 |
+
<p class="img-caption"><?php _e('Your content has been translated.', 'lingotek-translation') ?></p>
|
60 |
</div>
|
61 |
|
62 |
+
<h2><?php _e('What do all the icons mean?', 'lingotek-translation') ?></h2>
|
63 |
|
64 |
<table>
|
65 |
<tr>
|
66 |
<td><span class="lingotek-color dashicons dashicons-upload"></span></td>
|
67 |
+
<th><?php _e('Upload Source', 'lingotek-translation') ?></th>
|
68 |
+
<td><?php _e('There is content ready to be uploaded to Lingotek.', 'lingotek-translation') ?></td>
|
69 |
</tr>
|
70 |
<tr>
|
71 |
<td><span class="lingotek-color dashicons dashicons-clock"></span></td>
|
72 |
+
<th><?php _e('In Progress', 'lingotek-translation') ?></th>
|
73 |
+
<td><?php _e('Content is importing to Lingotek or a target language is being added to source content.', 'lingotek-translation') ?></td>
|
74 |
</tr>
|
75 |
<tr>
|
76 |
<td><span class="lingotek-color dashicons dashicons-yes"></span></td>
|
77 |
+
<th><?php _e('Source Uploaded', 'lingotek-translation') ?></th>
|
78 |
+
<td><?php _e('The source content has been uploaded to Lingotek.', 'lingotek-translation') ?></td>
|
79 |
</tr>
|
80 |
<tr>
|
81 |
<td><span class="lingotek-color dashicons dashicons-plus"></span></td>
|
82 |
+
<th><?php _e('Request Translation', 'lingotek-translation') ?></th>
|
83 |
+
<td><?php _e('Request a translation of the source content. (Add a target language)', 'lingotek-translation') ?></td>
|
84 |
</tr>
|
85 |
<tr>
|
86 |
<td><span class="lingotek-color dashicons dashicons-download"></span></td>
|
87 |
+
<th><?php _e('Download Translation', 'lingotek-translation') ?></th>
|
88 |
+
<td><?php _e('Download the translated content to Wordpress.', 'lingotek-translation') ?></td>
|
89 |
</tr>
|
90 |
<tr>
|
91 |
<td><span class="lingotek-color dashicons dashicons-edit"></span></td>
|
92 |
+
<th><?php _e('Translation Current', 'lingotek-translation') ?></th>
|
93 |
+
<td><?php _e('The translation is complete. (Clicking on this icon will allow you to edit translations in the Lingotek Workbench)', 'lingotek-translation') ?></td>
|
94 |
</tr>
|
95 |
</table>
|
admin/tutorial/credits.php
CHANGED
@@ -75,9 +75,9 @@ shuffle($contributors);
|
|
75 |
|
76 |
?>
|
77 |
|
78 |
-
<p class="about-description"><?php _e('The Lingotek plugin for WordPress is created with love.', '
|
79 |
|
80 |
-
<h4 class="wp-people-group"><?php _e('Project Leaders', '
|
81 |
|
82 |
<ul class="wp-people-group">
|
83 |
<?php
|
@@ -93,7 +93,7 @@ shuffle($contributors);
|
|
93 |
?>
|
94 |
</ul>
|
95 |
|
96 |
-
<h4 class="wp-people-group"><?php _e('Contributors', '
|
97 |
|
98 |
<ul class="wp-people-group">
|
99 |
<?php
|
75 |
|
76 |
?>
|
77 |
|
78 |
+
<p class="about-description"><?php _e('The Lingotek plugin for WordPress is created with love.', 'lingotek-translation'); ?></p>
|
79 |
|
80 |
+
<h4 class="wp-people-group"><?php _e('Project Leaders', 'lingotek-translation'); ?></h4>
|
81 |
|
82 |
<ul class="wp-people-group">
|
83 |
<?php
|
93 |
?>
|
94 |
</ul>
|
95 |
|
96 |
+
<h4 class="wp-people-group"><?php _e('Contributors', 'lingotek-translation'); ?></h4>
|
97 |
|
98 |
<ul class="wp-people-group">
|
99 |
<?php
|
admin/tutorial/faq.php
CHANGED
@@ -7,59 +7,59 @@
|
|
7 |
}
|
8 |
</style>
|
9 |
|
10 |
-
<p class="about-description"><?php _e('Questions and answers...', '
|
11 |
|
12 |
-
<b><?php _e('How does this really work?', '
|
13 |
-
<p><?php _e('<i>Polylang</i> puts in the framework to make WordPress multilingual and <i>Lingotek</i> leverages that framework to provide localization through machine translation and professional translation services.', '
|
14 |
|
15 |
-
<b><?php _e('What does the Lingotek plugin do?', '
|
16 |
-
<p><?php _e('<i>Lingotek</i> has teamed up with <i>Polylang</i> to offer a simple way to make your WordPress site truly multilingual. Manage all your multilingual content in the same site. No need to have a different site for each language!', '
|
17 |
|
18 |
-
<b><?php _e('How can I add a language?', '
|
19 |
-
<p><?php _e('On the <i>translation dashboard</i>, click on the <i>Translate my site into...</i> textbox and choose from the list or start typing to quickly find a language.', '
|
20 |
|
21 |
-
<b><?php _e('How can I remove a language?', '
|
22 |
<p>
|
23 |
-
<?php _e('On the <i>translation dashboard</i>, click on the blue check mark for the language you would like to remove.', '
|
24 |
-
<i><?php _e('Note: If you have translated content in a language you will not be able to remove that language until that content has been deleted.', '
|
25 |
</p>
|
26 |
|
27 |
-
<b><?php _e("Why can't I upload my existing content to Lingotek?", '
|
28 |
-
<p><?php printf(__("You must assign a language to content that existed before you installed the <i>Polylang</i> and <i>Lingotek</i> plugins. You can do this manually or use the <a href='%s'><i>Lingotek Language Utility</i></a> to set all content that doesn't have an assigned language to the default language. This will allow you to upload your existing content to Lingotek.", '
|
29 |
|
30 |
-
<b><?php _e("Can I use my own translation agency with Lingotek?", '
|
31 |
-
<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." , '
|
32 |
|
33 |
-
<b><?php _e('How can I check the overall translation progress of my site?', '
|
34 |
-
<p><?php _e('On the <i>translation dashboard</i>, the bars under <i>Completed Percentage</i> show the translation progress of content for each language. You can filter by content type or show progress for all content.', '
|
35 |
<ul>
|
36 |
<li>
|
37 |
-
<b><?php _e('Why are there two different shades of blue in the progress bar?', '
|
38 |
-
<p><?php _e('The <i>translation dashboard</i> not only shows how much of your content is translated, but also indicates the language that your source content was authored in.', '
|
39 |
</li>
|
40 |
<ul style="list-style-type:disc; padding-left:30px">
|
41 |
-
<li><?php _e('<i>Dark Blue:</i> Indicates that this is a source language that the content was authored in.', '
|
42 |
-
<li><?php _e('<i>Light Blue:</i> Indicates that this is a target language that the content was translated into.', '
|
43 |
</ul>
|
44 |
</ul>
|
45 |
|
46 |
-
<b><?php _e('What happens when I <i>Disassociate Translations</i>?', '
|
47 |
-
<p><?php _e('When content is disassociated, the connection between WordPress and <i>Lingotek</i> is safely removed so that translations can be solely managed inside of WordPress.', '
|
48 |
|
49 |
-
<b><?php _e("How do I translate strings within widgets or general WordPress settings (e.g., Site Title, Tagline)?", '
|
50 |
-
<p><?php printf(__( "Groups of strings can be sent for translation and managed using the <a href='%s'>String Groups</a> page. Individual strings may be viewed on the <a href='%s'>Strings</a> page." , '
|
51 |
|
52 |
|
53 |
<div class="changelog feature-section two-col">
|
54 |
<div>
|
55 |
<img class="workbench-image" src="<?php echo LINGOTEK_URL . '/admin/tutorial/img/workbench-full.png'; ?>">
|
56 |
-
<h3><?php _e( 'Lingotek Workbench', '
|
57 |
-
<p><?php _e( 'Lingotek Translation is the only WordPress plugin to integrate a Translation Management System directly into WordPress, thus allowing the WordPress community to use professional-grade translation technologies (e.g. machine translation, translation memory, CAT tool) without ever having to leave the comfort of the WordPress environment.', '
|
58 |
</div>
|
59 |
<div class="last-feature">
|
60 |
-
<a href="admin.php?page=
|
61 |
-
<h3><?php _e( 'Translation Dashboard', '
|
62 |
-
<p><?php _e( "The <i>translation dashboard</i> allows you to view your site languages, add and remove new languages, check the overall translation progress of your site, see site analytics, and connect with Lingotek support.", '
|
63 |
</div>
|
64 |
</div>
|
65 |
|
7 |
}
|
8 |
</style>
|
9 |
|
10 |
+
<p class="about-description"><?php _e('Questions and answers...', 'lingotek-translation'); ?></p>
|
11 |
|
12 |
+
<b><?php _e('How does this really work?', 'lingotek-translation') ?></b>
|
13 |
+
<p><?php _e('<i>Polylang</i> puts in the framework to make WordPress multilingual and <i>Lingotek</i> leverages that framework to provide localization through machine translation and professional translation services.', 'lingotek-translation') ?></p>
|
14 |
|
15 |
+
<b><?php _e('What does the Lingotek plugin do?', 'lingotek-translation') ?></b>
|
16 |
+
<p><?php _e('<i>Lingotek</i> has teamed up with <i>Polylang</i> to offer a simple way to make your WordPress site truly multilingual. Manage all your multilingual content in the same site. No need to have a different site for each language!', 'lingotek-translation') ?></p>
|
17 |
|
18 |
+
<b><?php _e('How can I add a language?', 'lingotek-translation') ?></b>
|
19 |
+
<p><?php _e('On the <i>translation dashboard</i>, click on the <i>Translate my site into...</i> textbox and choose from the list or start typing to quickly find a language.', 'lingotek-translation') ?></p>
|
20 |
|
21 |
+
<b><?php _e('How can I remove a language?', 'lingotek-translation') ?></b>
|
22 |
<p>
|
23 |
+
<?php _e('On the <i>translation dashboard</i>, click on the blue check mark for the language you would like to remove.', 'lingotek-translation') ?>
|
24 |
+
<i><?php _e('Note: If you have translated content in a language you will not be able to remove that language until that content has been deleted.', 'lingotek-translation') ?></i>
|
25 |
</p>
|
26 |
|
27 |
+
<b><?php _e("Why can't I upload my existing content to Lingotek?", 'lingotek-translation') ?></b>
|
28 |
+
<p><?php printf(__("You must assign a language to content that existed before you installed the <i>Polylang</i> and <i>Lingotek</i> plugins. You can do this manually or use the <a href='%s'><i>Lingotek Language Utility</i></a> to set all content that doesn't have an assigned language to the default language. This will allow you to upload your existing content to Lingotek.", 'lingotek-translation'), 'admin.php?page=lingotek-translation_settings&sm=utilities'); ?></p>
|
29 |
|
30 |
+
<b><?php _e("Can I use my own translation agency with Lingotek?", 'lingotek-translation') ?></b>
|
31 |
+
<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>
|
32 |
|
33 |
+
<b><?php _e('How can I check the overall translation progress of my site?', 'lingotek-translation') ?></b>
|
34 |
+
<p><?php _e('On the <i>translation dashboard</i>, the bars under <i>Completed Percentage</i> show the translation progress of content for each language. You can filter by content type or show progress for all content.', 'lingotek-translation') ?></p>
|
35 |
<ul>
|
36 |
<li>
|
37 |
+
<b><?php _e('Why are there two different shades of blue in the progress bar?', 'lingotek-translation') ?></b>
|
38 |
+
<p><?php _e('The <i>translation dashboard</i> not only shows how much of your content is translated, but also indicates the language that your source content was authored in.', 'lingotek-translation') ?></p>
|
39 |
</li>
|
40 |
<ul style="list-style-type:disc; padding-left:30px">
|
41 |
+
<li><?php _e('<i>Dark Blue:</i> Indicates that this is a source language that the content was authored in.', 'lingotek-translation') ?></li>
|
42 |
+
<li><?php _e('<i>Light Blue:</i> Indicates that this is a target language that the content was translated into.', 'lingotek-translation') ?></li>
|
43 |
</ul>
|
44 |
</ul>
|
45 |
|
46 |
+
<b><?php _e('What happens when I <i>Disassociate Translations</i>?', 'lingotek-translation') ?></b>
|
47 |
+
<p><?php _e('When content is disassociated, the connection between WordPress and <i>Lingotek</i> is safely removed so that translations can be solely managed inside of WordPress.', 'lingotek-translation') ?></p>
|
48 |
|
49 |
+
<b><?php _e("How do I translate strings within widgets or general WordPress settings (e.g., Site Title, Tagline)?", 'lingotek-translation') ?></b>
|
50 |
+
<p><?php printf(__( "Groups of strings can be sent for translation and managed using the <a href='%s'>String Groups</a> page. Individual strings may be viewed on the <a href='%s'>Strings</a> page." , 'lingotek-translation'),'admin.php?page=lingotek-translation_manage&sm=string-groups','admin.php?page=lingotek-translation_manage&sm=strings'); ?></p>
|
51 |
|
52 |
|
53 |
<div class="changelog feature-section two-col">
|
54 |
<div>
|
55 |
<img class="workbench-image" src="<?php echo LINGOTEK_URL . '/admin/tutorial/img/workbench-full.png'; ?>">
|
56 |
+
<h3><?php _e( 'Lingotek Workbench', 'lingotek-translation'); ?></h3>
|
57 |
+
<p><?php _e( 'Lingotek Translation is the only WordPress plugin to integrate a Translation Management System directly into WordPress, thus allowing the WordPress community to use professional-grade translation technologies (e.g. machine translation, translation memory, CAT tool) without ever having to leave the comfort of the WordPress environment.', 'lingotek-translation'); ?></p>
|
58 |
</div>
|
59 |
<div class="last-feature">
|
60 |
+
<a href="admin.php?page=lingotek-translation"><img src="<?php echo LINGOTEK_URL . '/admin/tutorial/img/dashboard.png'; ?>"></a>
|
61 |
+
<h3><?php _e( 'Translation Dashboard', 'lingotek-translation'); ?></h3>
|
62 |
+
<p><?php _e( "The <i>translation dashboard</i> allows you to view your site languages, add and remove new languages, check the overall translation progress of your site, see site analytics, and connect with Lingotek support.", 'lingotek-translation'); ?></p>
|
63 |
</div>
|
64 |
</div>
|
65 |
|
admin/tutorial/features.php
CHANGED
@@ -1,19 +1,19 @@
|
|
1 |
|
2 |
<div class="feature-section three-col">
|
3 |
<div class="col">
|
4 |
-
<a href="admin.php?page=
|
5 |
-
<h3><?php _e( 'Translate into new languages', '
|
6 |
-
<p><?php printf( __( 'Easily translate your site into new languages by adding the desired language to your site. Lingotek allows you to quickly add any of the most frequently used locales using the <a href="%s" title="Translation > Dashboard">Translation Dashboard</a>.', '
|
7 |
</div>
|
8 |
<div class="col">
|
9 |
<img class="lingotek-bordered" src="<?php echo LINGOTEK_URL . '/admin/tutorial/img/automatic-translation.gif'; ?>">
|
10 |
-
<h3><?php _e( 'Automatically translate content', '
|
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).", '
|
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', '
|
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.', '
|
17 |
</div>
|
18 |
|
19 |
</div>
|
@@ -21,36 +21,36 @@
|
|
21 |
|
22 |
<div class="feature-section three-col">
|
23 |
<div class="col">
|
24 |
-
<a href="admin.php?page=
|
25 |
-
<h3><?php _e( 'Use translation profiles', '
|
26 |
-
<p><?php _e( 'One of the most time-consuming activities of any multilingual web-site project is managing the ongoing flow of changes and additions to site content and configurations. Translation profiles were created to allow you to create and save and re-use your translation settings.', '
|
27 |
</div>
|
28 |
<div class="col">
|
29 |
-
<a href="admin.php?page=
|
30 |
-
<h3><?php _e( 'Content type profiles', '
|
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.', '
|
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', '
|
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.", '
|
37 |
-
<a href="http://www.lingotek.com/wordpress/request-professional-translation" class="button button-primary" target="_blank"><?php _e('Request Translation', '
|
38 |
</div>
|
39 |
</div>
|
40 |
|
41 |
|
42 |
<div class="feature-section three-col">
|
43 |
<div class="col">
|
44 |
-
<a href="admin.php?page=
|
45 |
-
<h3><?php _e( 'Need Extra Services?', '
|
46 |
-
<p><?php _e( 'Start the process of getting extra services.', '
|
47 |
<ul style="list-style-type: circle;">
|
48 |
-
<li><?php _e('Do you need someone to run your localization project?', '
|
49 |
-
<li><?php _e('Do you need customized workflows?', '
|
50 |
-
<li><?php _e('Do you you have existing Translation Memories you would like to use?', '
|
51 |
-
<li><?php _e('Do you need help creating glossaries and terminologies?', '
|
52 |
</ul>
|
53 |
-
<a href="http://www.lingotek.com/wordpress/extra_services" class="button button-primary" target="_blank"><?php _e('Request Services', '
|
54 |
</div>
|
55 |
<div class="col">
|
56 |
</div>
|
1 |
|
2 |
<div class="feature-section three-col">
|
3 |
<div class="col">
|
4 |
+
<a href="admin.php?page=lingotek-translation"><img src="<?php echo LINGOTEK_URL . '/admin/tutorial/img/add-languages.png'; ?>"></a>
|
5 |
+
<h3><?php _e( 'Translate into new languages', 'lingotek-translation' ); ?></h3>
|
6 |
+
<p><?php printf( __( 'Easily translate your site into new languages by adding the desired language to your site. Lingotek allows you to quickly add any of the most frequently used locales using the <a href="%s" title="Translation > Dashboard">Translation Dashboard</a>.', 'lingotek-translation' ), 'admin.php?page=lingotek-translation' ); ?></p>
|
7 |
</div>
|
8 |
<div class="col">
|
9 |
<img class="lingotek-bordered" src="<?php echo LINGOTEK_URL . '/admin/tutorial/img/automatic-translation.gif'; ?>">
|
10 |
+
<h3><?php _e( 'Automatically translate content', 'lingotek-translation' ); ?></h3>
|
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>
|
21 |
|
22 |
<div class="feature-section three-col">
|
23 |
<div class="col">
|
24 |
+
<a href="admin.php?page=lingotek-translation_manage&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>
|
26 |
+
<p><?php _e( 'One of the most time-consuming activities of any multilingual web-site project is managing the ongoing flow of changes and additions to site content and configurations. Translation profiles were created to allow you to create and save and re-use your translation settings.', 'lingotek-translation'); ?></p>
|
27 |
</div>
|
28 |
<div class="col">
|
29 |
+
<a href="admin.php?page=lingotek-translation_manage&sm=content"><img src="<?php echo LINGOTEK_URL . '/admin/tutorial/img/content-types.png'; ?>"></a>
|
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 |
|
42 |
<div class="feature-section three-col">
|
43 |
<div class="col">
|
44 |
+
<a href="admin.php?page=lingotek-translation_manage&sm=profiles"><img src="<?php echo LINGOTEK_URL . '/admin/tutorial/img/translation-services.png'; ?>"></a>
|
45 |
+
<h3><?php _e( 'Need Extra Services?', 'lingotek-translation'); ?></h3>
|
46 |
+
<p><?php _e( 'Start the process of getting extra services.', 'lingotek-translation'); ?></p>
|
47 |
<ul style="list-style-type: circle;">
|
48 |
+
<li><?php _e('Do you need someone to run your localization project?', 'lingotek-translation'); ?></li>
|
49 |
+
<li><?php _e('Do you need customized workflows?', 'lingotek-translation'); ?></li>
|
50 |
+
<li><?php _e('Do you you have existing Translation Memories you would like to use?', 'lingotek-translation'); ?></li>
|
51 |
+
<li><?php _e('Do you need help creating glossaries and terminologies?', 'lingotek-translation'); ?></li>
|
52 |
</ul>
|
53 |
+
<a href="http://www.lingotek.com/wordpress/extra_services" class="button button-primary" target="_blank"><?php _e('Request Services', 'lingotek-translation'); ?></a>
|
54 |
</div>
|
55 |
<div class="col">
|
56 |
</div>
|
admin/utilities.php
CHANGED
@@ -75,7 +75,7 @@ class Lingotek_Utilities {
|
|
75 |
if (!empty($nolang['terms']))
|
76 |
$this->pllm->set_language_in_mass('term', $nolang['terms'], $this->pllm->options['default_lang']);
|
77 |
}
|
78 |
-
add_settings_error('lingotek_utilities', 'utilities', __('The language update utility ran successfully.', '
|
79 |
return 0;
|
80 |
}
|
81 |
|
75 |
if (!empty($nolang['terms']))
|
76 |
$this->pllm->set_language_in_mass('term', $nolang['terms'], $this->pllm->options['default_lang']);
|
77 |
}
|
78 |
+
add_settings_error('lingotek_utilities', 'utilities', __('The language update utility ran successfully.', 'lingotek-translation'), 'updated');
|
79 |
return 0;
|
80 |
}
|
81 |
|
admin/view-dashboard.php
CHANGED
@@ -1,5 +1,5 @@
|
|
1 |
<div class="wrap">
|
2 |
-
<h2><?php _e('Dashboard', '
|
3 |
<script>
|
4 |
var cms_data = <?php echo json_encode($cms_data); ?>
|
5 |
</script>
|
1 |
<div class="wrap">
|
2 |
+
<h2><?php _e('Dashboard', 'lingotek-translation'); ?></h2>
|
3 |
<script>
|
4 |
var cms_data = <?php echo json_encode($cms_data); ?>
|
5 |
</script>
|
admin/view-manage.php
CHANGED
@@ -1,14 +1,14 @@
|
|
1 |
<div class="wrap">
|
2 |
-
<h2><?php _e('Manage', '
|
3 |
|
4 |
<?php
|
5 |
|
6 |
$menu_items = array(
|
7 |
-
'content' => __('Content Type Configuration', '
|
8 |
-
'profiles' => __('Translation Profiles', '
|
9 |
-
'custom-fields' => __('Custom Fields', '
|
10 |
-
'string-groups' => __('String Groups', '
|
11 |
-
'strings' => __('Strings', '
|
12 |
);
|
13 |
|
14 |
?>
|
@@ -30,7 +30,7 @@
|
|
30 |
|
31 |
<?php
|
32 |
settings_errors();
|
33 |
-
$submenu = isset($_GET['sm']) ? $_GET['sm'] : current(array_keys($menu_items));
|
34 |
$dir = dirname(__FILE__) . '/manage/';
|
35 |
$filename = $dir . 'view-' . $submenu . ".php";
|
36 |
if (file_exists($filename))
|
@@ -39,4 +39,4 @@
|
|
39 |
echo "TO-DO: create <i>" . 'manage/view-' . $submenu . ".php</i>";
|
40 |
?>
|
41 |
|
42 |
-
</div>
|
1 |
<div class="wrap">
|
2 |
+
<h2><?php _e('Manage', 'lingotek-translation'); ?></h2>
|
3 |
|
4 |
<?php
|
5 |
|
6 |
$menu_items = array(
|
7 |
+
'content' => __('Content Type Configuration', 'lingotek-translation'),
|
8 |
+
'profiles' => __('Translation Profiles', 'lingotek-translation'),
|
9 |
+
'custom-fields' => __('Custom Fields', 'lingotek-translation'),
|
10 |
+
'string-groups' => __('String Groups', 'lingotek-translation'),
|
11 |
+
'strings' => __('Strings', 'lingotek-translation'),
|
12 |
);
|
13 |
|
14 |
?>
|
30 |
|
31 |
<?php
|
32 |
settings_errors();
|
33 |
+
$submenu = isset($_GET['sm']) ? sanitize_text_field($_GET['sm']) : current(array_keys($menu_items));
|
34 |
$dir = dirname(__FILE__) . '/manage/';
|
35 |
$filename = $dir . 'view-' . $submenu . ".php";
|
36 |
if (file_exists($filename))
|
39 |
echo "TO-DO: create <i>" . 'manage/view-' . $submenu . ".php</i>";
|
40 |
?>
|
41 |
|
42 |
+
</div>
|
admin/view-network.php
CHANGED
@@ -75,12 +75,12 @@
|
|
75 |
}
|
76 |
|
77 |
if (isset($_POST['utility_set_default_language'])) {
|
78 |
-
add_settings_error('network', 'utilities', __('The language utility ran successfully.', '
|
79 |
}
|
80 |
-
add_settings_error('network', 'destination', __('Your chosen settings have updated successfully for all selected sites.', '
|
81 |
}
|
82 |
else {
|
83 |
-
add_settings_error('network', 'destination', __('Please choose at least one destination site.', '
|
84 |
}
|
85 |
|
86 |
//Refreshes community resources so that the defaults are set when you visit the sites translation settings
|
@@ -92,10 +92,10 @@
|
|
92 |
}
|
93 |
$num = count($destination_site);
|
94 |
if ($num > 1) {
|
95 |
-
add_settings_error('network', 'projects', __('Your new projects were successfully created.', '
|
96 |
}
|
97 |
else {
|
98 |
-
add_settings_error('network', 'projects', __('Your new project was successfully created.', '
|
99 |
}
|
100 |
}
|
101 |
}
|
@@ -109,14 +109,14 @@
|
|
109 |
</style>
|
110 |
|
111 |
<div class="wrap">
|
112 |
-
<h2><?php _e('Lingotek Network Settings', '
|
113 |
-
<p><?php _e('Copy Lingotek settings from the source site to multiple sites', '
|
114 |
|
115 |
-
<form id="network-settings" method="post" action="admin.php?page=
|
116 |
|
117 |
<table class="form-table">
|
118 |
<tr>
|
119 |
-
<th><?php echo _e('Source Site', '
|
120 |
<td>
|
121 |
<select name="source" id="source"><?php foreach ($site_data as $site) {
|
122 |
echo "\n\t<option value='" . esc_attr($site['blog_id']) . "'>" . $site['blogname'] . '</option>';
|
@@ -125,7 +125,7 @@
|
|
125 |
</td>
|
126 |
</tr>
|
127 |
<tr>
|
128 |
-
<th><?php echo _e('Destination Site', '
|
129 |
<td>
|
130 |
<select multiple="multiple" name="destination[]" id="destination"><?php foreach ($site_data as $site) {
|
131 |
echo "\n\t<option value='" . esc_attr($site['blog_id']) . "'>" . $site['blogname'] . '</option>';
|
@@ -134,33 +134,33 @@
|
|
134 |
</td>
|
135 |
</tr>
|
136 |
<tr>
|
137 |
-
<th><?php echo _e('Settings to copy', '
|
138 |
<td>
|
139 |
-
<input checked type="checkbox" id="account" name="settings[]" value="token"><label for="account"><?php echo _e('Account', '
|
140 |
-
<input checked type="checkbox" id="community" name="settings[]" value="community"><label for="community"><?php echo _e('Community', '
|
141 |
-
<input checked type="checkbox" id="defaults" name="settings[]" value="defaults"><label for="defaults"><?php echo _e('Defaults', '
|
142 |
-
<input checked type="checkbox" id="resources" name="settings[]" value="community_resources"><label for="resources"><?php echo _e('Resources', '
|
143 |
-
<input checked type="checkbox" id="profiles" name="settings[]" value="profiles"><label for="profiles"><?php echo _e('Profiles', '
|
144 |
-
<input checked type="checkbox" id="content_types" name="settings[]" value="content_type"><label for="content_types"><?php echo _e('Content Types', '
|
145 |
-
<input checked type="checkbox" id="preferences" name="preferences" value="preferences"><label for="preferences"><?php echo _e('Preferences', '
|
146 |
</td>
|
147 |
</tr>
|
148 |
<tr>
|
149 |
-
<th><?php echo _e('New Project', '
|
150 |
<td>
|
151 |
-
<input checked type="checkbox" name="new_project" id="new_project" ><label for="new_project"><?php echo _e('Create a new project using the name of the selected site (Recommended for a newly created site)', '
|
152 |
</td>
|
153 |
</tr>
|
154 |
<tr>
|
155 |
-
<th><?php echo _e('Language', '
|
156 |
<td>
|
157 |
-
<input checked type="checkbox" name="utility_set_default_language" id="utility_set_default_language" ><label for="utility_set_default_language"><?php echo _e('Set <i>default language</i> as the language for all existing content that has not been assigned a language.', '
|
158 |
</td>
|
159 |
</tr>
|
160 |
</table>
|
161 |
|
162 |
<p>
|
163 |
-
<?php submit_button(__('Update Options', '
|
164 |
</p>
|
165 |
|
166 |
</form>
|
75 |
}
|
76 |
|
77 |
if (isset($_POST['utility_set_default_language'])) {
|
78 |
+
add_settings_error('network', 'utilities', __('The language utility ran successfully.', 'lingotek-translation'), 'updated');
|
79 |
}
|
80 |
+
add_settings_error('network', 'destination', __('Your chosen settings have updated successfully for all selected sites.', 'lingotek-translation'), 'updated');
|
81 |
}
|
82 |
else {
|
83 |
+
add_settings_error('network', 'destination', __('Please choose at least one destination site.', 'lingotek-translation'), 'error');
|
84 |
}
|
85 |
|
86 |
//Refreshes community resources so that the defaults are set when you visit the sites translation settings
|
92 |
}
|
93 |
$num = count($destination_site);
|
94 |
if ($num > 1) {
|
95 |
+
add_settings_error('network', 'projects', __('Your new projects were successfully created.', 'lingotek-translation'), 'updated');
|
96 |
}
|
97 |
else {
|
98 |
+
add_settings_error('network', 'projects', __('Your new project was successfully created.', 'lingotek-translation'), 'updated');
|
99 |
}
|
100 |
}
|
101 |
}
|
109 |
</style>
|
110 |
|
111 |
<div class="wrap">
|
112 |
+
<h2><?php _e('Lingotek Network Settings', 'lingotek-translation'); ?></h2>
|
113 |
+
<p><?php _e('Copy Lingotek settings from the source site to multiple sites', 'lingotek-translation'); ?></p>
|
114 |
|
115 |
+
<form id="network-settings" method="post" action="admin.php?page=lingotek-translation_network" class="validate" onsubmit="return confirm('Are you sure you want to submit this request? It will overwrite any current settings you have for the destination sites.');">
|
116 |
|
117 |
<table class="form-table">
|
118 |
<tr>
|
119 |
+
<th><?php echo _e('Source Site', 'lingotek-translation'); ?></th>
|
120 |
<td>
|
121 |
<select name="source" id="source"><?php foreach ($site_data as $site) {
|
122 |
echo "\n\t<option value='" . esc_attr($site['blog_id']) . "'>" . $site['blogname'] . '</option>';
|
125 |
</td>
|
126 |
</tr>
|
127 |
<tr>
|
128 |
+
<th><?php echo _e('Destination Site', 'lingotek-translation'); ?></th>
|
129 |
<td>
|
130 |
<select multiple="multiple" name="destination[]" id="destination"><?php foreach ($site_data as $site) {
|
131 |
echo "\n\t<option value='" . esc_attr($site['blog_id']) . "'>" . $site['blogname'] . '</option>';
|
134 |
</td>
|
135 |
</tr>
|
136 |
<tr>
|
137 |
+
<th><?php echo _e('Settings to copy', 'lingotek-translation'); ?></th>
|
138 |
<td>
|
139 |
+
<input checked type="checkbox" id="account" name="settings[]" value="token"><label for="account"><?php echo _e('Account', 'lingotek-translation'); ?></label>
|
140 |
+
<input checked type="checkbox" id="community" name="settings[]" value="community"><label for="community"><?php echo _e('Community', 'lingotek-translation'); ?></label>
|
141 |
+
<input checked type="checkbox" id="defaults" name="settings[]" value="defaults"><label for="defaults"><?php echo _e('Defaults', 'lingotek-translation'); ?></label>
|
142 |
+
<input checked type="checkbox" id="resources" name="settings[]" value="community_resources"><label for="resources"><?php echo _e('Resources', 'lingotek-translation'); ?></label>
|
143 |
+
<input checked type="checkbox" id="profiles" name="settings[]" value="profiles"><label for="profiles"><?php echo _e('Profiles', 'lingotek-translation'); ?></label>
|
144 |
+
<input checked type="checkbox" id="content_types" name="settings[]" value="content_type"><label for="content_types"><?php echo _e('Content Types', 'lingotek-translation'); ?></label>
|
145 |
+
<input checked type="checkbox" id="preferences" name="preferences" value="preferences"><label for="preferences"><?php echo _e('Preferences', 'lingotek-translation'); ?></label>
|
146 |
</td>
|
147 |
</tr>
|
148 |
<tr>
|
149 |
+
<th><?php echo _e('New Project', 'lingotek-translation'); ?></th>
|
150 |
<td>
|
151 |
+
<input checked type="checkbox" name="new_project" id="new_project" ><label for="new_project"><?php echo _e('Create a new project using the name of the selected site (Recommended for a newly created site)', 'lingotek-translation'); ?></label>
|
152 |
</td>
|
153 |
</tr>
|
154 |
<tr>
|
155 |
+
<th><?php echo _e('Language', 'lingotek-translation'); ?></th>
|
156 |
<td>
|
157 |
+
<input checked type="checkbox" name="utility_set_default_language" id="utility_set_default_language" ><label for="utility_set_default_language"><?php echo _e('Set <i>default language</i> as the language for all existing content that has not been assigned a language.', 'lingotek-translation'); ?></label>
|
158 |
</td>
|
159 |
</tr>
|
160 |
</table>
|
161 |
|
162 |
<p>
|
163 |
+
<?php submit_button(__('Update Options', 'lingotek-translation'), 'primary', 'submit', false); ?>
|
164 |
</p>
|
165 |
|
166 |
</form>
|
admin/view-tutorial.php
CHANGED
@@ -1,10 +1,10 @@
|
|
1 |
<?php
|
2 |
|
3 |
$menu_items = array(
|
4 |
-
'features' => __("Features", '
|
5 |
-
'content' => __('Tutorial', '
|
6 |
-
'faq' => __('FAQ', '
|
7 |
-
'credits' => __('Credits', '
|
8 |
);
|
9 |
|
10 |
?>
|
@@ -12,12 +12,12 @@
|
|
12 |
|
13 |
<div class="wrap about-wrap">
|
14 |
|
15 |
-
<h1><?php printf( __( 'Welcome to Lingotek' , '
|
16 |
|
17 |
-
<div class="about-text"><?php printf( __( 'Thank you for updating! Lingotek offers convenient cloud-based localization and translation.' , '
|
18 |
|
19 |
|
20 |
-
<div class="wp-badge" style="background: url(<?php echo LINGOTEK_URL ?>/img/lingotek-chevrons-blue.png) center 24px/85px 80px no-repeat #fff; color: #666;"><?php printf( __( 'Version %s' , '
|
21 |
|
22 |
<h2 class="nav-tab-wrapper">
|
23 |
<?php
|
@@ -37,7 +37,7 @@
|
|
37 |
|
38 |
<?php
|
39 |
settings_errors();
|
40 |
-
$submenu = isset($_GET['sm']) ? $_GET['sm'] : current(array_keys($menu_items));
|
41 |
$dir = dirname(__FILE__) . '/tutorial/';
|
42 |
$filename = $dir . $submenu . ".php";
|
43 |
if (file_exists($filename))
|
@@ -46,4 +46,4 @@
|
|
46 |
echo "TO-DO: create <i>" . 'tutorial/' . $submenu . ".php</i>";
|
47 |
?>
|
48 |
|
49 |
-
</div>
|
1 |
<?php
|
2 |
|
3 |
$menu_items = array(
|
4 |
+
'features' => __("Features", 'lingotek-translation'),
|
5 |
+
'content' => __('Tutorial', 'lingotek-translation'),
|
6 |
+
'faq' => __('FAQ', 'lingotek-translation'),
|
7 |
+
'credits' => __('Credits', 'lingotek-translation'),
|
8 |
);
|
9 |
|
10 |
?>
|
12 |
|
13 |
<div class="wrap about-wrap">
|
14 |
|
15 |
+
<h1><?php printf( __( 'Welcome to Lingotek' , 'lingotek-translation') ); ?></h1>
|
16 |
|
17 |
+
<div class="about-text"><?php printf( __( 'Thank you for updating! Lingotek offers convenient cloud-based localization and translation.' , 'lingotek-translation'), LINGOTEK_VERSION ); ?></div>
|
18 |
|
19 |
|
20 |
+
<div class="wp-badge" style="background: url(<?php echo LINGOTEK_URL ?>/img/lingotek-chevrons-blue.png) center 24px/85px 80px no-repeat #fff; color: #666;"><?php printf( __( 'Version %s' , 'lingotek-translation'), LINGOTEK_VERSION ); ?></div>
|
21 |
|
22 |
<h2 class="nav-tab-wrapper">
|
23 |
<?php
|
37 |
|
38 |
<?php
|
39 |
settings_errors();
|
40 |
+
$submenu = isset($_GET['sm']) ? sanitize_text_field($_GET['sm']) : current(array_keys($menu_items));
|
41 |
$dir = dirname(__FILE__) . '/tutorial/';
|
42 |
$filename = $dir . $submenu . ".php";
|
43 |
if (file_exists($filename))
|
46 |
echo "TO-DO: create <i>" . 'tutorial/' . $submenu . ".php</i>";
|
47 |
?>
|
48 |
|
49 |
+
</div>
|
include/api.php
CHANGED
@@ -112,11 +112,11 @@ class Lingotek_API extends Lingotek_HTTP {
|
|
112 |
}
|
113 |
}
|
114 |
else if (is_wp_error($response)) {
|
115 |
-
$arr[$wp_id]['wp_error'] = __('Make sure you have internet connectivity', '
|
116 |
}
|
117 |
else if (400 == wp_remote_retrieve_response_code($response)) {
|
118 |
$arr[$wp_id]['upload_document'] = sprintf(
|
119 |
-
__('There was an error uploading WordPress item %1$s', '
|
120 |
);
|
121 |
}
|
122 |
update_option('lingotek_log_errors', $arr);
|
@@ -152,11 +152,11 @@ class Lingotek_API extends Lingotek_HTTP {
|
|
152 |
}
|
153 |
}
|
154 |
else if (is_wp_error($response)) {
|
155 |
-
$arr[$wp_id]['wp_error'] = __('Make sure you have internet connectivity', '
|
156 |
}
|
157 |
else if (400 == wp_remote_retrieve_response_code($response) || 404 == wp_remote_retrieve_response_code($response)) {
|
158 |
$arr[$wp_id]['patch_document'] = sprintf(
|
159 |
-
__('There was an error updating WordPress item %1$s', '
|
160 |
);
|
161 |
}
|
162 |
update_option('lingotek_log_errors', $arr);
|
@@ -225,11 +225,11 @@ class Lingotek_API extends Lingotek_HTTP {
|
|
225 |
}
|
226 |
}
|
227 |
else if (is_wp_error($response)) {
|
228 |
-
$arr[$wp_id]['wp_error'] = __('Make sure you have internet connectivity', '
|
229 |
}
|
230 |
else if (400 == wp_remote_retrieve_response_code($response)) {
|
231 |
$arr[$wp_id]['document_exists'] = sprintf(
|
232 |
-
__('There was an error updating the translations status for WordPress item %1$s', '
|
233 |
);
|
234 |
}
|
235 |
update_option('lingotek_log_errors', $arr);
|
@@ -264,11 +264,11 @@ class Lingotek_API extends Lingotek_HTTP {
|
|
264 |
}
|
265 |
}
|
266 |
else if (is_wp_error($response)) {
|
267 |
-
$arr[$wp_id]['wp_error'] = __('Make sure you have internet connectivity', '
|
268 |
}
|
269 |
else if (400 == wp_remote_retrieve_response_code($response)) {
|
270 |
$arr[$wp_id]['get_translations_status'] = sprintf(
|
271 |
-
__('There was an error updating the translations status for WordPress item %1$s', '
|
272 |
);
|
273 |
}
|
274 |
update_option('lingotek_log_errors', $arr);
|
@@ -305,11 +305,11 @@ class Lingotek_API extends Lingotek_HTTP {
|
|
305 |
}
|
306 |
}
|
307 |
else if (is_wp_error($response)) {
|
308 |
-
$arr[$wp_id]['wp_error'] = __('Make sure you have internet connectivity', '
|
309 |
}
|
310 |
else if (400 == wp_remote_retrieve_response_code($response) || 404 == wp_remote_retrieve_response_code($response)) {
|
311 |
$arr[$wp_id]['request_translation'][$locale] = sprintf(
|
312 |
-
__('There was an error requesting translation %1$s for WordPress item %2$s', '
|
313 |
);
|
314 |
}
|
315 |
update_option('lingotek_log_errors', $arr);
|
@@ -343,7 +343,7 @@ class Lingotek_API extends Lingotek_HTTP {
|
|
343 |
}
|
344 |
}
|
345 |
else if (is_wp_error($response)) {
|
346 |
-
$arr[$wp_id]['wp_error'] = __('Make sure you have internet connectivity', '
|
347 |
}
|
348 |
else if (400 == wp_remote_retrieve_response_code($response) || 404 == wp_remote_retrieve_response_code($response)) {
|
349 |
$arr[$wp_id]['get_translation'][$locale] = sprintf(
|
112 |
}
|
113 |
}
|
114 |
else if (is_wp_error($response)) {
|
115 |
+
$arr[$wp_id]['wp_error'] = __('Make sure you have internet connectivity', 'lingotek-translation');
|
116 |
}
|
117 |
else if (400 == wp_remote_retrieve_response_code($response)) {
|
118 |
$arr[$wp_id]['upload_document'] = sprintf(
|
119 |
+
__('There was an error uploading WordPress item %1$s', 'lingotek-translation'), $wp_id
|
120 |
);
|
121 |
}
|
122 |
update_option('lingotek_log_errors', $arr);
|
152 |
}
|
153 |
}
|
154 |
else if (is_wp_error($response)) {
|
155 |
+
$arr[$wp_id]['wp_error'] = __('Make sure you have internet connectivity', 'lingotek-translation');
|
156 |
}
|
157 |
else if (400 == wp_remote_retrieve_response_code($response) || 404 == wp_remote_retrieve_response_code($response)) {
|
158 |
$arr[$wp_id]['patch_document'] = sprintf(
|
159 |
+
__('There was an error updating WordPress item %1$s', 'lingotek-translation') ,$wp_id
|
160 |
);
|
161 |
}
|
162 |
update_option('lingotek_log_errors', $arr);
|
225 |
}
|
226 |
}
|
227 |
else if (is_wp_error($response)) {
|
228 |
+
$arr[$wp_id]['wp_error'] = __('Make sure you have internet connectivity', 'lingotek-translation');
|
229 |
}
|
230 |
else if (400 == wp_remote_retrieve_response_code($response)) {
|
231 |
$arr[$wp_id]['document_exists'] = sprintf(
|
232 |
+
__('There was an error updating the translations status for WordPress item %1$s', 'lingotek-translation'), $wp_id
|
233 |
);
|
234 |
}
|
235 |
update_option('lingotek_log_errors', $arr);
|
264 |
}
|
265 |
}
|
266 |
else if (is_wp_error($response)) {
|
267 |
+
$arr[$wp_id]['wp_error'] = __('Make sure you have internet connectivity', 'lingotek-translation');
|
268 |
}
|
269 |
else if (400 == wp_remote_retrieve_response_code($response)) {
|
270 |
$arr[$wp_id]['get_translations_status'] = sprintf(
|
271 |
+
__('There was an error updating the translations status for WordPress item %1$s', 'lingotek-translation'), $wp_id
|
272 |
);
|
273 |
}
|
274 |
update_option('lingotek_log_errors', $arr);
|
305 |
}
|
306 |
}
|
307 |
else if (is_wp_error($response)) {
|
308 |
+
$arr[$wp_id]['wp_error'] = __('Make sure you have internet connectivity', 'lingotek-translation');
|
309 |
}
|
310 |
else if (400 == wp_remote_retrieve_response_code($response) || 404 == wp_remote_retrieve_response_code($response)) {
|
311 |
$arr[$wp_id]['request_translation'][$locale] = sprintf(
|
312 |
+
__('There was an error requesting translation %1$s for WordPress item %2$s', 'lingotek-translation'), $locale, $wp_id
|
313 |
);
|
314 |
}
|
315 |
update_option('lingotek_log_errors', $arr);
|
343 |
}
|
344 |
}
|
345 |
else if (is_wp_error($response)) {
|
346 |
+
$arr[$wp_id]['wp_error'] = __('Make sure you have internet connectivity', 'lingotek-translation');
|
347 |
}
|
348 |
else if (400 == wp_remote_retrieve_response_code($response) || 404 == wp_remote_retrieve_response_code($response)) {
|
349 |
$arr[$wp_id]['get_translation'][$locale] = sprintf(
|
include/dashboard.php
CHANGED
@@ -32,12 +32,12 @@ class Lingotek_Dashboard {
|
|
32 |
$name = $_REQUEST['native'];
|
33 |
$slug = substr($_REQUEST['code'], 0, strpos($_REQUEST['code'], '_')); // 3rd parameter of strstr needs PHP 5.3
|
34 |
$locale = Lingotek::map_to_wp_locale($_REQUEST['code']);
|
35 |
-
|
36 |
// avoid conflicts between language slugs
|
37 |
$existing_slugs = $polylang->model->get_languages_list(array('fields' => 'slug'));
|
38 |
if (!empty($existing_slugs) && in_array($slug, $existing_slugs))
|
39 |
$slug = strtolower(str_replace('_', '-', $locale));
|
40 |
-
|
41 |
$rtl = $_REQUEST['direction'] == 'RTL';
|
42 |
$term_group = 0;
|
43 |
|
@@ -76,7 +76,7 @@ class Lingotek_Dashboard {
|
|
76 |
'request' => sprintf('DELETE: remove language from CMS and project (%s)', $code),
|
77 |
'code' => $code,
|
78 |
'success' => false,
|
79 |
-
'message' => __('You must keep at least one language.', '
|
80 |
);
|
81 |
status_header(403);
|
82 |
}
|
@@ -109,7 +109,7 @@ class Lingotek_Dashboard {
|
|
109 |
'request' => sprintf('DELETE: remove language from CMS and project (%s)', $code),
|
110 |
'code' => $code,
|
111 |
'success' => false,
|
112 |
-
'message' => __('The language can only be removed when no existing content is using it. If you would like to remove this language from the site, then first remove any content assigned to this language.', '
|
113 |
);
|
114 |
status_header(403);
|
115 |
}
|
@@ -130,14 +130,14 @@ class Lingotek_Dashboard {
|
|
130 |
*/
|
131 |
function get_language_details($locale_requested = NULL) {
|
132 |
global $polylang;
|
133 |
-
|
134 |
$response = array();
|
135 |
$available_languages = $polylang->model->get_languages_list();
|
136 |
$source_total = 0;
|
137 |
$target_total = 0;
|
138 |
$source_totals = array();
|
139 |
$target_totals = array();
|
140 |
-
|
141 |
// If we get a parameter, only return that language. Otherwise return all languages.
|
142 |
foreach ($available_languages as $lang_details) {
|
143 |
$wordpress_lang_code = $lang_details->slug;
|
32 |
$name = $_REQUEST['native'];
|
33 |
$slug = substr($_REQUEST['code'], 0, strpos($_REQUEST['code'], '_')); // 3rd parameter of strstr needs PHP 5.3
|
34 |
$locale = Lingotek::map_to_wp_locale($_REQUEST['code']);
|
35 |
+
|
36 |
// avoid conflicts between language slugs
|
37 |
$existing_slugs = $polylang->model->get_languages_list(array('fields' => 'slug'));
|
38 |
if (!empty($existing_slugs) && in_array($slug, $existing_slugs))
|
39 |
$slug = strtolower(str_replace('_', '-', $locale));
|
40 |
+
|
41 |
$rtl = $_REQUEST['direction'] == 'RTL';
|
42 |
$term_group = 0;
|
43 |
|
76 |
'request' => sprintf('DELETE: remove language from CMS and project (%s)', $code),
|
77 |
'code' => $code,
|
78 |
'success' => false,
|
79 |
+
'message' => __('You must keep at least one language.', 'lingotek-translation')
|
80 |
);
|
81 |
status_header(403);
|
82 |
}
|
109 |
'request' => sprintf('DELETE: remove language from CMS and project (%s)', $code),
|
110 |
'code' => $code,
|
111 |
'success' => false,
|
112 |
+
'message' => __('The language can only be removed when no existing content is using it. If you would like to remove this language from the site, then first remove any content assigned to this language.', 'lingotek-translation')
|
113 |
);
|
114 |
status_header(403);
|
115 |
}
|
130 |
*/
|
131 |
function get_language_details($locale_requested = NULL) {
|
132 |
global $polylang;
|
133 |
+
|
134 |
$response = array();
|
135 |
$available_languages = $polylang->model->get_languages_list();
|
136 |
$source_total = 0;
|
137 |
$target_total = 0;
|
138 |
$source_totals = array();
|
139 |
$target_totals = array();
|
140 |
+
|
141 |
// If we get a parameter, only return that language. Otherwise return all languages.
|
142 |
foreach ($available_languages as $lang_details) {
|
143 |
$wordpress_lang_code = $lang_details->slug;
|
include/group-post.php
CHANGED
@@ -43,16 +43,16 @@ class Lingotek_Group_Post extends Lingotek_Group {
|
|
43 |
static public function get_content_type_fields($post_type, $post_ID = NULL) {
|
44 |
$arr = 'attachment' == $post_type ?
|
45 |
array(
|
46 |
-
'post_title' => __('Title', '
|
47 |
-
'post_excerpt' => __('Caption', '
|
48 |
-
'metas' => array('_wp_attachment_image_alt' => __('Alternative Text', '
|
49 |
-
'post_content' => __('Description', '
|
50 |
) :
|
51 |
array(
|
52 |
-
'post_title' => __('Title', '
|
53 |
-
'post_name' => __('Slug', '
|
54 |
-
'post_content' => __('Content', '
|
55 |
-
'post_excerpt' => __('Excerpt', '
|
56 |
);
|
57 |
|
58 |
// if the user hasn't visited the custom fields tab, and hasn't saved actions for custom
|
@@ -272,7 +272,7 @@ class Lingotek_Group_Post extends Lingotek_Group {
|
|
272 |
*/
|
273 |
public function request_translations() {
|
274 |
if (isset($this->source)) {
|
275 |
-
$language =
|
276 |
$this->_request_translations($language);
|
277 |
}
|
278 |
}
|
@@ -306,7 +306,7 @@ class Lingotek_Group_Post extends Lingotek_Group {
|
|
306 |
$tr_post['post_status'] = ($prefs['download_post_status'] === self::SAME_AS_SOURCE)? $post->post_status : $prefs['download_post_status']; // status
|
307 |
|
308 |
// update existing translation
|
309 |
-
if ($tr_id =
|
310 |
$tr_post['ID'] = $tr_id;
|
311 |
|
312 |
// copy or ignore metas
|
@@ -341,7 +341,7 @@ class Lingotek_Group_Post extends Lingotek_Group {
|
|
341 |
|
342 |
if ($tr_id) {
|
343 |
$tr_lang = $this->pllm->get_language($locale);
|
344 |
-
|
345 |
$this->safe_translation_status_update($locale, 'current', array($tr_lang->slug => $tr_id));
|
346 |
wp_set_object_terms($tr_id, $this->term_id, 'post_translations');
|
347 |
|
43 |
static public function get_content_type_fields($post_type, $post_ID = NULL) {
|
44 |
$arr = 'attachment' == $post_type ?
|
45 |
array(
|
46 |
+
'post_title' => __('Title', 'lingotek-translation'),
|
47 |
+
'post_excerpt' => __('Caption', 'lingotek-translation'),
|
48 |
+
'metas' => array('_wp_attachment_image_alt' => __('Alternative Text', 'lingotek-translation')),
|
49 |
+
'post_content' => __('Description', 'lingotek-translation'),
|
50 |
) :
|
51 |
array(
|
52 |
+
'post_title' => __('Title', 'lingotek-translation'),
|
53 |
+
'post_name' => __('Slug', 'lingotek-translation'),
|
54 |
+
'post_content' => __('Content', 'lingotek-translation'),
|
55 |
+
'post_excerpt' => __('Excerpt', 'lingotek-translation')
|
56 |
);
|
57 |
|
58 |
// if the user hasn't visited the custom fields tab, and hasn't saved actions for custom
|
272 |
*/
|
273 |
public function request_translations() {
|
274 |
if (isset($this->source)) {
|
275 |
+
$language = PLL()->model->post->get_language((int) $this->source);
|
276 |
$this->_request_translations($language);
|
277 |
}
|
278 |
}
|
306 |
$tr_post['post_status'] = ($prefs['download_post_status'] === self::SAME_AS_SOURCE)? $post->post_status : $prefs['download_post_status']; // status
|
307 |
|
308 |
// update existing translation
|
309 |
+
if ($tr_id = PLL()->model->post->get($this->source, $locale)) {
|
310 |
$tr_post['ID'] = $tr_id;
|
311 |
|
312 |
// copy or ignore metas
|
341 |
|
342 |
if ($tr_id) {
|
343 |
$tr_lang = $this->pllm->get_language($locale);
|
344 |
+
PLL()->model->post->set_language($tr_id, $tr_lang);
|
345 |
$this->safe_translation_status_update($locale, 'current', array($tr_lang->slug => $tr_id));
|
346 |
wp_set_object_terms($tr_id, $this->term_id, 'post_translations');
|
347 |
|
include/group-term.php
CHANGED
@@ -41,10 +41,10 @@ class Lingotek_Group_Term extends Lingotek_Group {
|
|
41 |
*/
|
42 |
static public function get_content_type_fields($taxonomy) {
|
43 |
$arr = array(
|
44 |
-
'name' => __('Name', '
|
45 |
'args' => array(
|
46 |
-
'slug' => __('Slug', '
|
47 |
-
'description' => __('Description', '
|
48 |
)
|
49 |
);
|
50 |
|
@@ -86,7 +86,7 @@ class Lingotek_Group_Term extends Lingotek_Group {
|
|
86 |
*/
|
87 |
public function request_translations() {
|
88 |
if (isset($this->source)) {
|
89 |
-
$language =
|
90 |
$this->_request_translations($language);
|
91 |
}
|
92 |
}
|
@@ -111,7 +111,7 @@ class Lingotek_Group_Term extends Lingotek_Group {
|
|
111 |
$args = $translation['args'];
|
112 |
|
113 |
// update existing translation
|
114 |
-
if ($tr_id =
|
115 |
$args['name'] = $translation['name'];
|
116 |
wp_update_term($tr_id, $this->type, $args);
|
117 |
|
@@ -134,7 +134,7 @@ class Lingotek_Group_Term extends Lingotek_Group {
|
|
134 |
$tr = wp_insert_term($translation['name'], $this->type, $args);
|
135 |
|
136 |
if (!is_wp_error($tr)) {
|
137 |
-
|
138 |
$this->safe_translation_status_update($locale, 'current', array($tr_lang->slug => $tr['term_id']));
|
139 |
wp_set_object_terms($tr['term_id'], $this->term_id, 'term_translations');
|
140 |
}
|
@@ -162,6 +162,6 @@ class Lingotek_Group_Term extends Lingotek_Group {
|
|
162 |
* @return object
|
163 |
*/
|
164 |
public function get_source_language() {
|
165 |
-
return
|
166 |
}
|
167 |
}
|
41 |
*/
|
42 |
static public function get_content_type_fields($taxonomy) {
|
43 |
$arr = array(
|
44 |
+
'name' => __('Name', 'lingotek-translation'),
|
45 |
'args' => array(
|
46 |
+
'slug' => __('Slug', 'lingotek-translation'),
|
47 |
+
'description' => __('Description', 'lingotek-translation')
|
48 |
)
|
49 |
);
|
50 |
|
86 |
*/
|
87 |
public function request_translations() {
|
88 |
if (isset($this->source)) {
|
89 |
+
$language = PLL()->model->term->get_language((int) $this->source);
|
90 |
$this->_request_translations($language);
|
91 |
}
|
92 |
}
|
111 |
$args = $translation['args'];
|
112 |
|
113 |
// update existing translation
|
114 |
+
if ($tr_id = PLL()->model->term->get($this->source, $locale)) {
|
115 |
$args['name'] = $translation['name'];
|
116 |
wp_update_term($tr_id, $this->type, $args);
|
117 |
|
134 |
$tr = wp_insert_term($translation['name'], $this->type, $args);
|
135 |
|
136 |
if (!is_wp_error($tr)) {
|
137 |
+
PLL()->model->term->set_language($tr['term_id'], $tr_lang);
|
138 |
$this->safe_translation_status_update($locale, 'current', array($tr_lang->slug => $tr['term_id']));
|
139 |
wp_set_object_terms($tr['term_id'], $this->term_id, 'term_translations');
|
140 |
}
|
162 |
* @return object
|
163 |
*/
|
164 |
public function get_source_language() {
|
165 |
+
return PLL()->model->term->get_language($this->source);
|
166 |
}
|
167 |
}
|
include/model.php
CHANGED
@@ -75,8 +75,9 @@ class Lingotek_Model {
|
|
75 |
public function get_group($type, $id) {
|
76 |
switch ($type) {
|
77 |
case 'post':
|
|
|
78 |
case 'term':
|
79 |
-
return ($term =
|
80 |
case 'string':
|
81 |
if (is_numeric($id)) {
|
82 |
$strings = self::get_strings();
|
@@ -263,7 +264,7 @@ class Lingotek_Model {
|
|
263 |
*/
|
264 |
public function upload_post($post_id) {
|
265 |
$post = get_post($post_id);
|
266 |
-
$language =
|
267 |
if (empty($post) || empty($language))
|
268 |
return;
|
269 |
|
@@ -323,7 +324,7 @@ class Lingotek_Model {
|
|
323 |
*/
|
324 |
public function upload_term($term_id, $taxonomy) {
|
325 |
$term = get_term($term_id, $taxonomy);
|
326 |
-
$language =
|
327 |
if (empty($term) || empty($language))
|
328 |
return;
|
329 |
|
@@ -456,9 +457,12 @@ class Lingotek_Model {
|
|
456 |
return false;
|
457 |
|
458 |
case 'post':
|
|
|
|
|
|
|
459 |
case 'term':
|
460 |
// first check that a language is associated to the object
|
461 |
-
$language =
|
462 |
|
463 |
// FIXME how to get profile to check if disabled?
|
464 |
|
@@ -483,8 +487,8 @@ class Lingotek_Model {
|
|
483 |
$client->delete_document($document->document_id, $object_id);
|
484 |
}
|
485 |
else {
|
486 |
-
|
487 |
-
$lang =
|
488 |
$client->delete_translation($document->document_id, $lang->lingotek_locale, $object_id);
|
489 |
}
|
490 |
}
|
@@ -505,9 +509,9 @@ class Lingotek_Model {
|
|
505 |
$client->delete_document($document->document_id, $object_id);
|
506 |
}
|
507 |
else {
|
508 |
-
$lang =
|
509 |
-
|
510 |
-
|
511 |
$client->delete_translation($document->document_id, $lang->lingotek_locale, $object_id);
|
512 |
}
|
513 |
}
|
75 |
public function get_group($type, $id) {
|
76 |
switch ($type) {
|
77 |
case 'post':
|
78 |
+
return ($post = PLL()->model->post->get_object_term((int) $id, $type . '_translations')) && !empty($post) ? $this->convert_term($post) : false;
|
79 |
case 'term':
|
80 |
+
return ($term = PLL()->model->term->get_object_term((int) $id, $type . '_translations')) && !empty($term) ? $this->convert_term($term) : false;
|
81 |
case 'string':
|
82 |
if (is_numeric($id)) {
|
83 |
$strings = self::get_strings();
|
264 |
*/
|
265 |
public function upload_post($post_id) {
|
266 |
$post = get_post($post_id);
|
267 |
+
$language = PLL()->model->post->get_language($post_id);
|
268 |
if (empty($post) || empty($language))
|
269 |
return;
|
270 |
|
324 |
*/
|
325 |
public function upload_term($term_id, $taxonomy) {
|
326 |
$term = get_term($term_id, $taxonomy);
|
327 |
+
$language = PLL()->model->term->get_language($term_id);
|
328 |
if (empty($term) || empty($language))
|
329 |
return;
|
330 |
|
457 |
return false;
|
458 |
|
459 |
case 'post':
|
460 |
+
$language = PLL()->model->post->get_language($object_id);
|
461 |
+
return !empty($language) && (empty($document) ||
|
462 |
+
(isset($document) && 'edited' == $document->status && $document->source == $object_id));
|
463 |
case 'term':
|
464 |
// first check that a language is associated to the object
|
465 |
+
$language = PLL()->model->term->get_language($object_id);
|
466 |
|
467 |
// FIXME how to get profile to check if disabled?
|
468 |
|
487 |
$client->delete_document($document->document_id, $object_id);
|
488 |
}
|
489 |
else {
|
490 |
+
PLL()->model->post->delete_translation($object_id);
|
491 |
+
$lang = PLL()->model->post->get_language($object_id);
|
492 |
$client->delete_translation($document->document_id, $lang->lingotek_locale, $object_id);
|
493 |
}
|
494 |
}
|
509 |
$client->delete_document($document->document_id, $object_id);
|
510 |
}
|
511 |
else {
|
512 |
+
$lang = PLL()->model->term->get_language($object_id);
|
513 |
+
PLL()->model->term->delete_language($object_id);
|
514 |
+
PLL()->model->term->delete_translation($object_id);
|
515 |
$client->delete_translation($document->document_id, $lang->lingotek_locale, $object_id);
|
516 |
}
|
517 |
}
|
js/updater.js
CHANGED
@@ -110,6 +110,7 @@ jQuery(document).ready(function($) {
|
|
110 |
}
|
111 |
else if(source !== false && data[key]['source_status'] === 'current'){
|
112 |
$(td).find('.pll_icon_add').remove();
|
|
|
113 |
$(td).find('.pll_icon_edit').remove();
|
114 |
$(td).find('.lingotek-color').remove();
|
115 |
updateIndicator(td, data, key, locale, 'request', 'Request a translation', 'plus');
|
110 |
}
|
111 |
else if(source !== false && data[key]['source_status'] === 'current'){
|
112 |
$(td).find('.pll_icon_add').remove();
|
113 |
+
$(td).find('.pll_icon_tick').remove();
|
114 |
$(td).find('.pll_icon_edit').remove();
|
115 |
$(td).find('.lingotek-color').remove();
|
116 |
updateIndicator(td, data, key, locale, 'request', 'Request a translation', 'plus');
|
languages/wp-lingotek-fr_FR.po
CHANGED
@@ -3,7 +3,7 @@
|
|
3 |
msgid ""
|
4 |
msgstr ""
|
5 |
"Project-Id-Version: Lingotek Translation 1.0.0\n"
|
6 |
-
"Report-Msgid-Bugs-To: http://wordpress.org/support/plugin/
|
7 |
"POT-Creation-Date: 2015-06-29 15:40:38+00:00\n"
|
8 |
"MIME-Version: 1.0\n"
|
9 |
"Content-Type: text/plain; charset=UTF-8\n"
|
3 |
msgid ""
|
4 |
msgstr ""
|
5 |
"Project-Id-Version: Lingotek Translation 1.0.0\n"
|
6 |
+
"Report-Msgid-Bugs-To: http://wordpress.org/support/plugin/lingotek-translation\n"
|
7 |
"POT-Creation-Date: 2015-06-29 15:40:38+00:00\n"
|
8 |
"MIME-Version: 1.0\n"
|
9 |
"Content-Type: text/plain; charset=UTF-8\n"
|
lingotek.php
CHANGED
@@ -2,23 +2,23 @@
|
|
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.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.
|
9 |
-
Text Domain:
|
10 |
Domain Path: /languages
|
11 |
-
GitHub Plugin URI: https://github.com/lingotek/
|
12 |
*/
|
13 |
|
14 |
// don't access directly
|
15 |
if (!function_exists('add_action'))
|
16 |
exit();
|
17 |
|
18 |
-
define('LINGOTEK_VERSION', '1.1.
|
19 |
-
define('LINGOTEK_MIN_PLL_VERSION', '1.
|
20 |
define('LINGOTEK_BASENAME', plugin_basename(__FILE__)); // plugin name as known by WP
|
21 |
-
define('LINGOTEK_PLUGIN_SLUG', '
|
22 |
define('LINGOTEK_DIR', dirname(__FILE__)); // our directory
|
23 |
define('LINGOTEK_INC', LINGOTEK_DIR . '/include');
|
24 |
define('LINGOTEK_ADMIN_INC', LINGOTEK_DIR . '/admin');
|
@@ -200,19 +200,19 @@ class Lingotek {
|
|
200 |
$profiles = array(
|
201 |
'automatic' => array(
|
202 |
'profile' => 'automatic',
|
203 |
-
'name' => __('Automatic', '
|
204 |
'upload' => 'automatic',
|
205 |
'download' => 'automatic'
|
206 |
),
|
207 |
'manual' => array(
|
208 |
'profile' => 'manual',
|
209 |
-
'name' => __('Manual', '
|
210 |
'upload' => 'manual',
|
211 |
'download' => 'manual'
|
212 |
),
|
213 |
'disabled' => array(
|
214 |
'profile' => 'disabled',
|
215 |
-
'name' => __('Disabled', '
|
216 |
),
|
217 |
);
|
218 |
update_option('lingotek_profiles', $profiles);
|
@@ -234,19 +234,19 @@ class Lingotek {
|
|
234 |
$default_profiles = array(
|
235 |
'automatic' => array(
|
236 |
'profile' => 'automatic',
|
237 |
-
'name' => __('Automatic', '
|
238 |
'upload' => 'automatic',
|
239 |
'download' => 'automatic'
|
240 |
),
|
241 |
'manual' => array(
|
242 |
'profile' => 'manual',
|
243 |
-
'name' => __('Manual', '
|
244 |
'upload' => 'manual',
|
245 |
'download' => 'manual'
|
246 |
),
|
247 |
'disabled' => array(
|
248 |
'profile' => 'disabled',
|
249 |
-
'name' => __('Disabled', '
|
250 |
),
|
251 |
);
|
252 |
|
@@ -262,7 +262,7 @@ class Lingotek {
|
|
262 |
foreach($profiles as $k=>$v){
|
263 |
if(in_array($k,array('automatic','manual','disabled'))){
|
264 |
$profile_name = $profiles[$k]['name'];
|
265 |
-
$profiles[$k]['name'] = __($profile_name,'
|
266 |
}
|
267 |
}
|
268 |
|
@@ -331,7 +331,7 @@ class Lingotek {
|
|
331 |
* @return string modified class 'PLL_Model' | 'PLL_Admin_Model'
|
332 |
*/
|
333 |
public function pll_model($class) {
|
334 |
-
if (PLL_ADMIN && isset($_GET['page']) && in_array($_GET['page'], array('
|
335 |
return 'PLL_Admin_Model';
|
336 |
return $class;
|
337 |
}
|
@@ -388,7 +388,7 @@ class Lingotek {
|
|
388 |
*/
|
389 |
public function admin_init() {
|
390 |
// plugin i18n, only needed for backend
|
391 |
-
load_plugin_textdomain('
|
392 |
|
393 |
if (!defined('POLYLANG_VERSION'))
|
394 |
add_action('all_admin_notices', array(&$this, 'pll_inactive_notice'));
|
@@ -422,7 +422,7 @@ class Lingotek {
|
|
422 |
);
|
423 |
printf(
|
424 |
'<div class="error" style="height:55px"><p style="font-size:1.5em">%s<a href="%s">%s</a></p></div>',
|
425 |
-
__('Lingotek Translation requires Polylang to work. ', '
|
426 |
);
|
427 |
}
|
428 |
|
@@ -435,7 +435,7 @@ class Lingotek {
|
|
435 |
printf(
|
436 |
'<div class="error"><p>%s</p></div>',
|
437 |
sprintf(
|
438 |
-
__('Lingotek Translation requires Polylang %s to work. Please upgrade Polylang.', '
|
439 |
'<strong>' . LINGOTEK_MIN_PLL_VERSION . '</strong>'
|
440 |
)
|
441 |
);
|
@@ -556,27 +556,27 @@ class Lingotek {
|
|
556 |
* @since 1.0.1
|
557 |
*/
|
558 |
public function lingotek_activation_pointer() {
|
559 |
-
$content = __('You’ve just installed Lingotek Translation! Click below to activate your account and automatically translate your website for free!', '
|
560 |
|
561 |
$buttons = array(
|
562 |
array(
|
563 |
'label' => __('Close')
|
564 |
),
|
565 |
array(
|
566 |
-
'label' => __('Activate Account', '
|
567 |
'link' => admin_url('admin.php?page=' . $this->plugin_slug . '_settings&connect=new'),
|
568 |
)
|
569 |
);
|
570 |
|
571 |
$args = array(
|
572 |
-
'pointer' => '
|
573 |
-
'id' => '
|
574 |
'position' => array(
|
575 |
'edge' => 'bottom',
|
576 |
'align' => 'left',
|
577 |
),
|
578 |
'width' => 380,
|
579 |
-
'title' => __('Congratulations!', '
|
580 |
'content' => $content,
|
581 |
'buttons' => $buttons
|
582 |
);
|
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.1.9
|
6 |
Author: Lingotek and Frédéric Demarle
|
7 |
Author uri: http://lingotek.com
|
8 |
Description: Lingotek offers convenient cloud-based localization and translation.
|
9 |
+
Text Domain: lingotek-translation
|
10 |
Domain Path: /languages
|
11 |
+
GitHub Plugin URI: https://github.com/lingotek/lingotek-translation
|
12 |
*/
|
13 |
|
14 |
// don't access directly
|
15 |
if (!function_exists('add_action'))
|
16 |
exit();
|
17 |
|
18 |
+
define('LINGOTEK_VERSION', '1.1.9'); // plugin version (should match above meta)
|
19 |
+
define('LINGOTEK_MIN_PLL_VERSION', '1.8');
|
20 |
define('LINGOTEK_BASENAME', plugin_basename(__FILE__)); // plugin name as known by WP
|
21 |
+
define('LINGOTEK_PLUGIN_SLUG', 'lingotek-translation');// plugin slug (should match above meta: Text Domain)
|
22 |
define('LINGOTEK_DIR', dirname(__FILE__)); // our directory
|
23 |
define('LINGOTEK_INC', LINGOTEK_DIR . '/include');
|
24 |
define('LINGOTEK_ADMIN_INC', LINGOTEK_DIR . '/admin');
|
200 |
$profiles = array(
|
201 |
'automatic' => array(
|
202 |
'profile' => 'automatic',
|
203 |
+
'name' => __('Automatic', 'lingotek-translation'),
|
204 |
'upload' => 'automatic',
|
205 |
'download' => 'automatic'
|
206 |
),
|
207 |
'manual' => array(
|
208 |
'profile' => 'manual',
|
209 |
+
'name' => __('Manual', 'lingotek-translation'),
|
210 |
'upload' => 'manual',
|
211 |
'download' => 'manual'
|
212 |
),
|
213 |
'disabled' => array(
|
214 |
'profile' => 'disabled',
|
215 |
+
'name' => __('Disabled', 'lingotek-translation'),
|
216 |
),
|
217 |
);
|
218 |
update_option('lingotek_profiles', $profiles);
|
234 |
$default_profiles = array(
|
235 |
'automatic' => array(
|
236 |
'profile' => 'automatic',
|
237 |
+
'name' => __('Automatic', 'lingotek-translation'),
|
238 |
'upload' => 'automatic',
|
239 |
'download' => 'automatic'
|
240 |
),
|
241 |
'manual' => array(
|
242 |
'profile' => 'manual',
|
243 |
+
'name' => __('Manual', 'lingotek-translation'),
|
244 |
'upload' => 'manual',
|
245 |
'download' => 'manual'
|
246 |
),
|
247 |
'disabled' => array(
|
248 |
'profile' => 'disabled',
|
249 |
+
'name' => __('Disabled', 'lingotek-translation'),
|
250 |
),
|
251 |
);
|
252 |
|
262 |
foreach($profiles as $k=>$v){
|
263 |
if(in_array($k,array('automatic','manual','disabled'))){
|
264 |
$profile_name = $profiles[$k]['name'];
|
265 |
+
$profiles[$k]['name'] = __($profile_name,'lingotek-translation');// localize canned profile names
|
266 |
}
|
267 |
}
|
268 |
|
331 |
* @return string modified class 'PLL_Model' | 'PLL_Admin_Model'
|
332 |
*/
|
333 |
public function pll_model($class) {
|
334 |
+
if (PLL_ADMIN && isset($_GET['page']) && in_array($_GET['page'], array('lingotek-translation', 'lingotek-translation_manage', 'lingotek-translation_settings', 'lingotek-translation_network')))
|
335 |
return 'PLL_Admin_Model';
|
336 |
return $class;
|
337 |
}
|
388 |
*/
|
389 |
public function admin_init() {
|
390 |
// plugin i18n, only needed for backend
|
391 |
+
load_plugin_textdomain('lingotek-translation', false, basename(LINGOTEK_DIR).'/languages');
|
392 |
|
393 |
if (!defined('POLYLANG_VERSION'))
|
394 |
add_action('all_admin_notices', array(&$this, 'pll_inactive_notice'));
|
422 |
);
|
423 |
printf(
|
424 |
'<div class="error" style="height:55px"><p style="font-size:1.5em">%s<a href="%s">%s</a></p></div>',
|
425 |
+
__('Lingotek Translation requires Polylang to work. ', 'lingotek-translation'), $url, __('Install Polylang', 'lingotek-translation')
|
426 |
);
|
427 |
}
|
428 |
|
435 |
printf(
|
436 |
'<div class="error"><p>%s</p></div>',
|
437 |
sprintf(
|
438 |
+
__('Lingotek Translation requires Polylang %s to work. Please upgrade Polylang.', 'lingotek-translation'),
|
439 |
'<strong>' . LINGOTEK_MIN_PLL_VERSION . '</strong>'
|
440 |
)
|
441 |
);
|
556 |
* @since 1.0.1
|
557 |
*/
|
558 |
public function lingotek_activation_pointer() {
|
559 |
+
$content = __('You’ve just installed Lingotek Translation! Click below to activate your account and automatically translate your website for free!', 'lingotek-translation');
|
560 |
|
561 |
$buttons = array(
|
562 |
array(
|
563 |
'label' => __('Close')
|
564 |
),
|
565 |
array(
|
566 |
+
'label' => __('Activate Account', 'lingotek-translation'),
|
567 |
'link' => admin_url('admin.php?page=' . $this->plugin_slug . '_settings&connect=new'),
|
568 |
)
|
569 |
);
|
570 |
|
571 |
$args = array(
|
572 |
+
'pointer' => 'lingotek-translation',
|
573 |
+
'id' => 'toplevel_page_lingotek-translation',
|
574 |
'position' => array(
|
575 |
'edge' => 'bottom',
|
576 |
'align' => 'left',
|
577 |
),
|
578 |
'width' => 380,
|
579 |
+
'title' => __('Congratulations!', 'lingotek-translation'),
|
580 |
'content' => $content,
|
581 |
'buttons' => $buttons
|
582 |
);
|
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.4
|
7 |
-
Stable tag: 1.1.
|
8 |
License: GPLv2 or later
|
9 |
License URI: http://www.gnu.org/licenses/gpl-2.0.html
|
10 |
|
@@ -63,12 +63,12 @@ Don't hesitate to [give your feedback](https://wordpress.org/support/view/plugin
|
|
63 |
== Installation ==
|
64 |
|
65 |
1. Make sure you have [Polylang](https://wordpress.org/plugins/polylang/) installed as it provides the framework for the Lingotek plugin.
|
66 |
-
1. Upload the `
|
67 |
1. Activate the Lingotek plugin through the 'Plugins' menu in Wordpress.
|
68 |
1. Navigate to the `Translation` menu that appears in your admin menu.
|
69 |
1. From here you can create a new Lingotek account if you do not have one, or you can connect to an existing Lingotek account.
|
70 |
1. After creating a new account or connecting with your existing account you will be redirected to the Lingotek Translation tutorial and admin pages.
|
71 |
-
1. For more information and help visit [Getting Started](https://lingotek.atlassian.net/wiki/
|
72 |
|
73 |
== Frequently Asked Questions ==
|
74 |
|
@@ -122,6 +122,11 @@ For more, visit the [Lingotek documentation site](https://lingotek.atlassian.net
|
|
122 |
|
123 |
== Changelog ==
|
124 |
|
|
|
|
|
|
|
|
|
|
|
125 |
= 1.1.8 (2015-11-19) =
|
126 |
|
127 |
* Simplified authentication to Lingotek
|
@@ -220,4 +225,4 @@ For more, visit the [Lingotek documentation site](https://lingotek.atlassian.net
|
|
220 |
== Upgrade Notice ==
|
221 |
|
222 |
= 1.0 =
|
223 |
-
The fully featured version is now released publicly. Upgrade!
|
4 |
Tags: automation, bilingual, international, language, Lingotek, localization, multilanguage, multilingual, translate, translation
|
5 |
Requires at least: 3.8
|
6 |
Tested up to: 4.4
|
7 |
+
Stable tag: 1.1.9
|
8 |
License: GPLv2 or later
|
9 |
License URI: http://www.gnu.org/licenses/gpl-2.0.html
|
10 |
|
63 |
== Installation ==
|
64 |
|
65 |
1. Make sure you have [Polylang](https://wordpress.org/plugins/polylang/) installed as it provides the framework for the Lingotek plugin.
|
66 |
+
1. Upload the `lingotek-translation` folder to the `/wp-content/plugins/` directory.
|
67 |
1. Activate the Lingotek plugin through the 'Plugins' menu in Wordpress.
|
68 |
1. Navigate to the `Translation` menu that appears in your admin menu.
|
69 |
1. From here you can create a new Lingotek account if you do not have one, or you can connect to an existing Lingotek account.
|
70 |
1. After creating a new account or connecting with your existing account you will be redirected to the Lingotek Translation tutorial and admin pages.
|
71 |
+
1. For more information and help visit [Getting Started](https://lingotek.atlassian.net/wiki/display/PDOC/WordPress) in the Lingotek Translation Documentation or contact support@lingotek.com
|
72 |
|
73 |
== Frequently Asked Questions ==
|
74 |
|
122 |
|
123 |
== Changelog ==
|
124 |
|
125 |
+
= 1.1.9 (2016-1-19) =
|
126 |
+
|
127 |
+
* Updated code to be compatible with Polylang 1.8 structural changes
|
128 |
+
* Minor bug fixes
|
129 |
+
|
130 |
= 1.1.8 (2015-11-19) =
|
131 |
|
132 |
* Simplified authentication to Lingotek
|
225 |
== Upgrade Notice ==
|
226 |
|
227 |
= 1.0 =
|
228 |
+
The fully featured version is now released publicly. Upgrade!
|