Book Image

Moodle 1.9 Top Extensions Cookbook

Book Image

Moodle 1.9 Top Extensions Cookbook

Overview of this book

Moodle is growing at a seemingly unstoppable rate. One of the key reasons for its popularity lies in its potential to extend with modules, thus making the site easier to administer, add new features, and completely change the way it looks. This book finds you the best Moodle modules, teaches you how to install them, and helps you to master their configuration.There are hundreds of Moodle modules available. Find out which you can trust and how to put them to work. This practical book gives you hands-on experience on using and managing Moodle modules, thus making your learning website feature-rich. It covers many features and techniques in order to allow you to organize your ideas to improve teaching using Moodle as a virtual learning platformThis book begins with simple activities such as adding and installing modules. Then, it moves to a very interesting topic about the integration of multimedia into Moodle, covering major multimedia elements such as images, audio, and video. Social networking applications like Twitter and Facebook are embedded in the Moodle course in order to invent stories, create group works, and create social team interactions with the virtual classroom. But the book doesn't end there, you will also see how to use Moodle to accept and assess coursework submissions, discuss work with students, and deliver quizzes, tests, and videos.The book ends with a chapter full of simple challenges such as adding educational games. This book is written to help you find modules that will be useful to you and your students, and to show examples of how these modules can be setup and used in teaching.
Table of Contents (17 chapters)
Moodle 1.9 Top Extensions Cookbook
Credits
About the Author
About the Reviewers
Preface
Index

Getting modules to speak your language


Another feature of Moodle is its capacity for internationalization. This means that the same software can be used by people speaking different languages. While translations for over 80 languages are available for the core functionality of Moodle, most modules only offer translations for a smaller number of languages, and the language you are teaching in may not be one of them.

Adding a translation for a module is simple to do. If you give your translation to the author of the module, your efforts could also benefit others who speak your language.

Getting ready

It is assumed that you have set the default language for your site. If not, there is more information about adding a language pack and setting the language for your site later.

In order to create a translation for a module, you don't need any real programming experience; it's actually quite simple. Some understanding of HTML tags can be an advantage.

You will need a text editor that can create and edit Unicode files. Word processors are not appropriate for this task, and a simple editor, such as Windows Notepad, is not up to the job. There are many free editors available that will allow you to create and edit Unicode files. One example available for Windows is Notepad++, which is a free editor and is also available as a portable application.

The steps that follow provide an example that assumes the Progress Bar block has been installed.

How to do it...

Where the module was installed, there will usually be a /lang folder. For the Progress Bar block this is located at moodle/blocks/progress/lang. Within this folder, there are folders for different languages, most of them contributed by users around the world.

If you are reading this, it is assumed you have an understanding of English, so have a look inside the en_utf8/ folder. You will see a file called block_progress.php and another directory called help/. The block_progress.php file contains strings of text used in the module, each with a code and the string displayed on screen. Open this file in your editor to see the contents.

Inside the lang/help/progress/ directory there are a number of HTML files, each relating to a help topic. These appear when a help icon (usually appearing as a question mark) is clicked. Opening these files in your web browser will show you the rendered version of these files and opening them in your editor will show you the HTML source of the documents.

To add a new language, you first need to find out the two letter code for your language. To see the list of supported languages visit the following site. You will also see the code letters for each language, and you need to follow the same code. Refer to http://download.moodle.org/lang16/.

Return to the lang/ folder. For the Progress Bar block this is at moodle/blocks/progress/lang/. Assuming that you know English as a second language, copy the en_utf8/ folder and all of its content. Rename the folder with the two letter code for your language, for example, the folder for Afrikaans would be af_utf8/. Be sure to preserve the filenames and folder names within (they do not need translation, only the contents).

Open the block_progress.php file in your Unicode editor. You need to translate the string on the right of the = symbol, within the quotes. Do not translate the code value for the string on the left. You may need to see the string in use to get a sense of what the string is intended for, in order to make an accurate translation. If you include any apostrophes within the string, escape the quote with a slash, as shown in the following example, otherwise the string will be seen as coming to an end earlier than it should.

$string['owners'] = 'Owner\'s';

If there is code within the strings, or HTML tags, that you are unsure about, leave these and just translate any text around them.

You can also translate the HTML files in moodle/blocks/progress/lang/help/progress/ to produce help files in your language. Open these in your editor and translate the text within the files. Again, avoid changing any HTML or code you don't understand. Some help files also include PHP code segments within<?php and ?> tags, avoid changing this content.

Be sure to test your translated files. If, after changing a translation file, nothing appears on the course page, it may be that you have inadvertently created an error. Typically this comes from mismatched quotes around strings. Be sure each starting quote is matched with a closing quote, and any enclosed quotes are escaped. Test that your translated text items are appearing correctly and have an appropriate meaning in your language. Once created, you can use this translation throughout your site.

The final step is to send your translation to the author of the module. You should be able to find their contact details on the Moodle Modules and plugins database entry page for the module. If you have translated the language strings but not translated the help files, this is still a helpful contribution that can be shared. Zip up the files you have translated and e-mail them to the author who will usually be more than happy to include your contribution within the module for future downloaders.

How it works...

Each time the module is loaded, its code is interpreted by the web server and HTML is produced to form the part of the page where the module will appear. Within the code, instead of writing text strings in the author's language, there are calls to functions that check the language and draw the appropriate strings from the language files. This way, all that is needed to change from one language to another is a different language file.

There's more...

If you want to use another language throughout your Moodle site, the following sections are a basic guide for installing and selecting the language.

Adding a language pack

Visit the following site to find if a language pack is available for your language: http://download.moodle.org/lang16/.

If your language is available, download the appropriate zip file and extract its contents to the directory moodle/lang/. If your language is Afrikaans, for example, the language files should be contained in moodle/lang/af_utf8/. Ensure you do not introduce additional unnecessary directory levels.

Selecting a language for your site and courses

A language can be set as a default for courses on the site. This can be overridden at the course level if desired, or by students individually.

To set the default language, log in as administrator and go to the site root page. On the Site Administration menu, select Language, then Language Settings. The default language can be set on the page that appears.

Individual users can set a preferred language in their profile settings.

For individual courses a language can be set. This will "force" students to use that particular language rather than their preferred language.

See also

  • If it's not quite what you want...