Title: RTL css trigger
Last modified: October 5, 2016

---

# RTL css trigger

 *  Resolved [theyuv](https://wordpress.org/support/users/theyuv/)
 * (@theyuv)
 * [9 years, 8 months ago](https://wordpress.org/support/topic/rtl-css-trigger/)
 * Hello,
 * I am using WPGlobus for English and Hebrew and, in the “Languages” table, I renamed
   the Hebrew locale to “iw” (instead of the default “he_IL).
 * However, if I do this, then my default rtl.css script (in the root directory 
   of my theme) doesn’t get loaded. Whereas, if I leave the locale as “he_IL” then
   the rtl.css script is loaded by default when the language is changed.
 * Is there any way to correct this so that the RTL.css script is also loaded when
   the locale is “iw”?
 * A somewhat related question:
    How come each page’s `html``lang`attribute is populated
   with the “locale” (eg: he-IL) and not the language (eg:he)?
 * Thank you.
    -  This topic was modified 9 years, 8 months ago by [theyuv](https://wordpress.org/support/users/theyuv/).
      Reason: typo
    -  This topic was modified 9 years, 8 months ago by [theyuv](https://wordpress.org/support/users/theyuv/).
      Reason: addition

Viewing 4 replies - 1 through 4 (of 4 total)

 *  Plugin Support [Alex Gor](https://wordpress.org/support/users/alexgff/)
 * (@alexgff)
 * [9 years, 8 months ago](https://wordpress.org/support/topic/rtl-css-trigger/#post-8254643)
 * As for locale
    Just add piece of code to file functions.php of active theme
 *     ```
       add_action( 'wp_print_styles', 'wpglobus__engueue_style' );
       function wpglobus__engueue_style() {
       	if ( WPGlobus::Config()->language == 'he' ) {
       		wp_enqueue_style( 'rtl', get_template_directory_uri() . '/rtl.css', array(), '20161005' );
       	}	
       }
       ```
   
 * where ‘he’ is language code
 *  Plugin Author [Gregory Karpinsky (@tivnet)](https://wordpress.org/support/users/tivnet/)
 * (@tivnet)
 * [9 years, 8 months ago](https://wordpress.org/support/topic/rtl-css-trigger/#post-8254707)
 * Hello [@theyuv](https://wordpress.org/support/users/theyuv/),
 * The `he_IL` is used by WordPress. If you look at the file `he_IL.po` in the `
   wp-content/languages` folder, lines 20-24, that’s how the text direction is set.
   The `rtl.css` is loaded when the text direction is set to `rtl`.
 * Alternatively, `class-wp-locale.php` checks for a global variable:
 *     ```
       		// Set text direction.
       		if ( isset( $GLOBALS['text_direction'] ) )
       			$this->text_direction = $GLOBALS['text_direction'];
       		/* translators: 'rtl' or 'ltr'. This sets the text direction for WordPress. */
       		elseif ( 'rtl' == _x( 'ltr', 'text direction' ) )
       			$this->text_direction = 'rtl';
       ```
   
 * So, if you really need to use the old `iw` globally, instead of the new `he_IL`,
   you will need to do some work.
 * If only in your theme, at the front, then check the theme’s header and modify
   it: both the CSS part and the `html` `lang` part.
 * Hope this helps, because WPGlobus has nothing to do with this. We just set the`
   prefix->locale` connection.
 * Thanks
 *  Thread Starter [theyuv](https://wordpress.org/support/users/theyuv/)
 * (@theyuv)
 * [9 years, 8 months ago](https://wordpress.org/support/topic/rtl-css-trigger/#post-8255797)
 * Thanks a lot guys for your answers.
 * [@tivnet](https://wordpress.org/support/users/tivnet/) Thank you. So WP is responsible
   for placing the entire locale (eg: he-IL) in the lang attribute of the html element?
   
   This is a mistake, no? Shouldn’t there be a language code there?
 * Thanks.
 *  Plugin Author [Gregory Karpinsky (@tivnet)](https://wordpress.org/support/users/tivnet/)
 * (@tivnet)
 * [9 years, 8 months ago](https://wordpress.org/support/topic/rtl-css-trigger/#post-8256863)
 * [@theyuv](https://wordpress.org/support/users/theyuv/)
 * See [https://www.w3.org/International/articles/language-tags/](https://www.w3.org/International/articles/language-tags/)
 * Thanks

Viewing 4 replies - 1 through 4 (of 4 total)

The topic ‘RTL css trigger’ is closed to new replies.

 * ![](https://ps.w.org/wpglobus/assets/icon-256x256.png?rev=1069705)
 * [WPGlobus](https://wordpress.org/plugins/wpglobus/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/wpglobus/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/wpglobus/)
 * [Active Topics](https://wordpress.org/support/plugin/wpglobus/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/wpglobus/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/wpglobus/reviews/)

## Tags

 * [hebrew](https://wordpress.org/support/topic-tag/hebrew/)
 * [rtl.css](https://wordpress.org/support/topic-tag/rtl-css/)

 * 4 replies
 * 3 participants
 * Last reply from: [Gregory Karpinsky (@tivnet)](https://wordpress.org/support/users/tivnet/)
 * Last activity: [9 years, 8 months ago](https://wordpress.org/support/topic/rtl-css-trigger/#post-8256863)
 * Status: resolved