Index: wp-includes/script-loader.php
===================================================================
--- wp-includes/script-loader.php	(revision 19910)
+++ wp-includes/script-loader.php	(working copy)
@@ -79,7 +79,9 @@
 		'enterImageURL' => __('Enter the URL of the image'),
 		'enterImageDescription' => __('Enter a description of the image'),
 		'fullscreen' => __('fullscreen'),
-		'toggleFullscreen' => esc_attr( __('Toggle fullscreen mode') )
+		'toggleFullscreen' => esc_attr( __('Toggle fullscreen mode') ),
+		'textdirection' => esc_attr( __('text direction') ),
+		'toggleTextdirection' => esc_attr( __('Toggle Editor Text Direction') )
 	) );
 
 	$scripts->add( 'colorpicker', "/wp-includes/js/colorpicker$suffix.js", array('prototype'), '3517m' );
Index: wp-includes/js/quicktags.dev.js
===================================================================
--- wp-includes/js/quicktags.dev.js	(revision 19910)
+++ wp-includes/js/quicktags.dev.js	(working copy)
@@ -264,6 +264,12 @@
 				html += theButtons['fullscreen'].html(name + '_');
 			}
 
+
+			if ( 'rtl' == document.getElementsByTagName('html')[0].dir ) {
+				theButtons['textdirection'] = new qt.TextDirectionButton();
+				html += theButtons['textdirection'].html(name + '_');
+			}
+
 			ed.toolbar.innerHTML = html;
 			ed.theButtons = theButtons;
 		}
@@ -605,6 +611,24 @@
 		fullscreen.on();
 	};
 
+	qt.TextDirectionButton = function() {
+		qt.Button.call(this, 'textdirection', quicktagsL10n.textdirection, '', quicktagsL10n.toggleTextdirection)
+	};
+	qt.TextDirectionButton.prototype = new qt.Button();
+	qt.TextDirectionButton.prototype.callback = function(e, c) {
+	
+		var isRTL =  ( 'rtl' == document.getElementsByTagName('html')[0].dir );
+		
+		currentDirection  = c.style.direction;
+
+		if ( '' == currentDirection )
+			currentDirection = ( isRTL ) ?  'rtl' : 'ltr' ;
+
+		c.style.direction = ( 'rtl' == currentDirection ) ? 'ltr' : 'rtl';
+
+		c.focus();
+	}
+
 	// ensure backward compatibility
 	edButtons[10] = new qt.TagButton('strong','b','<strong>','</strong>','b');
 	edButtons[20] = new qt.TagButton('em','i','<em>','</em>','i'),
