PluginProbe
Booking Calendar / 11.5
Booking Calendar v11.5
11.8.4 11.8.3 11.8.2 11.8.1 11.8 11.7 11.6.1 11.6 11.5 11.4.3 11.4.2 11.4.1 11.4 11.3 11.2.1 11.2 11.1 11.0 10.15.7 10.15.6 10.1.3 10.10 10.10.1 10.10.2 10.11 All 204 releases
booking / core / class / wpbc-class-upgrader-translation-skin.php

wpbc-class-upgrader-translation-skin.php in Booking Calendar 11.5, at core/class/wpbc-class-upgrader-translation-skin.php

74 lines 2.4 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <?php
2 /**
3 * @version 1.0
4 * @package Booking Calendar
5 * @subpackage Translations Functions
6 * @category Functions
7 *
8 * @author wpdevelop
9 * @link https://wpbookingcalendar.com/
10 * @email info@wpbookingcalendar.com
11 *
12 * @modified 29.09.2015
13 */
14
15 if ( ! defined( 'ABSPATH' ) ) {
16 exit;
17 } // Exit if accessed directly.
18
19 require_once ABSPATH . 'wp-admin/includes/class-wp-upgrader.php';
20
21 class WPBC_Upgrader_Translation_Skin extends WP_Upgrader_Skin {
22
23 function __construct( $args = array() ) {
24 $defaults = array(
25 'url' => '',
26 'nonce' => '',
27 'title' => '',
28 'context' => false,
29 );
30 $this->options = wp_parse_args( $args, $defaults );
31 }
32
33 function header() {}
34
35 function footer() {}
36
37 function error( $error ) {
38 $this->installer_error = $error;
39 }
40
41 function add_strings() {
42 $this->upgrader->strings['starting_upgrade'] = __( 'Some of your translations need updating. Sit tight for a few more seconds while we update them as well.', 'booking' );
43 $this->upgrader->strings['up_to_date'] = __( 'Your translations are all up to date.', 'booking' );
44 $this->upgrader->strings['no_package'] = __( 'Update package not available.', 'booking' );
45 /* translators: %s: Package URL. */
46 $this->upgrader->strings['downloading_package'] = sprintf( __( 'Downloading translation from %s&#8230;', 'booking' ), '<span class="code">%s</span>' );
47 $this->upgrader->strings['unpack_package'] = __( 'Unpacking the update&#8230;', 'booking' );
48 $this->upgrader->strings['process_failed'] = __( 'Translation update failed.', 'booking' );
49 $this->upgrader->strings['process_success'] = __( 'Translation updated successfully.', 'booking' );
50 $this->upgrader->strings['remove_old'] = __( 'Removing the old version of the translation&#8230;', 'booking' );
51 $this->upgrader->strings['remove_old_failed'] = __( 'Could not remove the old translation.', 'booking' );
52
53 }
54
55 public function set_upgrader( &$upgrader ) {
56 if ( is_object( $upgrader ) ) {
57 $this->upgrader =& $upgrader;
58 }
59 $this->add_strings();
60 }
61
62 function before() {}
63
64 function after() {
65 if ( ! empty( $this->installer_error ) ) {
66 if ( is_wp_error( $this->installer_error ) ) {
67 $message = $this->installer_error->get_error_message() . ' (' . $this->installer_error->get_error_data() . ')';
68
69 echo wp_kses_post( $message );
70 }
71 }
72 }
73 }
74