|Reported by:||ryan||Owned by:||ryan|
Proposal RTL support through loading of locale-specific CSS. Using "fa" as an example locale, here's the gist.
- wp-includes/languages/fa.php contains some locale specific variables. $text_direction specifies the text direction, either 'ltr' or 'rtl'.
- fa.php, if it exists, is loaded into the $wp_locale singleton. The variables defined in fa.php are turned into instance variables of $wp_locale.
- When loading the front page, we check to see if the theme includes fa.css. If so, we load that css after style.css via a 'wp_head' hook.
- If fa.css does not exist and $wp_locale->text_direction is set to rtl and rtl.css is provided by the theme, load rtl.css.
- For the admin, if the text direction is rtl, load rtl.css from wp-admin. We would ship rtl.css as part of WP. It is loaded after wp-admin.css.
Eventually, fa.php could include other locale-specific settings such as the strings to use when constructing permalinks.