Moodle
  1. Moodle
  2. MDL-9750

Add a CSS class to every page with the current language

    Details

    • Type: Improvement Improvement
    • Status: Closed
    • Priority: Minor 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
    • Rank:
      24559

      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 ...

        Activity

        Hide
        Martin Dougiamas added a comment -

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

        Show
        Martin Dougiamas added a comment - Done. The code looks like lang-$lang eg lang-en_utf8
        Hide
        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
        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
        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
        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: