HOWTO Translate - Übersetzen leicht gemacht, ab 4.3.2

Neues und Informatives. Das Forum ist read only.

Moderator: Moderatoren

Antworten
htw
Beiträge: 490
Registriert: Sa 5. Okt 2002, 03:09
Wohnort: Hessen
Kontaktdaten:

HOWTO Translate - Übersetzen leicht gemacht, ab 4.3.2

Beitrag von htw » Di 15. Jul 2003, 15:21

1 Contenido übersetzen (deutsch)

Für die Übersetzung von Contenido wird die GNU gettext Bibliothek genutzt, die vielleicht schon aus anderen Unix/Linux Applikationen bekannt ist. Wenn die Methode bekannt ist, dann kann man direkt mit der Übersetzung starten. Die .po Dateien liegen unter locale/<yourcode>/LC_MESSAGES/. Sollte das Konzept nicht bekannt sein, dann bitte weiterlesen.


1 Translating Contenido (english)

If you've translated Unix/Linux applications before, you might already know the GNU gettext tool library. If you do, you can immediately start translating by using the .po files in the locale/<yourcode>/LC_MESSAGES/ directory. If you are new to the GNU gettext tool library and concepts, read on.


1.1 Sprachversionen in Contenido (deutsch)

Die Übersetzung von Contenido wurde mit der GNU gettext tool Bibliothek vorgenommen. Strings werden direkt im Quelltext editiert und nach der Entwicklung extrahiert, so dass Übersetzer diese Strings einfach übersetzen können. In den vorherigen Version wurden noch Sprachvariablen benutzt. Dieses System hatte aus unserer Sicht ein paar Nachteile. Bei jeder Neuentwicklung oder Modifikation mussten diese Sprachvariablen definiert werden und die entsprechende Übersetzung dazu angelegt werden, ansonsten kam es häufiger zu parse errors - oder zu leeren Strings.


1.1 How Contenido is internationalized (english)

Contenido is currently translated using the GNU gettext tool library. Strings are directly edited in the source code, and are extracted after the development so translators can directly translate the strings.
In the past, we have had so-called language variables. However, this system had a few drawbacks. Every time a new string was added to Contenido, developers had to create a new language variable which afterwards had to be translated. If the variable wasn't translated yet, users received an empty string or even a parse error.


1.2 Das Übersetzen (deutsch)

Nach Abschluss der Entwicklungsarbeiten werden die einzelnen Sprachstrings mit einem Tool extrahiert. Die extrahierten Ergebnisse finden sich in dem Verzeichnis contenido/locale/<LANGCODE>/LC_MESSAGES/. <LANGCODE> ist der ISO Ländercode für die jeweiligen Länder, Deutschland ist z.B. de_DE. Weitere Codes stehen unter http://nscp.upenn.edu/aix4.3html/aixbma ... locale.htm zur Verfügung. Wenn man eine contenido.po datei öffnet, dann sieht man die Standardnachricht und deren Übersetzung:

msgid ""
msgstr ""
"Project-Id-Version: Contenido 4.3.1\n"
"POT-Creation-Date: \n"
"PO-Revision-Date: 2003-06-18 13:22+0100\n"
"Last-Translator: Timo A. Hummel <timo.hummel@4fb.de>\n"
"Language-Team: Contenido <contenido@4fb.de>\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=iso-8859-1\n"
"Content-Transfer-Encoding: 8bit\n"

# E:/timo/contenido431/contenido/translationdemo.php:89
msgid "Welcome to My PHP Application\n"
msgstr "Benvenuto alla mia applicazione di PHP\n"

Die ersten Zeilen können einfach ignoriert werden. Die wichtigen Zeilen sind 'msgid' und 'msgstr'. Die 'msgid' bezeichnet den ursprünglichen String und 'msgstr' die dazugehörige Übersetzung. Somit ist das Übersetzen recht einfach, vorausgesetzt man beherrscht die Sprache ;-), denn man sieht nicht nur das Original, sondern auch die Übersetzung. Ein graphisches Frontend steht mit 'poEdit' zur Verfügung.


1.2 How to translate (english)

When the development of a new Contenido version has been finished, developers extract all strings using a special tool into so-called language files. These files can be found in the directory contenido/locale/<LANGCODE>/LC_MESSAGES/. <LANGCODE> is the ISO country code for your country, for Germany, this would be de_DE, and for Italy it would be it_IT. More codes can be found on http://nscp.upenn.edu/aix4.3html/aixbma ... locale.htm.
If you open the contenido.po file, you'll see the default messages and their translation:

msgid ""
msgstr ""
"Project-Id-Version: Contenido 4.3.1\n"
"POT-Creation-Date: \n"
"PO-Revision-Date: 2003-06-18 13:22+0100\n"
"Last-Translator: Timo A. Hummel <timo.hummel@4fb.de>\n"
"Language-Team: Contenido <contenido@4fb.de>\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=iso-8859-1\n"
"Content-Transfer-Encoding: 8bit\n"

# E:/timo/contenido431/contenido/translationdemo.php:89
msgid "Welcome to My PHP Application\n"
msgstr "Benvenuto alla mia applicazione di PHP\n"

You can ignore the first lines, as they are not important for translation. The important lines are "msgid" and "msgstr". The "msgid" specifies the source text, and the "msgstr" the translation. Thus, it's very easy to translate as you always see the original text and your translation. You can also use "poEdit" which is a graphical frontend to .po files.


1.3 Integration der Übersetzungen (deutsch)

Die Übersetzung kannst Du mit 'msgfmt' testen:
msgfmt contenido.po –o contenido.mo
Dieser Befehl kompiliert das Textfile 'contenido.po' in das Binary 'contenido.mo'. Das Kompilieren bringt Performancevorteile. Gerne kannst Du uns auch die .po Dateien zusenden und wir übernehmen das komplieren und senden dann ein kompiliertes .mo file zurück. Mit dem Programm 'poEdit' ist dieser Schritt nicht notwendig, da das Programm das Kompilieren übernimmt.

1.3 How to integrate the translation (english)

You can test your translation by running the application "msgfmt":
msgfmt contenido.po –o contenido.mo
This command compiles the textual file "contenido.po" into a binary one called "contenido.mo". This has to be done for performance reasons. If you can't run msgfmt yourself, just send your translated contenido.po file to us with the remark that you'd like to receive a compiled .mo file, and we'll return the .mo file to you. If you are using poEdit, you don't need to call msgfmt yourself, poEdit does that for you.


2 Quelle / Resources


2.1 poEdit (deutsch)

poEdit ist für die Betriebssysteme Windows und Linux erhältlich. Das Programm steht unter
http://poedit.sourceforge.net/
zur Verfügung.


2.1 poEdit (english)

poEdit is available for both Linux and Windows. You can grab it at http://poedit.sourceforge.net/


Viel Spaß / Have fun
Contenido-Team

Antworten