Uploaded image for project: 'Moodle'
  1. Moodle
  2. MDL-65509

Hardcoded language strings in exception dialogues

    XMLWordPrintable

    Details

    • Type: Improvement
    • Status: Closed
    • Priority: Minor
    • Resolution: Fixed
    • Affects Version/s: 3.4.6, 3.5.5, 3.6
    • Fix Version/s: 3.8
    • Component/s: Assignment
    • Labels:
    • Testing Instructions:
      Hide

      Setup

      1. Install the French language pack
      2. Change the language to french from the language menu

      Test

      1. open the JS console
      2. Run the following commands (one after the other)
        1. Y.use('moodle-core-notification');
        2. new M.core.ajaxException({});
      3. Verify that the title of the exception window says "Erreur" and not "Error".
      4. Run the following command in the JS console
        1. new M.core.exception({});
      5. Verify that the exception window contains the word "Fichier" and not "File".
      6. Using a text editor, open the file index.php in the Moodle's root directory and add the following line right after the line that includes config.php:

        throw new moodle_exception('test', '', '', 'test');
        

      7. Visit the Moodle's index page in a browser
      8. Verify that you see an exception and the strings on the page are shown without placeholders (surrounded by brackets)
      9. Remove the line you added
      10. Open course/externallib.php in your preferred editor
      11. Find the get_recent_courses function and add the following line to the top of the function:

        throw new moodle_exception('test', '', '', 'test');
        

      12. Open the Dashboard
        1. Confirm that you see an exception and the strings on the page are shown without placeholders (surrounded by brackets)
      Show
      Setup Install the French language pack Change the language to french from the language menu Test open the JS console Run the following commands (one after the other) Y.use('moodle-core-notification'); new M.core.ajaxException({}); Verify  that the title of the exception window says "Erreur" and not "Error". Run the following command in the JS console new M.core.exception({}); Verify that the exception window contains the word "Fichier" and not "File". Using a text editor, open the file index.php in the Moodle's root directory and add the following line right after the line that includes config.php: throw new moodle_exception('test', '', '', 'test'); Visit the Moodle's index page in a browser Verify that you see an exception and the strings on the page are shown without placeholders (surrounded by brackets) Remove the line you added Open course/externallib.php in your preferred editor Find the get_recent_courses function and add the following line to the top of the function: throw new moodle_exception('test', '', '', 'test'); Open the Dashboard Confirm that you see an exception and the strings on the page are shown without placeholders (surrounded by brackets)
    • Affected Branches:
      MOODLE_34_STABLE, MOODLE_35_STABLE, MOODLE_36_STABLE
    • Fixed Branches:
      MOODLE_38_STABLE
    • Pull from Repository:
    • Pull 3.5 Branch:
    • Pull 3.6 Branch:
    • Pull 3.7 Branch:
    • Pull Master Branch:
      MDL-65509-master
    • Sprint:
      Internationals - 3.8 Sprint 1

      Description

      1- Create assignment

      2- Set any "Accepted file type"

      3- As a student, try submitting a different type of file

      The word "Error" in the message seems harded coded. I tested in French, Deutsch and Spanish.

       

        Attachments

          Activity

            People

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

              Dates

              • Created:
                Updated:
                Resolved:
                Fix Release Date:
                18/Nov/19

                Time Tracking

                Estimated:
                Original Estimate - 0 minutes
                0m
                Remaining:
                Remaining Estimate - 0 minutes
                0m
                Logged:
                Time Spent - 1 day, 37 minutes
                1d 37m