<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>Guy Rutenberg &#187; cssrtl.py</title>
	<atom:link href="http://www.guyrutenberg.com/tag/cssrtl-py/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.guyrutenberg.com</link>
	<description>Keeping track of what I do</description>
	<lastBuildDate>Sat, 21 Aug 2010 11:44:14 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0.1</generator>
		<item>
		<title>An Early Release of the New cssrtl.py-2.0</title>
		<link>http://www.guyrutenberg.com/2009/09/20/an-early-release-of-the-new-cssrtl-py-2-0/</link>
		<comments>http://www.guyrutenberg.com/2009/09/20/an-early-release-of-the-new-cssrtl-py-2-0/#comments</comments>
		<pubDate>Sun, 20 Sep 2009 10:00:50 +0000</pubDate>
		<dc:creator>Guy</dc:creator>
				<category><![CDATA[Projects]]></category>
		<category><![CDATA[Python]]></category>
		<category><![CDATA[cssrtl.py]]></category>
		<category><![CDATA[RTL]]></category>

		<guid isPermaLink="false">http://www.guyrutenberg.com/?p=578</guid>
		<description><![CDATA[It has been three years since I&#8217;ve released the]]></description>
			<content:encoded><![CDATA[<p>It has been three years since I&#8217;ve released the <a href=/2007/12/28/convert-css-layout-to-rtl-cssrtlpy/">original version</a> of <code>cssrtl.py</code> (and two since it&#8217;s re-release). The old version did a nice job, but experience gained during that time led me to write from scratch a new version. I&#8217;ve detailed more than a month ago, the <a href="/2009/08/05/designing-a-better-a-css-rtl-convertor/">basic principles and ideas</a> that guided me to design a better tool to help adapting CSS files from left-to-right to right-to-left.</p>
<p>The guidelines weren&#8217;t just empty words, they were written while working on the <a href="/2009/08/15/rtl-and-hebrew-adaptation-of-the-fusion-wordpress-theme/">Hebrew adaptation to the Fusion theme</a> and in the same time writing a new proof-of-concept version of <code>cssrtl.py</code>. The original intent was to release a more mature version of that code when it will be completed. However, due to the apparent shortage of time in the present and foreseeable future, I can&#8217;t see myself complete the project any time soon. So following the &#8220;release early&#8221; mantra, I&#8217;ve decided to release the code as-is. As I said, the code is in working state, but not polished, so it may be of benefit but may contain bugs. If you find any bugs or have any suggestions, I would be glad to hear.<br />
<span id="more-578"></span></p>
<h3>Download</h3>
<p>You can download the new version from here: <a href="/wp-content/uploads/2009/09/cssrtl.py-2.0.tar.bz2">cssrtl.py-2.0.tar.bz2</a>. The code is available under the GPLv2 or any later version.</p>
<h3>Usage</h3>
<p>The new version works by creating a seperate css &#8220;fix&#8221; file that fixes the directionality of the css styles.</p>

<div class="wp_syntax"><div class="code"><pre class="text" style="font-family:monospace;">./cssrtl.py &lt; main.css &gt; main-rtl.css</pre></div></div>

<p>Afterward, just link the <code>main-rtl.css</code> after <code>main.css</code> in your HTML files.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.guyrutenberg.com/2009/09/20/an-early-release-of-the-new-cssrtl-py-2-0/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Designing a Better a CSS RTL Convertor</title>
		<link>http://www.guyrutenberg.com/2009/08/05/designing-a-better-a-css-rtl-convertor/</link>
		<comments>http://www.guyrutenberg.com/2009/08/05/designing-a-better-a-css-rtl-convertor/#comments</comments>
		<pubDate>Wed, 05 Aug 2009 09:41:15 +0000</pubDate>
		<dc:creator>Guy</dc:creator>
				<category><![CDATA[Projects]]></category>
		<category><![CDATA[cssrtl.py]]></category>

		<guid isPermaLink="false">http://www.guyrutenberg.com/?p=418</guid>
		<description><![CDATA[About a year and a half ago I&#8217;ve released cssrtl.py, a script that translates CSS code to RTL. The script was designed to be fully autonomous, however translating CSS code is a complex task, as not all the information needed to make the translation is available in the CSS files. While cssrtl.py did a very [...]]]></description>
			<content:encoded><![CDATA[<p>About a year and a half ago I&#8217;ve released <a href="/2007/12/28/convert-css-layout-to-rtl-cssrtlpy/"><code>cssrtl.py</a>, a script that translates CSS code to RTL. The script was designed to be fully autonomous, however translating CSS code is a complex task, as not all the information needed to make the translation is available in the CSS files. While <code>cssrtl.py</code> did a very good job on some tasks it lacks on several issues:</p>
<ol>
<li>When a design update is released, one cannot use previous translation work.</li>
<li>When things don't go smooth, it's hard to find out why.</li>
<li>Complex CSS can't be translated automatically, as it requires understanding of the structure of the corresponding html files and how the CSS will be used by future code.</li>
</ol>
<p><span id="more-418"></span><br />
There are two basic ideas behind building a new and improved replacement for <code>cssrtl.py</code>. The first, instead of translating the CSS file, the script will create a patch that translates the code. This would allow to see the changes required for RTL changes and easily adapt new version of the CSS code. This also solves the second problem, as it makes clear what changes where made by the script and what are part of the original code. The other change takes the script from trying to be autonomous to human guided translation. Instead of making all the changes completely by itself, the script only makes trivial changes (which are most changes) and clearly leaves comments guiding the human operator on what work remained to be done. This approach saves a lot of time as the script works only does what it can and doesn't hinder the translation efforts by trying to translate code that it can't translate properly.</p>
<p>Following this new design for CSS to RTL convertor, I've built a new version of <code>cssrtl.py</code>. The new version is still premature work, and some work needs to be done before I'll be able to release it publicly. However, it already revealed itself handy when I adapted a WordPress theme to Hebrew, which I intend to release soon.</p>
<p><strong>Update 2009-08-15:</strong> I've released the mentioned WordPress theme, it's <a href="/2009/08/15/rtl-and-hebrew-adaptation-of-the-fusion-wordpress-theme/">RTL port of the Fusion theme</a>.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.guyrutenberg.com/2009/08/05/designing-a-better-a-css-rtl-convertor/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Convert CSS layout to RTL &#8211; cssrtl.py</title>
		<link>http://www.guyrutenberg.com/2007/12/28/convert-css-layout-to-rtl-cssrtlpy/</link>
		<comments>http://www.guyrutenberg.com/2007/12/28/convert-css-layout-to-rtl-cssrtlpy/#comments</comments>
		<pubDate>Fri, 28 Dec 2007 08:28:12 +0000</pubDate>
		<dc:creator>Guy</dc:creator>
				<category><![CDATA[Projects]]></category>
		<category><![CDATA[Python]]></category>
		<category><![CDATA[cssrtl.py]]></category>
		<category><![CDATA[RTL]]></category>

		<guid isPermaLink="false">http://www.guyrutenberg.com/2007/12/28/convert-css-layout-to-rtl-cssrtlpy/</guid>
		<description><![CDATA[This is a re-release of a script of mine that helps convert CSS layouts to RTL. I originally released it about a year ago but it was lost when I moved to the new blog. The script, cssrtl.py, utilizes a bunch of regular expressions to translate a given CSS layout to RTL. Download You can [...]]]></description>
			<content:encoded><![CDATA[<p>This is a re-release of a script of mine that helps convert CSS layouts to RTL. I originally released it about a year ago but it was lost when I moved to the new blog. The script, <code>cssrtl.py</code>, utilizes a bunch of regular expressions to translate a given CSS layout to RTL. </p>
<p><span id="more-33"></span></p>
<h4>Download</h4>
<p>You can download the script from here: <a href="/wp-content/uploads/2007/12/cssrtl.tar.gz"><code>cssrtl.py</code></a>.</p>
<h4>Usage</h4>
<p>Using the script is pretty simple. Just pass the name of the script to <code>cssrtl.py</code> and he will automatically translate it for you. </p>
<p>Example:<br />
<code>python cssrt.py main.css</code></p>
<p>You can use the <code>-o</code> flag to specify a different output file instead of overwriting the existing file.</p>
<p>If the CSS style for the body tag is missing a <code>direction</code> statement, you should add the <code>-d</code> flag to the list of command line arguments. This will cause the script to add one for you when translating the layout.</p>
<p>See <code>python cssrtl.py --help</code> for more information.</p>
<h4>Limitations</h4>
<p>While this script is pretty useful as it is, it still isn&#8217;t perfect. The major limitation, is that the script doesn&#8217;t automatically mirrors images used in the layout. So if your layout contains images you will need to flip them manually (however the script will position them in right place by automatically). Another limitation is that the script doesn&#8217;t alway handle correctly scripts with IE hacks, so it always good to keep a backup and manually check the result on IE.</p>
<p>Overall, despite some (minor) limitations, the script is very useful, and it helped me a lot when having to translate CSS layouts to RTL. I&#8217;ve successfully used it to translate WordPress, Joomla, Druple and MediaWiki themes with minimal intervention on my side, thus saving a lot of my time. If you find the script useful, it will be nice of your to send a word. Also the script is released under the GPL so if you have any patches/improvements, please send them.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.guyrutenberg.com/2007/12/28/convert-css-layout-to-rtl-cssrtlpy/feed/</wfw:commentRss>
		<slash:comments>15</slash:comments>
		</item>
	</channel>
</rss>

<!-- Dynamic Page Served (once) in 0.481 seconds -->
