Making WordPress.org


Ignore:
Timestamp:
12/19/2017 04:22:37 PM (9 years ago)
Author:
obenland
Message:

PLugins: Clean up formatting with phpcbf

File:
1 edited

Legend:

Unmodified
Added
Removed
  • sites/trunk/wordpress.org/public_html/wp-content/plugins/plugin-directory/api/routes/class-locale-banner.php

    r6196 r6287  
    11<?php
    22namespace WordPressdotorg\Plugin_Directory\API\Routes;
     3
    34use WordPressdotorg\Plugin_Directory\API\Base;
    45use WP_REST_Server;
     
    1516                        'methods'  => WP_REST_Server::EDITABLE,
    1617                        'callback' => array( $this, 'locale_banner' ),
    17                         'args' => array(
     18                        'args'     => array(
    1819                                'plugin_slug' => array(
    1920                                        'validate_callback' => array( $this, 'validate_plugin_slug_callback' ),
     
    6970
    7071                // Build a list of WordPress locales which we'll suggest to the user.
    71                 $suggest_locales = array_values( array_intersect( $locales_from_header, $translated_locales ) );
    72                 $current_locale_is_suggested = in_array( $current_locale, $suggest_locales );
     72                $suggest_locales              = array_values( array_intersect( $locales_from_header, $translated_locales ) );
     73                $current_locale_is_suggested  = in_array( $current_locale, $suggest_locales );
    7374                $current_locale_is_translated = in_array( $current_locale, $translated_locales );
    7475
     
    116117                                }
    117118
    118                         // Multiple locale suggestions.
     119                                // Multiple locale suggestions.
    119120                        } elseif ( ! empty( $suggest_named_locales ) ) {
    120                                 $primary_locale = key( $suggest_named_locales );
     121                                $primary_locale   = key( $suggest_named_locales );
    121122                                $primary_language = current( $suggest_named_locales );
    122123                                array_shift( $suggest_named_locales );
     
    169170                                }
    170171
    171                         // Non-English locale in header, no translations.
     172                                // Non-English locale in header, no translations.
    172173                        } elseif ( $locales_from_header ) {
    173174                                $locale = reset( $locales_from_header );
     
    180181                        }
    181182
    182                 // Localized directory.
     183                        // Localized directory.
    183184                } elseif ( ! $current_locale_is_suggested && ! $current_locale_is_translated && $is_plugin_request ) {
    184185                        $suggest_string = sprintf(
     
    254255        protected function get_http_locales( $header ) {
    255256                $locale_part_re = '[a-z]{2,}';
    256                 $locale_re = "($locale_part_re(\-$locale_part_re)?)";
     257                $locale_re      = "($locale_part_re(\-$locale_part_re)?)";
     258
    257259                if ( preg_match_all( "/$locale_re/i", $header, $matches ) ) {
    258260                        return $matches[0];
     
    271273         */
    272274        protected function map_locale( $lang, $region, $available_locales ) {
    273                 $uregion = strtoupper( $region );
    274                 $ulang   = strtoupper( $lang );
     275                $uregion  = strtoupper( $region );
     276                $ulang    = strtoupper( $lang );
    275277                $variants = array(
    276278                        "$lang-$region",
     
    353355
    354356// Strings for the POT file.
    355 
    356357/* translators: %s: native language name. */
    357358__( 'This plugin is also available in %1$s. <a href="%2$s">Help improve the translation!</a>', 'wporg-plugins' );
Note: See TracChangeset for help on using the changeset viewer.