Changeset 1721 for sites/trunk/translate.wordpress.org/includes/gp-plugins/wporg-routes/routes/locale.php
- Timestamp:
- 07/10/2015 05:29:36 PM (10 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
sites/trunk/translate.wordpress.org/includes/gp-plugins/wporg-routes/routes/locale.php
r1686 r1721 3 3 * Locale Route Class. 4 4 * 5 * Provides the route for translate.wordpress.org/l anguages.5 * Provides the route for translate.wordpress.org/locale/$locale. 6 6 */ 7 7 class GP_WPorg_Route_Locale extends GP_Route { 8 9 /**10 * Prints all exisiting locales as cards.11 */12 public function get_locales() {13 $locales = array();14 $existing_locales = GP::$translation_set->existing_locales();15 foreach ( $existing_locales as $locale ) {16 $locales[] = GP_Locales::by_slug( $locale );17 }18 usort( $locales, array( $this, '_sort_english_name_callback') );19 unset( $existing_locales );20 21 $contributors_count = wp_cache_get( 'contributors-count', 'wporg-translate' );22 if ( false === $contributors_count ) {23 $contributors_count = array();24 }25 26 $translation_status = wp_cache_get( 'translation-status', 'wporg-translate' );27 if ( false === $translation_status ) {28 $translation_status = array();29 }30 31 $this->tmpl( 'locales', get_defined_vars() );32 }33 8 34 9 /** … … 78 53 $variants = $this->get_locale_variants( $locale_slug, array_keys( $project_status ) ); 79 54 80 $this->tmpl( 'locale ', get_defined_vars() );55 $this->tmpl( 'locale-projects', get_defined_vars() ); 81 56 } 82 57 … … 285 260 return strcasecmp( $a->name, $b->name ); 286 261 } 287 288 private function _sort_english_name_callback( $a, $b ) {289 return $a->english_name > $b->english_name;290 }291 262 }
Note: See TracChangeset
for help on using the changeset viewer.