Index: wp-includes/media.php
===================================================================
--- wp-includes/media.php	(revision 22645)
+++ wp-includes/media.php	(working copy)
@@ -1328,10 +1328,13 @@
 		), admin_url('media-upload.php') ),
 	);
 
-	if ( isset( $args['post'] ) )
-		$settings['postId'] = get_post( $args['post'] )->ID;
+	$post = null;
+	if ( isset( $args['post'] ) ) {
+		$post = get_post( $args['post'] );
+		$settings['postId'] = $post->ID;
+	}
 
-	wp_localize_script( 'media-views', '_wpMediaViewsL10n', array(
+	wp_localize_script( 'media-views', '_wpMediaViewsL10n', apply_filters( 'media_views_l10n', array(
 		// Settings
 		'settings' => $settings,
 
@@ -1375,7 +1378,7 @@
 		'updateGallery'      => __( 'Update gallery' ),
 		'continueEditing'    => __( 'Continue editing' ),
 		'addToGallery'       => __( 'Add to gallery' ),
-	) );
+	), $post ) );
 
 	wp_enqueue_script( 'media-upload' );
 	wp_enqueue_style( 'media-views' );
