Uploaded image for project: '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
    • Status: Closed
    • Priority: 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

          Attachments

            Issue Links

              Activity

              Hide
              mudrd8mz David Mudrák added a comment -

              Adding Rossiani as a watcher

              Show
              mudrd8mz David Mudrák added a comment - Adding Rossiani as a watcher
              Hide
              mudrd8mz David Mudrák added a comment -

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

              Show
              mudrd8mz David Mudrák added a comment - (btw, the function implementation in Moodle 1.9 breaks coding guidelines at every single line...)
              Hide
              mudrd8mz David Mudrák 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
              mudrd8mz David Mudrák 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
              mudrd8mz David Mudrák added a comment -

              Fixed in CVS

              Show
              mudrd8mz David Mudrák added a comment - Fixed in CVS

                People

                • Assignee:
                  mudrd8mz David Mudrák
                  Reporter:
                  mudrd8mz David Mudrák
                  Tester:
                  Nobody
                  Participants:
                • Votes:
                  0 Vote for this issue
                  Watchers:
                  1 Start watching this issue

                  Dates

                  • Created:
                    Updated:
                    Resolved: