Changeset 12176
- Timestamp:
- 11/01/2022 06:41:55 AM (2 years ago)
- Location:
- sites/trunk/wordpress.org/public_html/wp-content/plugins
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
sites/trunk/wordpress.org/public_html/wp-content/plugins/plugin-directory/class-plugin-i18n.php
r10447 r12176 461 461 $translation_sets = $this->cache_get( $post->post_name, $branch, $cache_suffix ); 462 462 if ( false === $translation_sets ) { 463 $api_url = esc_url_raw( 'https://translate.wordpress.org/api/projects/wp-plugins/' . $post->post_name . '/' . $branch , [ 'https' ] );463 $api_url = esc_url_raw( 'https://translate.wordpress.org/api/projects/wp-plugins/' . $post->post_name . '/' . $branch . '/', [ 'https' ] ); 464 464 $response = wp_remote_get( $api_url ); 465 465 -
sites/trunk/wordpress.org/public_html/wp-content/plugins/wporg-gp-customizations/inc/class-plugin.php
r12123 r12176 77 77 //Locales\Serbian_Latin::init(); 78 78 79 // Correct `WP_Locale` for variant locales in project lists. 80 add_filter( 'gp_translation_sets_sort', [ $this, 'filter_gp_translation_sets_sort' ] ); 81 79 82 if ( defined( 'WP_CLI' ) && WP_CLI ) { 80 83 $this->register_cli_commands(); … … 571 574 return $content; 572 575 } 576 577 /** 578 * Filter the project translation set list to have correct WP_Locale fields for variants. 579 * 580 * This also affects the API output, so as not to have duplicate `wp_locale` fields with variants. 581 * 582 * @see https://meta.trac.wordpress.org/ticket/4367 583 * 584 * @param array $translation_sets The translation sets. 585 * @return array Filtered translation sets. 586 */ 587 function filter_gp_translation_sets_sort( $translation_sets ) { 588 foreach ( $translation_sets as $set ) { 589 if ( 'default' !== $set->slug && ! str_contains( $set->wp_locale, $set->slug ) ) { 590 $set->wp_locale .= '_' . $set->slug; 591 } 592 } 593 594 return $translation_sets; 595 } 573 596 }
Note: See TracChangeset
for help on using the changeset viewer.