What is the best way to submit code changes ?

3.31K viewsCore
0

I don’t know if (and how) it is possible to submit changes to anspress. Is it possible (and recommended) to do that via the github repo ? Do we need to have special rights for that ?

Here’s the changes that I’d like to submit :

In function ap_reputation_get_info() (in /includes/reputation.php), some strings contain a direct post type (like ‘answer’ or ‘question’) which is therefore not translated.

This could be easily fixed by defining the following function :

function get_translated_post_type( $post_id ) {
	$post_type = get_post_type( $post_id );
	switch ( $post_type ) {
		case 'question':
			$translated_post_type = __( 'question', 'anspress-question-answer' );
			break;
		case 'answer':
			$translated_post_type = __( 'answer', 'anspress-question-answer' );
			break;
		default:
			$translated_post_type = $post_type;
			break;
	}
	return $translated_post_type;
}

and then calling

get_translated_post_type( $action_id )

instead of

get_post_type( $action_id )

in ap_reputation_get_info()

Thanks for letting me know if there’s a better way to submit pieces of code like that.

Fred