Changeset 812
- Timestamp:
- 08/26/2014 03:21:21 AM (10 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
sites/trunk/api.wordpress.org/public_html/translations/lib.php
r778 r812 74 74 } 75 75 76 $i = 0; 76 77 foreach ( $translations as $translation ) { 77 78 $locale = GP_Locales::by_field( 'wp_locale', $translation->language ); … … 80 81 // We'll use ISO codes for sorting. 81 82 if ( $locale->lang_code_iso_639_1 ) { 82 $ iso= $isos[1] = $locale->lang_code_iso_639_1;83 $key = $isos[1] = $locale->lang_code_iso_639_1; 83 84 } 84 85 if ( $locale->lang_code_iso_639_2 ) { 85 $ iso= $isos[2] = $locale->lang_code_iso_639_2;86 $key = $isos[2] = $locale->lang_code_iso_639_2; 86 87 } 87 88 if ( $locale->lang_code_iso_639_3 ) { 88 $ iso= $isos[3] = $locale->lang_code_iso_639_3;89 $key = $isos[3] = $locale->lang_code_iso_639_3; 89 90 } 90 91 … … 93 94 } 94 95 95 $_translations[ $iso ] = $translation; 96 $_translations[ $iso ]->english_name = $locale->english_name; 97 $_translations[ $iso ]->native_name = $locale->native_name; 98 $_translations[ $iso ]->package = sprintf( "$base_url/%s/%s.zip", $translation->version, $translation->language ); 99 $_translations[ $iso ]->iso = (object) $isos; 96 // ISO codes are being used for sorting. Don't let variants stomp on each other. 97 if ( isset( $_translations[ $key ] ) ) { 98 $key .= ++$i; 99 } 100 101 $_translations[ $key ] = $translation; 102 $_translations[ $key ]->english_name = $locale->english_name; 103 $_translations[ $key ]->native_name = $locale->native_name; 104 $_translations[ $key ]->package = sprintf( "$base_url/%s/%s.zip", $translation->version, $translation->language ); 105 $_translations[ $key ]->iso = (object) $isos; 100 106 101 107 if ( 'core' === $type ) { 102 108 $continue = isset( $continue_translations[ $locale->slug ] ) ? $continue_translations[ $locale->slug ]->translation : ''; 103 $_translations[ $ iso]->strings = (object) array( 'continue' => $continue );109 $_translations[ $key ]->strings = (object) array( 'continue' => $continue ); 104 110 } 105 111 }
Note: See TracChangeset
for help on using the changeset viewer.