Prepare the Credits page to handle translators. see #17532.

git-svn-id: http://svn.automattic.com/wordpress/trunk@18002 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
nacin 2011-05-23 05:33:33 +00:00
parent ab840f8074
commit d265a3a79d
1 changed files with 16 additions and 7 deletions

View File

@ -63,7 +63,8 @@ $results = wp_credits();
if ( ! $results ) { if ( ! $results ) {
echo '<p>' . sprintf( __( 'WordPress is created by a <a href="%1$s">worldwide team</a> of passionate individuals. <a href="%2$s">Get involved in WordPress</a>.' ), echo '<p>' . sprintf( __( 'WordPress is created by a <a href="%1$s">worldwide team</a> of passionate individuals. <a href="%2$s">Get involved in WordPress</a>.' ),
'http://wordpress.org/about/', 'http://wordpress.org/about/',
_x( 'http://codex.wordpress.org/Contributing_to_WordPress', 'Url to the codex documentation on contributing to WordPress used on the credits page' ) ) . '</p>'; /* translators: Url to the codex documentation on contributing to WordPress used on the credits page */
__( 'http://codex.wordpress.org/Contributing_to_WordPress' ) ) . '</p>';
include( './admin-footer.php' ); include( './admin-footer.php' );
exit; exit;
} }
@ -86,9 +87,18 @@ foreach ( (array) $results['people'] as $group_slug => $members ) {
} }
foreach ( (array) $results['lists'] as $group_slug => $members ) { foreach ( (array) $results['lists'] as $group_slug => $members ) {
$title = translate( $results['groups'][ $group_slug ] ); if ( $group_slug === 'translators' ) {
if ( isset( $results['data']['placeholders'][ $group_slug ] ) ) // Considered a special slug in the API response. (Also, will never be returned for en_US.)
$title = vsprintf( $title, $results['data']['placeholders'][ $group_slug ] ); /* translators: use the name of your own language here */
$title = __( 'English Translators' );
if ( 'English Translators' == $title )
$title = __( 'Translators' );
} else {
$title = translate( $results['groups'][ $group_slug ] );
if ( isset( $results['data']['placeholders'][ $group_slug ] ) )
$title = vsprintf( $title, $results['data']['placeholders'][ $group_slug ] );
}
echo '<h3 class="wp-props-group">' . $title . "</h3>\n\n"; echo '<h3 class="wp-props-group">' . $title . "</h3>\n\n";
array_walk( $members, '_wp_credits_add_profile_link', $results['data']['profile_prefix'] ); array_walk( $members, '_wp_credits_add_profile_link', $results['data']['profile_prefix'] );
shuffle( $members ); shuffle( $members );
@ -97,7 +107,8 @@ foreach ( (array) $results['lists'] as $group_slug => $members ) {
?> ?>
<p class="clear"><?php printf( __( 'Want to see your name in lights on this page? <a href="%s">Get involved in WordPress</a>.' ), <p class="clear"><?php printf( __( 'Want to see your name in lights on this page? <a href="%s">Get involved in WordPress</a>.' ),
_x( 'http://codex.wordpress.org/Contributing_to_WordPress', 'Url to the codex documentation on contributing to WordPress used on the credits page' ) ); ?></p> /* translators: Url to the codex documentation on contributing to WordPress used on the credits page */
__( 'http://codex.wordpress.org/Contributing_to_WordPress' ) ); ?></p>
</div> </div>
<?php <?php
@ -110,7 +121,6 @@ __( 'Project Leaders' );
__( 'Extended Core Team' ); __( 'Extended Core Team' );
__( 'Recent Rockstars' ); __( 'Recent Rockstars' );
__( 'Core Contributors to WordPress %s' ); __( 'Core Contributors to WordPress %s' );
__( 'Translators for %s' );
__( 'Cofounder, Project Lead' ); __( 'Cofounder, Project Lead' );
__( 'Lead Developer' ); __( 'Lead Developer' );
__( 'UI/UX and Community Lead' ); __( 'UI/UX and Community Lead' );
@ -119,6 +129,5 @@ __( 'Developer' );
__( 'Designer' ); __( 'Designer' );
__( 'XML-RPC Developer' ); __( 'XML-RPC Developer' );
__( 'Internationalization' ); __( 'Internationalization' );
__( 'Twenty Eleven' );
?> ?>