Moodle translation guide (2024)

Translating Moodle is not that difficult, but a few things are good to know before you start.

Structure of a Moodle language pack

All Moodle language packs are located inthe lang directory, with each language in a unique directory named thesame as the language short name (en, fr, nl, es ...).

All the main files are in thisfolder, with .php extensions (eg moodle.php, resource.php etc).These files contains short phrases, often called "strings".

There might also be some folders containing .html web pages:

  • help: containing the context-sensitive help files that pop-up when you click the help icons throughout Moodle
  • docs: containing the basic documentation pages (such as this one!)

Creating a completely new language pack

If your language is not yet supported byMoodle, or if you just want to make some customisations to your ownsite's interface, you may want to start a new translation.

All you need to do is create a new folderin the lang directory using the 2-letter code for your language. Youcan find these standard codes in lib/languages.php. If you are making alocal variation of another language use the code of that language withan underscore and a meaningful two letter extension (e.g. pt for Portuguese and pt_br for Brasilian variation of the Portuguese language pack). If you are making a Unicode version add _utf8 at the end (eg sr_utf8).

Next, create in your new language folder the file "moodle.php", containing the folowing lines:

<?PHP
$string['thischarset'] = 'iso-8859-1';
$string['thisdirection'] = 'ltr';
$string['thislanguage'] = 'new language pack';
?>

or copy the moodle.php from anotherlanguage into your new directory. The one from the "en" folder isusually best but it doesn't really matter as you are going to rewriteit anyway. Creating moodle.php yourself has the advantage of starting with a completely clean and empty language pack.

You are now ready to start inserting new strings by editing your language... see below for details on this.

For a new language pack, the very firstthing you need to edit is the string named "thischarset" in moodle.php.It must contain a valid web character set for your language. After youchange that string, save the moodle.php file, then reload the page. You can then continue with the rest of the strings.

Editing an existing language pack

Making small customisations

If you just want to change a few things in the interface to suit your own site better, don't start editing one of the standard language packs. If you do then your changes will be overwritten next time you upgrade to a new Moodle.

Instead, use the instructions above formaking a brand new language pack, and set the parent language (inmoodle.php) to be the language that is most similar to yours. Forexample, a good name for a local english version would be "en_local", and the parent language would be "en" or "en_us".

Note that for everyone on your site tosee this new pack you have to select it as the site language andrestrict the available languages on Admin >> Configuration >> Variables.

Translating the Moodle interface language files (the "string" files)

  1. Log on to your Moodle server as an administrator.
  2. Go to Administration >> Configuration >> Language, which is the language administration page.
  3. On this page you can choose your language from the menu, then choose "Compare and Edit Language".
  4. You should see forms you can edit for each file. If you do not,then you may have to make sure that the files are writeable - you mayhave to change file permissions.
  5. The forms consist of three columns, the first is the name ofeach string, the second is that string in English, and the last istranslation in the current language.
  6. Edit missing strings in each files (highlighted in colour),remembering to hit the "Save changes" button at the end of each form.
  7. It's OK to leave strings empty - Moodle will simply use theparent language for that string instead. You can define the parentlanguage in moodle.php, otherwise English is always used by default.
  8. A quick way to see all the missing strings is by using the button to "Check for missing strings". Leave the untranslated strings completely empty or this handy tool won't work.

Translating the help and documentation files

