3 _Flips CSS from LTR to an RTL orienation and vice-versa_
5 Author: `Lindsey Simon <elsigh@google.com>`
9 CSSJanus is CSS parser utility designed to aid the conversion of a website's
10 layout from left-to-right(LTR) to right-to-left(RTL). The script was born out of
11 a need to convert CSS for RTL languages when tables are not being used for layout (since tables will automatically reorder TD's in RTL).
12 CSSJanus will change most of the obvious CSS property names and their values as
13 well as some not-so-obvious ones (cursor, background-position %, etc...).
14 The script is designed to offer flexibility to account for cases when you do
15 not want to change certain rules which exist to account for bidirectional text
16 display bugs, as well as situations where you may or may not want to flip annotations inside of the background url string.
17 Note that you can disable CSSJanus from running on an entire class or any
18 rule within a class by prepending a /* @noflip */ comment before the rule(s)
19 you want CSSJanus to ignore.
21 CSSJanus itself is not always enough to make a website that works in a LTR
22 language context work in a RTL language all the way, but it is a start.
28 http://cssjanus.googlecode.com/svn/trunk/
30 Check out the latest development version anonymously with:
33 $ svn checkout http://cssjanus.googlecode.com/svn/trunk/ cssjanus
39 ./cssjanus.py < file.css > file-rtl.css
41 --swap_left_right_in_url: Fixes "left"/"right" string within urls.
42 Ex: ./cssjanus.py --swap_left_right_in_url < file.css > file_rtl.css
43 --swap_ltr_rtl_in_url: Fixes "ltr"/"rtl" string within urls.
44 Ex: ./cssjanus.py --swap_ltr_rtl_in_url < file.css > file_rtl.css
46 If you'd like to make use of the webapp version of cssjanus, you'll need to
47 download the Google App Engine SDK
48 http://code.google.com/appengine/downloads.html
49 and also drop a "django" directory into this directory, with the latest svn
50 from django. You should be good to go with that setup. Please let me know
55 Patches and bug reports are welcome, just please keep the style
56 consistent with the original source. If you find a bug, please include a diff
57 of cssjanus_test.py with the bug included as a new unit test which fails. It
58 will make understanding and fixing the bug easier.
62 * Include some helpers for some typical bidi text solutions?
63 * Aural CSS (azimuth) swapping?
67 Additional thanks to Mike Samuel for his work on csslex.py, Andy Perelson for
68 his help coding and reviewing, Stephen Zabel for his help with i18n and my sanity,
69 and to Eric Meyer for his thoughtful input.
70 Thanks to Junyu Wang for the Chinese translation.
71 Thanks to Masashi Kawashima for the Japanese translation.
72 Thanks to Taaryk Taar and Tariq Al-Omaireeni for an updated Arabic translation.
73 Thanks to Jens Meiert for the German translation.
78 Copyright 2008 Google Inc. All Rights Reserved.
80 Licensed under the Apache License, Version 2.0 (the 'License');
81 you may not use this file except in compliance with the License.
82 You may obtain a copy of the License at
84 http://www.apache.org/licenses/LICENSE-2.0
86 Unless required by applicable law or agreed to in writing, software
87 distributed under the License is distributed on an 'AS IS' BASIS,
88 WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
89 See the License for the specific language governing permissions and
90 limitations under the License.