Modifying Language Strings

You may from time to time modify language strings that appear in your learning environment to adapt it to terminology that you use at your organization. For example, while the learning environment uses the concept of "programs", perhaps your organization prefers to call them "learning plans" or simply "bundles of courses".

As an administrator, you have to ability to customize every string that appears in the learning environment. To customize any language strings, you need to follow two procedures. The first procedure allows you to identify which language string you want to modify, and the second procedure allows you to modify it.

Identify the Language String

The learning environment literally contains thousands of language strings. Finding where a particular string is saved can be difficult sometimes. If you plan on modifying strings, ask Dual Code to turn on a debugging function called "Show origin of language strings". This function is disabled by default for performance reasons, but Dual Code can temporarily enable it for you to help you identify the source of language strings.

Once this debugging function is enabled, you can append "?strings=1" (or "&strings=1" if there is already a parameter) to the end of the page URL. For example:

http://[yoururl]/local/program/progressreport.php?strings=1

By appending strings=1, beside each string will be shown something like "{report_progress/local_program}". The first part, before the /, is the string identifier. In this case, the string identifier is "report_progress". The last part says which php file uses the string, so this one is in "local_program.php". If there is nothing after the /, you can assume that the string is in the moodle.php file.

Modifying the Language String

Now that you know how to determine where the string you want to modify is saved, you can follow the procedure below to actually modify this string.

  1. Go to Site administration > Language> Language customization.

  2. Pick the language to customize from the pull down list, usually English or French.

  3. Click the "Open language pack for editing" button. This may take time to process, but should not take more than 30 seconds.

  4. In the "Show strings of these components" multi-select menu, select the php file(s) that contains the strings you need to modify. Using the example above, you should select the "local_program.php", which is near the very bottom of the list.

  5. After selecting the file(s), enter a value in the "String identifier" field. Using the example above, you should enter "report_progress". (You can use the "string must contain" and other filters if you prefer, but specifying the string identifier is usually the most accurate way of finding the correct string.)  Tip: You can use CTRL+A in the multi-select to select all files. 

  6. Click on the "Show strings" button to find the string you are trying to modify.

If you followed the instructions above, you should now see the following screen. (You can click on the image below to enlarge it.)



If, instead of seeing the string you were searching, you see a message stating "No strings found, please modify the filter settings", it means you did not select the right php file, or the right string identifier. Please try again. If the problem persists, please contact Dual Code for help.

To continue modifying the string:

  1. Enter the value you would like in the empty text area. For example, if you would like to rename the "Progress Report" to "Learning Plan", you would enter "Learning Plan for {$a->fullname}". (In this example, {$a->fullname} is a variable that will be substituted with the user's full name.)

  2. Click "Save changes and continue editing" if you want to pick another filter or PHP file(s) to edit, OR

  3. Click "Save and check in string into files" to save all changes you have made.

Once the procedure above is complete, if you go back to http://[yoururl]/local/program/progressreport.php, you will notice that the name for the report is now "Learning Plan".

Modifying the Site Administration Block

The Site Administration block gets loaded in a special way. As such, it doesn't display the string identifier next to each menu option. If you want to find out the string identifier for items listed in the Site Administration block, you must go to a specific web page located at /admin/index.php and once there, add ?strings=1&cache=1

https://[yoururl].dualcode.com/admin/index.php?strings=1&cache=1