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

        Hide
        Petr Škoda added a comment -

        my -1 for this, imo we should instead normalise all plugin names during the big language pack cleanup/refactoring that is planned for 2.0, this would fix tons of other similar problems in all plugins at the same time and forever...

        Show
        Petr Škoda added a comment - my -1 for this, imo we should instead normalise all plugin names during the big language pack cleanup/refactoring that is planned for 2.0, this would fix tons of other similar problems in all plugins at the same time and forever...
        Hide
        Valery Fremaux added a comment -

        Well, in case this big normalization has a chance of having back effects on 1.9, I do not see any trouble to wait for... I will keep this patch local on my codebases...

        Actually my immediate projects of integration are still planning following the 1.9 branch for one or two years ahead... eventually backporting what stuff is necessary from 2.0 to maintain future upgrading possible.

        Cheers.

        Show
        Valery Fremaux added a comment - Well, in case this big normalization has a chance of having back effects on 1.9, I do not see any trouble to wait for... I will keep this patch local on my codebases... Actually my immediate projects of integration are still planning following the 1.9 branch for one or two years ahead... eventually backporting what stuff is necessary from 2.0 to maintain future upgrading possible. Cheers.
        Hide
        Michael de Raadt added a comment -

        Thanks for reporting this issue.

        We have detected that this issue has been inactive for over a year has been recorded as affecting versions that are no longer supported.

        If you believe that this issue is still relevant to current versions (2.1 and beyond), please comment on the issue. Issues left inactive for a further month will be closed.

        Michael d;

        lqjjLKA0p6

        Show
        Michael de Raadt added a comment - Thanks for reporting this issue. We have detected that this issue has been inactive for over a year has been recorded as affecting versions that are no longer supported. If you believe that this issue is still relevant to current versions (2.1 and beyond), please comment on the issue. Issues left inactive for a further month will be closed. Michael d; lqjjLKA0p6
        Hide
        Michael de Raadt added a comment -

        I'm closing this issue as it appears to have become inactive and is probably not relevant to a current supported version. If you are encountering this problem or one similar, please launch a new issue.

        Show
        Michael de Raadt added a comment - I'm closing this issue as it appears to have become inactive and is probably not relevant to a current supported version. If you are encountering this problem or one similar, please launch a new issue.

          People

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

            Dates

            • Created:
              Updated:
              Resolved: