Skip to content

Commit

Permalink
Adds compatibility for the fucking _load_textdomain_just_in_time()
Browse files Browse the repository at this point in the history
…function
  • Loading branch information
Pierre-Lannoy committed Nov 17, 2024
1 parent 1a32733 commit 09470cd
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 14 deletions.
20 changes: 10 additions & 10 deletions includes/libraries/class-libraries.php
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ public static function init() {
'base' => TRAFFIC_VENDOR_DIR . 'lock/',
'version' => '2.1',
// phpcs:ignore
'author' => sprintf( esc_html__( '%s & contributors', 'decalog' ), 'Willem Stuursma-Ruwen' ),
'author' => 'Willem Stuursma-Ruwen',
'url' => 'https://github.com/php-lock/lock',
'license' => 'wtpfl',
'langs' => 'en',
Expand All @@ -75,7 +75,7 @@ public static function init() {
'base' => TRAFFIC_VENDOR_DIR . 'feather/',
'version' => '4.24.1',
// phpcs:ignore
'author' => sprintf( esc_html__( '%s & contributors', 'traffic' ), 'Cole Bemis' ),
'author' => 'Cole Bemis',
'url' => 'https://feathericons.com',
'license' => 'mit',
'langs' => 'en',
Expand All @@ -86,7 +86,7 @@ public static function init() {
'base' => TRAFFIC_VENDOR_DIR . 'markdown/',
'version' => '1.2.1',
// phpcs:ignore
'author' => sprintf( esc_html__( '%s & contributors', 'traffic' ), 'Carsten Brandt' ),
'author' => 'Carsten Brandt',
'url' => 'https://github.com/cebe/markdown',
'license' => 'mit',
'langs' => 'en',
Expand Down Expand Up @@ -225,44 +225,44 @@ public function sc_get_list( $attributes ) {
$item = [];
$item['name'] = 'Switchery';
$item['version'] = '0.8.2';
$item['author'] = sprintf( esc_html__( '%s & contributors', 'traffic' ), 'Alexander Petkov' );
$item['author'] = 'Alexander Petkov';
$item['url'] = 'https://github.com/abpetkov/switchery';
$item['license'] = $this->license_name( 'mit' );
$item['langs'] = L10n::get_language_markup( [ 'en' ] );
$list[] = $item;
$item = [];
$item['name'] = 'Date Range Picker';
$item['version'] = '3.0.5';
$item['author'] = sprintf( esc_html__( '%s & contributors', 'traffic' ), 'Dan Grossman' );
$item['author'] = 'Dan Grossman';
$item['url'] = 'https://github.com/dangrossman/daterangepicker';
$item['license'] = $this->license_name( 'mit' );
$item['langs'] = L10n::get_language_markup( [ 'en' ] );
$list[] = $item;
$item = [];
$item['name'] = 'Moment';
$item['version'] = '2.29.4';
$item['author'] = sprintf( esc_html__( '%s & contributors', 'traffic' ), 'Tim Wood' );
$item['author'] = 'Tim Wood';
$item['url'] = 'https://github.com/moment/moment';
$item['license'] = $this->license_name( 'mit' );
$item['langs'] = L10n::get_language_markup( [ 'en' ] );
$list[] = $item;
$item['name'] = 'SVG-Loaders';
$item['version'] = '1.0.2';
$item['author'] = sprintf( esc_html__( '%s & contributors', 'traffic' ), 'Sam Herbert' );
$item['author'] = 'Sam Herbert';
$item['url'] = 'https://github.com/SamHerbert/SVG-Loaders';
$item['license'] = $this->license_name( 'mit' );
$item['langs'] = L10n::get_language_markup( [ 'en' ] );
$list[] = $item;
$item['name'] = 'Chartist-JS';
$item['version'] = '0.11.4';
$item['author'] = sprintf( esc_html__( '%s & contributors', 'traffic' ), 'Gion Kunz' );
$item['author'] = 'Gion Kunz';
$item['url'] = 'https://github.com/gionkunz/chartist-js';
$item['license'] = $this->license_name( 'mit' );
$item['langs'] = L10n::get_language_markup( [ 'en' ] );
$list[] = $item;
$item['name'] = 'jVectorMap';
$item['version'] = '2.0.3';
$item['author'] = sprintf( esc_html__( '%s & contributors', 'traffic' ), 'Kirill Lebedev' );
$item['author'] = 'Kirill Lebedev';
$item['url'] = 'https://github.com/bjornd/jvectormap';
$item['license'] = $this->license_name( 'gpl3' );
$item['langs'] = L10n::get_language_markup( [ 'en' ] );
Expand All @@ -272,7 +272,7 @@ public function sc_get_list( $attributes ) {
$items = [];
foreach ( $list as $library ) {
/* translators: as in the sentence "Product W version X by author Y (license Z)" */
$items[] = sprintf( __( '<a href="%1$s">%2$s %3$s</a>%4$s by %5$s (%6$s)', 'traffic' ), $library['url'], $library['name'], 'v' . $library['version'], $library['langs'], $library['author'], $library['license'] );
$items[] = sprintf( __( '<a href="%1$s">%2$s %3$s</a>%4$s by %5$s & contributors (%6$s)', 'traffic' ), $library['url'], $library['name'], 'v' . $library['version'], $library['langs'], $library['author'], $library['license'] );
}
$result = implode( ', ', $items );
}
Expand Down
4 changes: 0 additions & 4 deletions includes/plugin/class-initializer.php
Original file line number Diff line number Diff line change
Expand Up @@ -39,10 +39,6 @@ public function initialize() {
\Traffic\System\Sitehealth::init();
\Traffic\Plugin\Feature\Capture::init();
\Traffic\System\APCu::init();
//if ( 'en_US' !== determine_locale() ) {
unload_textdomain( TRAFFIC_SLUG );
load_plugin_textdomain( TRAFFIC_SLUG );
//}
}

/**
Expand Down

0 comments on commit 09470cd

Please sign in to comment.