Skip to content

Instantly share code, notes, and snippets.

@mikejolley
Created February 7, 2014 12:44
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save mikejolley/8862027 to your computer and use it in GitHub Desktop.
Save mikejolley/8862027 to your computer and use it in GitHub Desktop.
Get a list of Transifex contributors from WordPress for a project
$project_name = 'woocommerce-core';
$your_username = 'YOURUSERNAME';
$your_password = 'YOURPASSWORD'; // Don't include this in open source projects for obvious reasons :)
$response = wp_remote_post( 'http://www.transifex.com/api/2/project/' . $project_name . '/languages/', array(
'method' => 'GET',
'headers' => array(
'Authorization' => 'Basic ' . base64_encode( $your_username . ':' . $your_password )
)
) );
$result = (array) json_decode( $response['body'] );
$translators = array();
if ( $result ) {
foreach ( $result as $lang ) {
$translators = array_merge( $translators, $lang->coordinators );
$translators = array_merge( $translators, $lang->translators );
$translators = array_merge( $translators, $lang->reviewers );
}
}
$translators = array_unique( array_filter( $translators ) );
$translators_html = '<h1>' . $project_name . ' Transifex Contributors</h1><ul>';
foreach ( $translators as $translator ) {
$translators_html .= '<li><a href="https://www.transifex.com/accounts/profile/' . $translator . '">' . $translator . '</a></li>';
}
$translators_html .= '</ul>';
echo $translators_html;
@shivapoudel
Copy link

@mikejolley what about merging this into WooCommerce. Translation contributuors list is unmanged and is long so perform this action soon.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment