Drupal - dynamically Load CSS for specific language

/ Published in: PHP
Save to your folder(s)

Copy this code and paste it in your HTML
  1. /*template.php*/
  3. function mytheme_preprocess_page(&$vars, $hook) {
  4. /*Add language specific css files*/
  5. $lang_css_path = path_to_theme().'/css/style_'.i18n_get_lang().'.css';
  6. drupal_add_css( $lang_css_path, 'theme', 'all', FALSE);
  7. $vars['styles'] = drupal_get_css();
  8. }

Report this snippet


RSS Icon Subscribe to comments

You need to login to post a comment.