Uploaded image for project: 'Moodle'
  1. Moodle
  2. MDL-9750

Add a CSS class to every page with the current language

    Details

    • Type: Improvement
    • Status: Closed
    • Priority: Minor
    • Resolution: Fixed
    • Affects Version/s: 1.5.4, 1.6.5, 1.7.2, 1.8
    • Fix Version/s: 1.5.4, 1.6.6, 1.7.3, 1.8.1
    • Component/s: Themes
    • Labels:
      None
    • Affected Branches:
      MOODLE_15_STABLE, MOODLE_16_STABLE, MOODLE_17_STABLE, MOODLE_18_STABLE
    • Fixed Branches:
      MOODLE_15_STABLE, MOODLE_16_STABLE, MOODLE_17_STABLE, MOODLE_18_STABLE

      Description

      Add a CSS class to every page with the current language means that people can do CSS tweaks based on language.

      Backporting this to everything after 1.5.x ...

        Gliffy Diagrams

          Activity

          Hide
          dougiamas Martin Dougiamas added a comment -

          Done. The code looks like lang-$lang eg lang-en_utf8

          Show
          dougiamas Martin Dougiamas added a comment - Done. The code looks like lang-$lang eg lang-en_utf8
          Hide
          urshunkler Urs Hunkler added a comment -

          Looks like we now have two ways to use language specific CSS. One draback is, that some browsers get confused by underscores in CSS. By the way I never noticed this issue.

          In config.php we have:

          $THEME->langsheets = false;

          /// By setting this to true, then this theme will search for
          /// a file named "styles.php" inside the current language
          /// directory. This allows different languages to provide
          /// different styles.

          Show
          urshunkler Urs Hunkler added a comment - Looks like we now have two ways to use language specific CSS. One draback is, that some browsers get confused by underscores in CSS. By the way I never noticed this issue. In config.php we have: $THEME->langsheets = false; /// By setting this to true, then this theme will search for /// a file named "styles.php" inside the current language /// directory. This allows different languages to provide /// different styles.
          Hide
          dougiamas Martin Dougiamas added a comment - - edited

          Yes, there's two methods now.

          I needed it this way to do some very specific RTL tweaks on a Hebrew client of mine and didn't want to change the language packs.

          I thought it couldn't hurt to have it everywhere. Are underscores actually forbidden in class names? If so I can remove them.

          Show
          dougiamas Martin Dougiamas added a comment - - edited Yes, there's two methods now. I needed it this way to do some very specific RTL tweaks on a Hebrew client of mine and didn't want to change the language packs. I thought it couldn't hurt to have it everywhere. Are underscores actually forbidden in class names? If so I can remove them.

            People

            • Votes:
              0 Vote for this issue
              Watchers:
              0 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved:
                Fix Release Date:
                30/May/06