~ubuntu-branches/ubuntu/jaunty/moodle/jaunty

« back to all changes in this revision

Viewing changes to lang/en_utf8/docs/translation.html

  • Committer: Bazaar Package Importer
  • Author(s): Jordan Mantha, Matt Oquist
  • Date: 2009-02-25 15:16:22 UTC
  • mfrom: (1.1.11 upstream)
  • Revision ID: james.westby@ubuntu.com-20090225151622-0ekt1liwhv2obfza
Tags: 1.9.4.dfsg-0ubuntu1
* Merge with Debian git (Closes LP: #322961, #239481, #334611):
  - use Ubuntu's smarty lib directory for linking
  - use internal yui library 
  - add update-notifier support back in

[Matt Oquist]
  * renamed prerm script
  * significantly rewrote postinst and other maintainer scripts to improve
    user experience and package maintainability
    (Closes LP: #225662, #325450, #327843, #303078, #234609)

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
2
 
    "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
3
 
<html xmlns="http://www.w3.org/1999/xhtml">
4
 
<head>
5
 
  <title>Moodle translation guide</title>
6
 
  <link rel="stylesheet" href="docstyles.css" type="TEXT/CSS" />
7
 
  <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
8
 
</head>
9
 
 
10
 
<body>
11
 
 
12
 
<h1>Moodle Translation Guide</h1>
13
 
 
14
 
<p>Translating Moodle is not that difficult, but a few things are good to know before you start.</p>
15
 
 
16
 
<p>&nbsp;</p>
17
 
 
18
 
<h2>Structure of a Moodle language pack</h2>
19
 
 
20
 
<p style="margin-left: 40px;">All Moodle language packs are located in
21
 
the lang directory, with each language in a unique directory named the
22
 
same as the language short name (en, fr, nl, es ...). </p>
23
 
 
24
 
 
25
 
<p style="margin-left: 40px;">All the main files are in this
26
 
folder, with .php extensions (eg moodle.php, resource.php etc).&nbsp;
27
 
These files contains short phrases, often called "<span style="font-style: italic;">strings</span>". 
28
 
</p>
29
 
 
30
 
 
31
 
<p style="margin-left: 40px;">There might also be  some folders containing .html web pages:
32
 
</p>
33
 
 
34
 
 
35
 
<ul style="margin-left: 40px;">
36
 
 
37
 
 
38
 
<li><strong>help</strong>: containing the context-sensitive help files that pop-up when you click the help icons throughout Moodle 
39
 
</li><li><strong>docs</strong>: containing the basic documentation pages (such as this one!)<br />
40
 
</li>
41
 
</ul>
42
 
 
43
 
 
44
 
 
45
 
<p>&nbsp;</p>
46
 
 
47
 
 
48
 
 
49
 
<h2>Creating a completely new language pack</h2>
50
 
 
51
 
 
52
 
 
53
 
 
54
 
<p style="margin-left: 40px;">If your language is not yet supported by
55
 
Moodle, or if you just want to make some customisations to your own
56
 
site's interface, you may want to start a new translation. </p>
57
 
 
58
 
 
59
 
 
60
 
<p style="margin-left: 40px;">All you need to do is create a new folder
61
 
in the lang directory using the 2-letter code for your language. You
62
 
can find these standard codes in lib/languages.php. If you are making a
63
 
local variation of another language use the code of that language with
64
 
an underscore and a meaningful two letter extension (e.g. <span style="font-style: italic;">pt </span>for Portuguese and <span style="font-style: italic;">pt_br</span> for Brasilian variation of the Portuguese language pack).&nbsp; If you are making a Unicode version add <span style="font-weight: bold;">_utf8</span> at the end (eg <span style="font-style: italic;">sr_utf8</span>).<br />
65
 
</p>
66
 
 
67
 
 
68
 
 
69
 
<p style="margin-left: 40px;">Next, create in your new language folder the file &quot;moodle.php&quot;, containing the folowing lines:<br /><br />
70
 
<code>
71
 
&lt;?PHP <br />
72
 
$string['thischarset'] = 'iso-8859-1';<br />
73
 
$string['thisdirection'] = 'ltr';<br />
74
 
$string['thislanguage'] = 'new language pack';<br />
75
 
?>
76
 
</code>
77
 
<br /><br />
78
 
or copy the moodle.php from another
79
 
language into your new directory.&nbsp; The one from the "en" folder is
80
 
usually best but it doesn't really matter as you are going to rewrite
81
 
it anyway. Creating moodle.php yourself has the advantage of starting with a completely clean and empty language pack.<br />
82
 
</p>
83
 
 
84
 
 
85
 
 
86
 
 
87
 
<p style="margin-left: 40px;">You are now ready to start inserting new strings by editing your language... see below for details on this.</p>
88
 
 
89
 
 
90
 
 
91
 
<p style="margin-left: 40px;">For a new language pack, the very first
92
 
thing you need to edit is the string named "thischarset" in moodle.php.
93
 
It must contain a valid web character set for your language. After you
94
 
change that string, save the moodle.php file, then <span style="font-weight: bold;">reload the page</span>. You can then continue with the rest of the strings. </p>
95
 
 
96
 
 
97
 
 
98
 
<p>&nbsp;</p>
99
 
 
100
 
 
101
 
 
102
 
<h2>Editing an existing language pack</h2>
103
 
 
104
 
 
105
 
 
106
 
 
107
 
<h3 style="margin-left: 40px;">Making small customisations<br />
108
 
</h3>
109
 
 
110
 
 
111
 
 
112
 
<p style="margin-left: 80px;">If you just want to change a few things in the interface to suit your own site better, <span style="font-weight: bold;">don't start editing one of the standard language packs</span>.&nbsp; If you do then your changes will be overwritten next time you upgrade to a new Moodle.<br />
113
 
</p>
114
 
<p style="margin-left: 80px;">Instead, use the instructions above for
115
 
making a brand new language pack, and set the parent language (in
116
 
moodle.php) to be the language that is most similar to yours.&nbsp; For
117
 
example, a good name for a local english version would be "<span style="font-style: italic;">en_local</span>", and the parent language would be "<span style="font-style: italic;">en</span>" or "<span style="font-style: italic;">en_us</span>".</p>
118
 
<p style="margin-left: 80px;">Note that for everyone on your site to
119
 
see this new pack you have to select it as the site language and
120
 
restrict the available languages on <span style="font-weight: bold;">Admin &gt;&gt; Configuration &gt;&gt; Variables</span>.<br />
121
 
<br />
122
 
</p>
123
 
 
124
 
 
125
 
 
126
 
 
127
 
<h3 style="margin-left: 40px;">Translating the Moodle interface language files (the "string" files)<br />
128
 
</h3>
129
 
 
130
 
 
131
 
 
132
 
 
133
 
  
134
 
  <ol  style="margin-left: 80px;">
135
 
    <li>Log on to your Moodle server as an administrator. </li>
136
 
    <li>Go to <span style="font-weight: bold;">Administration &gt;&gt; Configuration &gt;&gt; Language</span>, which is the language administration page. </li>
137
 
    <li>On this page you can choose your language from the  menu, then choose "Compare and Edit Language".</li>
138
 
    <li>You should see forms you can edit for each file. If you do not,
139
 
then you may have to make sure that the files are writeable - you may
140
 
have to change file permissions.</li>
141
 
    <li>The forms consist of three columns, the first is the name of
142
 
each string, the second is that string in English, and the last is
143
 
translation in the current language. </li>
144
 
    <li>Edit missing strings in each files (highlighted in colour),
145
 
remembering to hit the "Save changes" button at the end of each form.</li>
146
 
    <li>It's OK to leave strings empty - Moodle will simply use the
147
 
parent language for that string instead. You can define the parent
148
 
language in moodle.php, otherwise English is always used by default. </li>
149
 
    <li>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.<br />
150
 
      <br />
151
 
    </li>
152
 
 
153
 
    
154
 
    
155
 
    
156
 
    
157
 
    
158
 
 
159
 
</ol>
160
 
 
161
 
 
162
 
<h3 style="margin-left: 40px;">Translating the help and documentation files</h3>
163
 
 
164
 
 
165
 
 
166
 
<p style="margin-left: 80px;">There's no built-in editor in Moodle yet to translate
167
 
the help files, but it's really not that difficult. It is important to
168
 
use the <span style="font-weight: bold;">en</span> language pack as a reference language. Copy a help file from
169
 
the en language pack and paste it on the same location in your own
170
 
language pack. Then use a plain text editor to translate the file,
171
 
making sure not to modify any code in the file (there usually is no
172
 
code, just HTML-tags). (DON'T USE A WORDPROCESSOR to write the
173
 
help-files because these programs add too much rubbish to the files).
174
 
<br /><b>Don't leave untranslated help files in your language pack.</b></p>
175
 
 
176
 
<p style="margin-left: 80px;">Take care to write the helpfiles XHTML-compliant. This means in short:</p>
177
 
<ul style="margin-left: 80px;">
178
 
  <li>All tags should be closed: <span style="color:rgb(255, 0, 0);" >&lt;p&gt;</span>lalala<span style="color:rgb(255, 0, 0);" >&lt;/p&gt;</span></li>
179
 
  <li>All elements should be nested: <span style="color:rgb(255, 0, 0);" >&lt;p&gt;</span> lalala <span style="color:rgb(0, 0, 255);" >&lt;em&gt;</span>lalala<span style="color:rgb(0, 0, 255);" >&lt;/em&gt;</span> <span style="color:rgb(255, 0, 0);" >&lt;/p&gt;</span></li>
180
 
  <li>All elements and attributes must be lower case</li>
181
 
  <li>All atributes should be written in full and with quotes : <span style="color:rgb(255, 0, 0);" >&lt;p align=&quot;right&quot;&gt;</span> lalala &lt;/p&gt;</li>
182
 
  <li>Empty elements must end with /&gt;: <span style="color:rgb(255, 0, 0);" >&lt;br /&gt; &lt;hr /&gt;</span>. You should add an extra space before the "/" symbol.</li>
183
 
  <li>An &lt;img should have an alt="" (it can be empty) en must be closed like other empty elements with a space and  /&gt; like <span style="color:rgb(255, 0, 0);" >&lt;img alt="" src="picture.gif" /></span></li>
184
 
  <li><span style="color:rgb(255, 0, 0);" >&lt;?=</span> and <span style="color:rgb(255, 0, 0);" >&lt;?</span> should be <span style="color:rgb(255, 0, 0);" >&lt;?php</span></li>
185
 
  <li>There should not be ANY font tags at all. <span style="color:rgb(255, 0, 0);" > &lt;p&gt;&lt;em&gt; &lt;h1&gt; &lt;h2&gt;</span> etc should be enough for the language files ...</li>
186
 
  <li>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).</li>
187
 
</ul>
188
 
<p style="margin-left: 80px;">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.</p>
189
 
<p style="margin-left: 80px;">The files in the docs folder must be completely XHTML compliant, including doc type, header etc.</p>
190
 
 
191
 
 
192
 
<p style="margin-left: 80px;">Clicking on "Check for missing strings"
193
 
in the language administration screen will also show you what files you
194
 
are missing. If you have missing files then Moodle will use the parent
195
 
language instead, so don't leave copies of <strong>untranslated</strong> help files in your language pack or this handy tool won't work.</p>
196
 
 
197
 
 
198
 
<p>&nbsp;</p>
199
 
 
200
 
 
201
 
<h2>Submitting your language pack to the Moodle project </h2>
202
 
 
203
 
 
204
 
<p style="margin-left: 40px;">Sharing your translation with Moodle will
205
 
ensure that you help other people who speak your language.&nbsp;&nbsp;
206
 
Your interface language will be available in future versions of Moodle.<br />
207
 
</p>
208
 
 
209
 
 
210
 
<p style="margin-left: 40px;">Simply archive your whole new language directory as a <span style="font-weight: bold;">zip</span> file and email it to <a href="m&#97&#105&#108&#116&#111:tra%6es%6ca%74%69o%6e%40%6d%6f%6f%64%6c%65.org">&#116&#114a&#110&#115&#108&#97t&#105on&#64&#109o&#111&#100&#108e&#46o&#114&#103</a>.<br />
211
 
</p>
212
 
<p style="margin-left: 40px;">We will get back to you with further details.<br />
213
 
</p>
214
 
 
215
 
 
216
 
<p  style="margin-left: 40px;">Checklist you can use before committing::</p>
217
 
<ul type="circle" style="margin-left: 80px;">
218
 
<li>No empty files?</li>
219
 
<li>No untranslated files or strings?</li>
220
 
<li>Help files not edited with a wordprocessor?</li>
221
 
<li>README file contains language, name and emailadress of the translator?</li>
222
 
<li>Foldername is the right language code (check moodle\lib\languages.php)?</li>
223
 
<li>Does the language pack run errorfree on a testsite?</li>
224
 
<li>When "thislanguage" contains other then latin letters, is it written in NCR notation?</li>
225
 
<li>Are the strings and files XHTML compliant?</li>
226
 
</ul>
227
 
 
228
 
 
229
 
<h2>Maintenance of a standard language pack<br />
230
 
</h2>
231
 
 
232
 
 
233
 
 
234
 
<p style="margin-left: 40px;">If you are committed to maintaining a language in Moodle, it's best to use <a href="?file=cvs.html">Moodle CVS</a> so that you have an up-to-date version of Moodle, and can easily "check in" your changes directly into the Moodle project. Contact <a href="m&#97&#105&#108&#116&#111:tra%6es%6ca%74%69o%6e%40%6d%6f%6f%64%6c%65.org">&#116&#114a&#110&#115&#108&#97t&#105on&#64&#109o&#111&#100&#108e&#46o&#114&#103</a> if you need help setting this up.<br />
235
 
</p>
236
 
 
237
 
<p style="margin-left: 40px;">You must also subscribe to the <a target="_top" href="http://moodle.org/mod/forum/view.php?id=43">Languages Forum</a> for news and discussion about issues that affect translations.<br />
238
 
</p>
239
 
 
240
 
<p style="margin-left: 40px;">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 <a href="http://sourceforge.net/mail/?group_id=30935" target="_top">CVS mailing list</a>.&nbsp; This helps to keep your
241
 
translation as close to the English text as possible.<br />
242
 
</p>
243
 
<p style="margin-left: 40px;"><br />
244
 
</p>
245
 
 
246
 
<p align="center"><font size="1"><a href="." target="_top">Moodle Documentation</a></font></p>
247
 
<p align="center"><font size="1">Version: $Id: translation.html,v 1.1 2006/02/06 09:28:54 moodler Exp $</font></p>
248
 
 
249
 
</body></html>