There's no built-in editor in Moodle yet to translatethe help files, but it's really not that difficult. It is important touse the en language pack as a reference language. Copy a help file fromthe en language pack and paste it on the same location in your ownlanguage pack. Then use a plain text editor to translate the file,making sure not to modify any code in the file (there usually is nocode, just HTML-tags). (DON'T USE A WORDPROCESSOR to write thehelp-files because these programs add too much rubbish to the files).
Don't leave untranslated help files in your language pack.

Take care to write the helpfiles XHTML-compliant. This means in short:

  • All tags should be closed: <p>lalala</p>
  • All elements should be nested: <p> lalala <em>lalala</em> </p>
  • All elements and attributes must be lower case
  • All atributes should be written in full and with quotes : <p align="right"> lalala </p>
  • Empty elements must end with />: <br /> <hr />. You should add an extra space before the "/" symbol.
  • An <img should have an alt="" (it can be empty) en must be closed like other empty elements with a space and /> like <img alt="" src="picture.gif" />
  • <?= and <? should be <?php
  • There should not be ANY font tags at all. <p><em> <h1> <h2> etc should be enough for the language files ...
  • The language name in the languagepack ($string['thislanguage'] in moodle.php) should generally use Unicode Numeric Character References (NCR) if possible, because this allows the name to work within ANY encoding context (see the Chinese pack for example).

None of the files in the help folder need a doc type, html, body, head opening and closing tags - these files are included with help.php. The script will take care of welforming the pages. This means also there is not much room for HTML creativity! Please stick to the English example.

The files in the docs folder must be completely XHTML compliant, including doc type, header etc.

Clicking on "Check for missing strings"in the language administration screen will also show you what files youare missing. If you have missing files then Moodle will use the parentlanguage instead, so don't leave copies of untranslated help files in your language pack or this handy tool won't work.

Submitting your language pack to the Moodle project

Sharing your translation with Moodle willensure that you help other people who speak your language.Your interface language will be available in future versions of Moodle.

Simply archive your whole new language directory as a zip file and email it to [email protected].

We will get back to you with further details.

Checklist you can use before committing::

  • No empty files?
  • No untranslated files or strings?
  • Help files not edited with a wordprocessor?
  • README file contains language, name and emailadress of the translator?
  • Foldername is the right language code (check moodle\lib\languages.php)?
  • Does the language pack run errorfree on a testsite?
  • When "thislanguage" contains other then latin letters, is it written in NCR notation?
  • Are the strings and files XHTML compliant?

Maintenance of a standard language pack

If you are committed to maintaining a language in Moodle, it's best to use Moodle CVS so that you have an up-to-date version of Moodle, and can easily "check in" your changes directly into the Moodle project. Contact [email protected] if you need help setting this up.

You must also subscribe to the Languages Forum for news and discussion about issues that affect translations.

Finally, to keep in touch with changes in the project on a day-to-day basis it is a very good idea to subscribe to the CVS mailing list. This helps to keep yourtranslation as close to the English text as possible.

Moodle Documentation

Version: $Id: translation.html,v 1.1 2006/02/06 09:28:54 moodler Exp $

Moodle translation guide (2024)
Top Articles
How Much Tax Do I Have to Pay on Rental Income?
Taxes in Retirement: How All 50 States Tax Retirees
417-990-0201
Jennifer Hart Facebook
J & D E-Gitarre 905 HSS Bat Mark Goth Black bei uns günstig einkaufen
His Lost Lycan Luna Chapter 5
Boomerang Media Group: Quality Media Solutions
Math Playground Protractor
P2P4U Net Soccer
Red Wing Care Guide | Fat Buddha Store
Teamexpress Login
Autozone Locations Near Me
Best Cav Commanders Rok
Summoners War Update Notes
Worcester On Craigslist
Las 12 mejores subastas de carros en Los Ángeles, California - Gossip Vehiculos
H12 Weidian
Mahpeople Com Login
Pokemon Unbound Shiny Stone Location
Johnnie Walker Double Black Costco
Laveen Modern Dentistry And Orthodontics Laveen Village Az
Www.publicsurplus.com Motor Pool
E32 Ultipro Desktop Version
3569 Vineyard Ave NE, Grand Rapids, MI 49525 - MLS 24048144 - Coldwell Banker
Nk 1399
Villano Antillano Desnuda
O'reilly's In Mathis Texas
Cal State Fullerton Titan Online
Motorcycle Blue Book Value Honda
Leben in Japan &#8211; das muss man wissen - Lernen Sie Sprachen online bei italki
Craftybase Coupon
Http://N14.Ultipro.com
Ljw Obits
Space Marine 2 Error Code 4: Connection Lost [Solved]
Google Chrome-webbrowser
Labyrinth enchantment | PoE Wiki
Traumasoft Butler
Stranahan Theater Dress Code
Paul Shelesh
Poe Self Chill
St Vrain Schoology
Tlc Africa Deaths 2021
Is Chanel West Coast Pregnant Due Date
The top 10 takeaways from the Harris-Trump presidential debate
Tìm x , y , z :a, \(\frac{x+z+1}{x}=\frac{z+x+2}{y}=\frac{x+y-3}{z}=\)\(\frac{1}{x+y+z}\)b, 10x = 6y và \(2x^2\)\(-\) \(...
18443168434
How To Win The Race In Sneaky Sasquatch
Strange World Showtimes Near Century Federal Way
Latest Posts
Article information

Author: Prof. Nancy Dach

Last Updated:

Views: 6325

Rating: 4.7 / 5 (57 voted)

Reviews: 80% of readers found this page helpful

Author information

Name: Prof. Nancy Dach

Birthday: 1993-08-23

Address: 569 Waelchi Ports, South Blainebury, LA 11589

Phone: +9958996486049

Job: Sales Manager

Hobby: Web surfing, Scuba diving, Mountaineering, Writing, Sailing, Dance, Blacksmithing

Introduction: My name is Prof. Nancy Dach, I am a lively, joyous, courageous, lovely, tender, charming, open person who loves writing and wants to share my knowledge and understanding with you.