Moodle
  1. Moodle
  2. MDL-21230

Add more chances to get correct localized names for custom filters in administration.

    Details

    • Type: Bug Bug
    • Status: Closed
    • Priority: Minor Minor
    • Resolution: Won't Fix
    • Affects Version/s: 1.9.7
    • Fix Version/s: None
    • Component/s: Administration
    • Labels:
      None
    • Affected Branches:
      MOODLE_19_STABLE
    • Rank:
      5744

      Description

      Original code of admin_setting_managefilters::output_html() says this : lib/adminlib.php§4101

      $name = trim(get_string("filtername", $plugin));
      if (empty($name) or ($name == '[[filtername]]'))

      { $textlib = textlib_get_instance(); $name = $textlib->strtotitle($plugin); }

      $plugin is the unprefixed name of the filter plugin.

      while other parts of the code enjoin to get filter strings by the 'filter_' prefixed name.

      So :

      $name = trim(get_string("filtername", $plugin));

      // <<<<<<< ADDED HERE
      if (empty($name) or ($name == '[[filtername]]')) { $name = trim(get_string("filtername", 'filter_'.$plugin)); }
      // <<<<<<< /ADDED HERE

      if (empty($name) or ($name == '[[filtername]]')) { $textlib = textlib_get_instance(); $name = $textlib->strtotitle($plugin); }

      Would add more chances to get correct 'filtername' string localization.

      Cheers.

        Activity

          People

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

            Dates

            • Created:
              Updated:
              Resolved: