Changeset 1721 for sites/trunk/translate.wordpress.org/includes/gp-plugins/wporg-routes/routes/index.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/index.php
r1586 r1721 7 7 class GP_WPorg_Route_Index extends GP_Route { 8 8 9 public function get_index() { 10 $this->redirect( gp_url( '/languages' ) ); 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( 'index-locales', get_defined_vars() ); 32 } 33 34 private function _sort_english_name_callback( $a, $b ) { 35 return $a->english_name > $b->english_name; 11 36 } 12 37 }
Note: See TracChangeset
for help on using the changeset viewer.