Moodle
  1. Moodle
  2. MDL-21346

print_password_policy() does not play with non-English languages nicely, breaks coding guidelines and its implementation into mform is just wrong

    Details

    • Type: Bug Bug
    • Status: Closed
    • Priority: Major Major
    • Resolution: Fixed
    • Affects Version/s: 1.9.7
    • Fix Version/s: None
    • Component/s: Language
    • Labels:
      None
    • Affected Branches:
      MOODLE_19_STABLE

      Description

      Rossie, print_password_policy() is a typical example how strings should not be handled. We must not compose sentences in Moodle PHP code even they look like a proper English sentence. The form may not fit other languages. Unfortunately, our current get_string() implementation still lacks a possibility to define complex language logic like this case (it est a list of password policy rules).

      I am going to remove the ", and" at the end at least and will add this example as an use case for the new get_string() features.

        Gliffy Diagrams

          Issue Links

            Activity

            Hide
            David Mudrak added a comment -

            Adding Rossiani as a watcher

            Show
            David Mudrak added a comment - Adding Rossiani as a watcher
            Hide
            David Mudrak added a comment -

            (btw, the function implementation in Moodle 1.9 breaks coding guidelines at every single line...)

            Show
            David Mudrak added a comment - (btw, the function implementation in Moodle 1.9 breaks coding guidelines at every single line...)
            Hide
            David Mudrak added a comment -

            (btw, returning a string with hardcoded <div> elements that just fits into the current mforms is wrong - the function should return the plain sentence and the rest should be done by the caller. Using 'html' mform element for this thing is not nice at all)

            Show
            David Mudrak added a comment - (btw, returning a string with hardcoded <div> elements that just fits into the current mforms is wrong - the function should return the plain sentence and the rest should be done by the caller. Using 'html' mform element for this thing is not nice at all)
            Hide
            David Mudrak added a comment -

            Fixed in CVS

            Show
            David Mudrak added a comment - Fixed in CVS

              People

              • Assignee:
                David Mudrak
                Reporter:
                David Mudrak
                Tester:
                Nobody
                Participants:
              • Votes:
                0 Vote for this issue
                Watchers:
                1 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: