From d2f49be868044469b404b2a225adeaea2c6c9cd4 Mon Sep 17 00:00:00 2001 From: moodler Date: Sat, 31 Jul 2004 15:37:55 +0000 Subject: [PATCH] New documentation for translators ... based on Koen's work. --- lang/en/docs/files.php | 1 + lang/en/docs/translation.html | 212 ++++++++++++++++++++++++++++++++++ 2 files changed, 213 insertions(+) create mode 100755 lang/en/docs/translation.html diff --git a/lang/en/docs/files.php b/lang/en/docs/files.php index 6747b5e348..7b53b24c96 100644 --- a/lang/en/docs/files.php +++ b/lang/en/docs/files.php @@ -26,6 +26,7 @@ $string['-development'] = "Development"; $string['developer.html'] = "Developer Manual"; $string['coding.html'] = "Coding Guide"; $string['cvs.html'] = "Using CVS"; +$string['translation.html'] = "Translation"; ?> diff --git a/lang/en/docs/translation.html b/lang/en/docs/translation.html new file mode 100755 index 0000000000..27f554bb1a --- /dev/null +++ b/lang/en/docs/translation.html @@ -0,0 +1,212 @@ + + + Moodle translation guide + + + + + + +

Moodle translation guide

+ +

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 in +the lang directory, with each language in a unique directory named the +same as the language short name (en, fr, nl, es ...).

+ + +

All the main files are in this +folder, 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: +

+ + + + + + +

 

+ + + +

Creating a completely new language pack

+ + + + +

If your language is not yet supported by +Moodle, or if you just want to make some customisations to your own +site's interface, you may want to start a new translation.

+ + + +

All you need to do is create a new folder +in the lang directory using the 2-letter code for your language. You +can find these standard codes in lib/languages.php. If you are making a +local variation of another language use the code of that language with +an 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, copy the moodle.php from another +language into your new directory.  The one from the "en" folder is +usually best but it doesn't really matter as you are going to rewrite +it anyway.
+

+ + + + +

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 first +thing you need to edit is the string named "thischarset" in moodle.php. +It must contain a valid web character set for your language. After you +change 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 for +making a brand new language pack, and set the parent language (in +moodle.php) to be the language that is most similar to yours.  For +example, 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 to +see this new pack you have to select it as the site language and +restrict 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. +
    3. Go to Administration >> Configuration >> Language, which is the language administration page.
    4. +
    5. On this page you can choose your language from the menu, then choose "Compare and Edit Language".
    6. +
    7. 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 may +have to change file permissions.
    8. +
    9. The forms consist of three columns, the first is the name of +each string, the second is that string in English, and the last is +translation in the current language.
    10. +
    11. Edit missing strings in each files (highlighted in colour), +remembering to hit the "Save changes" button at the end of each form.
    12. +
    13. It's OK to leave strings empty - Moodle will simply use the +parent language for that string instead. You can define the parent +language in moodle.php, otherwise English is always used by default.
    14. +
    15. A quick way to see all the missing strings is by using the button to "Check for missing strings".
      +
      +
    16. + + + + + + + + +
    +
+ + +

Translating the help and documentation files

+ + + +

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

+ + +

Clicking on "Check for missing strings" +in the language administration screen will also show you what files you +are missing. If you have missing files then Moodle will use the parent +language instead, so there is no need to leave copies of untranslated help files in your language pack.

+ + +

 

+ + +

Submitting your language pack to the Moodle project

+ + +

Sharing your translation with Moodle will +ensure 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 translation@moodle.org.
+

+

We will get back to you with further details.
+

+ + +

 

+ + +

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.
+

+

To keep in touch with changes in the project it is a very good idea to subscribe to the CVS mailing list.  This helps to keep your +translation as close to the English text as possible.
+

+


+

+ + + + -- 2.39.5