--- wp-includes/media.php.old	2008-06-13 13:18:48.000000000 +0300
+++ wp-includes/media.php	2008-06-13 13:20:48.000000000 +0300
@@ -335,7 +335,7 @@
 add_shortcode('gallery', 'gallery_shortcode');
 
 function gallery_shortcode($attr) {
-	global $post;
+	global $post, $wp_locale;
 
 	// Allow plugins/themes to override the default gallery template.
 	$output = apply_filters('post_gallery', '', $attr);
@@ -377,6 +377,7 @@
 	$captiontag = tag_escape($captiontag);
 	$columns = intval($columns);
 	$itemwidth = $columns > 0 ? floor(100/$columns) : 100;
+	$float = $wp_locale->text_direction == 'rtl' ? 'right' : 'left';
 	
 	$output = apply_filters('gallery_style', "
 		<style type='text/css'>
@@ -384,7 +385,7 @@
 				margin: auto;
 			}
 			.gallery-item {
-				float: left;
+				float: {$float};
 				margin-top: 10px;
 				text-align: center;
 				width: {$itemwidth}%;			}
