Hinweis: Sie sind auf den Seiten der Moodle 3.1 Dokumentation. Die Dokumentation der aktuellsten Moodle-Version finden Sie hier: Sprachanpassung.

Sprachanpassung: Unterschied zwischen den Versionen

Aus MoodleDocs
Wechseln zu:Navigation, Suche
Zeile 28: Zeile 28:
Moodle ist in viele Sprachen übersetzt, siehe [http://download.moodle.org/langpack/ Moodle.org: Sprachpakete] für eine Liste der borhandenen Sprachpakete und den Status ihrer Übersetzung. Die Übersetzungen werden in Sprachpaketen zusammengefasst, die von freiwilligen Helfer/innen, Community-Nutzer/innen oder Moodle-Partnern gepflegt werden. Wenn Sie bei der Übersetzung mithelfen möchten, lesen Sie bitte zuerst den Artikel [[Übersetzung]], um zu verstehen, wie der gesamte Übersetzungsprozess funktioniert.
Moodle ist in viele Sprachen übersetzt, siehe [http://download.moodle.org/langpack/ Moodle.org: Sprachpakete] für eine Liste der borhandenen Sprachpakete und den Status ihrer Übersetzung. Die Übersetzungen werden in Sprachpaketen zusammengefasst, die von freiwilligen Helfer/innen, Community-Nutzer/innen oder Moodle-Partnern gepflegt werden. Wenn Sie bei der Übersetzung mithelfen möchten, lesen Sie bitte zuerst den Artikel [[Übersetzung]], um zu verstehen, wie der gesamte Übersetzungsprozess funktioniert.


Moodle-Administrator/innen s can customize any language pack to fit their individual needs (for example to use the term "Unit" instead of "Course"). You are discouraged from direct editing the files coming as a part official language pack. Such changes would be silently overwritten during the next upgrade. Instead, you should create a local language pack that holds all your changes from the official pack.
Moodle-Administrator/innen können jedes Sprachpaket anpassen. Sie sollten jedoch nicht die Sprachdateien auf dem Moodle-Server direkt editieren, denn diese Änderungen würden bei der nächsten Aktualisierung des Sprachpakets überschrieben werden. Stattdessen sollten Sie ein lokales Sprachpaket verwenden, das alle Ihre Änderungen enthält.
 
Local language packs have the same structure as the official ones. They are saved in your Moodle data directory in moodledata/lang/xx_local/ folder where 'xx' is the code of the language. You have to have the official language pack installed before you can customize it. Local language pack should contain just strings you have customized - you should not copy whole official language packs.
 
When displaying a string, Moodle first looks if a local customization of it exists in moodledata/lang/xx_local/component_file.php. If so, it is used. If not, the string from the official language pack is used (eventually, if the string has not been translated yet, the original English version is displayed). Please note that the strings are cached for better performance so you have to purge Moodle caches after you modify a file in your xx_local pack (caches are purged automatically if you use the tool described below).


== Using Language customization tool ==
== Using Language customization tool ==

Version vom 14. Juni 2012, 18:35 Uhr


Baustelle.png Diese Seite ist noch nicht vollständig übersetzt.

Wörter oder Wortgruppen (in einer Sprache), die auf einer Moodle-Seite verwendet werden, können mit Hilfe der Sprachanpassung-Funktionalität von Adminsitrator/innen geändert werden. Z.B. können Sie das Wort "Trainer/in" durch das Wort "Lehrer/in" ersetzen. Die dafür nötigen Schritte sind folgende:

  1. Auschecken der Strings
  2. Filtern der Strings, die Sie anpassen wollen
  3. Anpassen der Strings
  4. Speichern und Einchecken der Strings


Schnellanleitung für Ungeduldige

  1. Gehen Sie auf die Seite Einstellungen > Website-Administration > Sprache > Sprachanpassung.
  2. Wählen Sie die Sprache, in der Sie etwas anpassen möchten aus dem Auswahlmenü aus.
  3. Klicken Sie auf den Button Lokales Sprachpaket bearbeiten. Dieser Checkout-Prozess kann eine Weile dauern. Klicken Sie dann auf Weiter.
  4. Markieren Sie die Datei(en), in denen Sie Texte anpassen möchten. Die einzelnen Sprachdateien sind gruppiert, z.B. finden Sie die Dateien zur Aktivität Forum unter mod und die Datei moodle.php unter core.
  5. Wenn Sie die Datei(en) markiert haben, können Sie nach Wörtern suchen, indem Sie die verschiedenen Filterfunktionen nutzen. Klicken Sie dann auf den Button Texte anzeigen.
  6. Machen Sie Ihre Änderungen und klicken Sie auf Sichern und Texte weiter bearbeiten, wenn Sie weitere Texte suchen und bearbeiten möchten.
  7. Klicken Sie abschließend auf Texte im lokalen Sprachpaket sichern, um alle Änderungen zu speichern.

Tipps:

  • Sie sehen keine Änderungen? Haben Sie wirklich mit dem Button Texte im lokalen Sprachpaket sichern gespeichert? Haben Sie den Browser-Cache gelöscht? Haben Sie die richtige Sprachdatei bearbeitet?
  • Sie finden den Text nicht den Sie ändern wollen? Markieren Sie auf der Seite Einstellungen > Website-Administration > Entwicklung > Debugging die Checkbox Originaltexte anzeigen und gehen Sie dann auf die Moodle-Seite, die den Text enthält, den Sie ändern wollen.

Hintergrund

Moodle ist in viele Sprachen übersetzt, siehe Moodle.org: Sprachpakete für eine Liste der borhandenen Sprachpakete und den Status ihrer Übersetzung. Die Übersetzungen werden in Sprachpaketen zusammengefasst, die von freiwilligen Helfer/innen, Community-Nutzer/innen oder Moodle-Partnern gepflegt werden. Wenn Sie bei der Übersetzung mithelfen möchten, lesen Sie bitte zuerst den Artikel Übersetzung, um zu verstehen, wie der gesamte Übersetzungsprozess funktioniert.

Moodle-Administrator/innen können jedes Sprachpaket anpassen. Sie sollten jedoch nicht die Sprachdateien auf dem Moodle-Server direkt editieren, denn diese Änderungen würden bei der nächsten Aktualisierung des Sprachpakets überschrieben werden. Stattdessen sollten Sie ein lokales Sprachpaket verwenden, das alle Ihre Änderungen enthält.

Using Language customization tool

Moodle comes with a tool that allows you to edit your local language pack via web interface. This tool is available for the site administrators in Settings > Site administration > Language > Language customization. Please refer to the following workflow diagram.

Workflow of the language customization (click to enlarge)


Check out strings into translator

At the Language customization first page, select a language to customize and press the button 'Check out string into translator'. During the checkout, Moodle loads the language strings from PHP files into its database. The language customization tool works with this database so the files in your xx_local pack are not touched unless your proceed to the final step of this workflow. If the xx_local language pack does not exist yet, Moodle automatically creates an empty one for you.

Tip: There is currently a problem with "execution time". If you get the "Fatal error: Maximum execution time of 180 seconds exceeded" message, you will have to press the button 'Check out string into translator' several times to get the operation completed. See forum discussion.

Use filter to find the strings you want to customize

Datei:Language string M2 filter.png
Moodle 2.0 language filter

After the checkout, use the "filter strings" form to find strings you want to customize for your site. Not selecting any filters will display all strings in the language pack.

  • Show strings of these components - Click or Ctrl+click to select one or more files that contain the string you want.
  • Customized only - check this field to display only those strings that are already present in your xx_local pack.
  • Help only' - check this field to display only help tooltips, that is the texts used when clicking the yellow question mark icon.
Note: Starting in Moodle 2.0, help string identifiers must end with _help suffix.
  • Modified only - displays only the strings that are modified in the current session.
Note: The term 'customized' means strings that are saved on disk in your xx_local pack directory. The term 'modified' represents the changes made since the last checkin string into the language pack. Customized strings (already saved in a file) are highlighted with green. Modified strings (not saved in a file yet) are highlighted with blue.
Tip: You may want to use this option look at your current work before you check it in.
  • Only strings containing - insert a phrase that must appear in the string. For example, if you put a word 'student' here, you will get only those strings that contain this word.
Tip: The 'Only strings' filter can be used for a total search for a term used in your Moodle site for the selected language pack.
  • String identifier - if you know the string identifier (it is the first parameter of the get_string() function), type it here. For example, the names of activity modules are defined in strings 'modulename'. Finding where a particular string is saved can be difficult sometimes. The administrator can start a debugging function: Site administration>Development>Debugging and choose "Show origin of language strings". Then if you append "?strings=1" (or "&strings=1" if there is already a parameter) to the end of the page URL, beside each string will be shown something like "{rememberusername/admin}". The last part says which php file uses the string, so this one is in admin.php. If there is nothing after the / look in moodle.php. The first part, before the /, is the string identifier.

Use combination of filter settings to get the required set of strings.

Click button 'Show strings' for potential editing.

Input your own translation

The strings that pass all the conditions defined in the filter are displayed in a table. To replace the standard translation, put your own into the 'Local customization' field.

Tip:If you want to delete your current customization , just delete the content of the 'Local customization' field and click the "Save and continue editing". The modifications that are going to be removed a customized string are highlighted in red. If you made changes to a field previously "Save and continue editing" it will be highlighted in blue.

Click "Save and continue" button before you change the filter settings and show a new set of strings.

Saving your work into files

As necessary, you may repeat the "show strings", "local customization" and "Save and continue" process. When you have made all the changes you want to make:

Click "Save and check in strings into files" to process all changes made in the translator database to your local language pack.

Writing the modifications into files

During the checkin, the contents of the translator database are dumped into files in moodledata/lang/xx_local/ directory.

Click "Save and check in strings into files" to process all changes made into your local language pack.

Note: this operation removes the directory first and then re-creates it with the actual data. Therefore it is reasonable to not to touch the files directly after you have checked out them into the translator.