Difference between revisions of "Internationalisation"

From Jmol
Jump to navigation Jump to search
(Wiki translation)
m (Templates)
Line 14: Line 14:
  
 
We will suppose in the explanation that you want to translate a page named English_Page into XXXXX (language code: xx).
 
We will suppose in the explanation that you want to translate a page named English_Page into XXXXX (language code: xx).
<br /><br />
+
 
 +
 
 +
 
 
=== Page already translated into an other language ===
 
=== Page already translated into an other language ===
  
Line 34: Line 36:
 
* Edit the <tt>English_Page</tt> to have the source code of the page, copy the entire source code (<tt>Ctrl+A</tt>, <tt>Ctrl+C</tt>) and cancel the page editing.
 
* Edit the <tt>English_Page</tt> to have the source code of the page, copy the entire source code (<tt>Ctrl+A</tt>, <tt>Ctrl+C</tt>) and cancel the page editing.
 
* Start editing the page in your language (<tt>English_Page/xx</tt>), paste the source code (<tt>Ctrl+V</tt>) and then translate the page.
 
* Start editing the page in your language (<tt>English_Page/xx</tt>), paste the source code (<tt>Ctrl+V</tt>) and then translate the page.
<br />
+
 
 +
 
 
=== Page not translated into any other language ===
 
=== Page not translated into any other language ===
  
Line 57: Line 60:
  
 
In Jmol version 10.00.12 we changed from an unhandy (but well-known) translation process to a more powerful one using [http://www.gnu.org/software/gettext/gettext.html GNU's gettext] suite. The following paragraphs contain a detailed explanation of this process. More documentation is available [http://www.gnu.org/software/gettext/manual/gettext.html here].
 
In Jmol version 10.00.12 we changed from an unhandy (but well-known) translation process to a more powerful one using [http://www.gnu.org/software/gettext/gettext.html GNU's gettext] suite. The following paragraphs contain a detailed explanation of this process. More documentation is available [http://www.gnu.org/software/gettext/manual/gettext.html here].
<br /><br />
+
 
 +
 
 +
 
 
=== Simple explanation to add a new translation ===
 
=== Simple explanation to add a new translation ===
  
 
Adding a new translation for the Jmol application/applet is quite easy. Only a few steps are required to add the translation.
 
Adding a new translation for the Jmol application/applet is quite easy. Only a few steps are required to add the translation.
  
'''1. Download the files for the translation:'''<br />
+
'''1. Download the files for the translation:'''
Download [http://svn.sourceforge.net/viewcvs.cgi/jmol/trunk/Jmol/src/org/jmol/translation/Jmol/Jmol.pot?view=log Jmol.pot] and rename it to <tt>''LANG''.po</tt>.<br />
+
 
Download [http://svn.sourceforge.net/viewcvs.cgi/jmol/trunk/Jmol/src/org/jmol/translation/JmolApplet/JmolApplet.pot?view=log JmolApplet.pot] and rename it to <tt>''LANG''.po</tt>.<br />
+
Download [http://svn.sourceforge.net/viewcvs.cgi/jmol/trunk/Jmol/src/org/jmol/translation/Jmol/Jmol.pot?view=log Jmol.pot] and rename it to {{File|''LANG''.po}}.
Note: <tt>''LANG''</tt> means your language code: e.g. <tt>de</tt> for German, <tt>fr</tt> for French and so on.<br />
+
 
 +
Download [http://svn.sourceforge.net/viewcvs.cgi/jmol/trunk/Jmol/src/org/jmol/translation/JmolApplet/JmolApplet.pot?view=log JmolApplet.pot] and rename it to {{File|''LANG''.po}}.
 +
 
 +
Note: <tt>''LANG''</tt> means your language code: e.g. <tt>de</tt> for German, <tt>fr</tt> for French and so on.
 +
 
 
Note: Since both files have the same name, you will have to save them in different directories or rename them.
 
Note: Since both files have the same name, you will have to save them in different directories or rename them.
<br /><br />
+
 
'''2. Install an editor for .po files:'''<br />
+
 
The .po files can be edited with many editors, see Detailed explanation.<br />
+
'''2. Install an editor for .po files:'''
 +
 
 +
The .po files can be edited with many editors, see Detailed explanation.
 +
 
 
It's probably easier to use a dedicated editor, so the explanations below are based on [http://www.poedit.org/ poEdit], but feel free to use the editor you prefer.
 
It's probably easier to use a dedicated editor, so the explanations below are based on [http://www.poedit.org/ poEdit], but feel free to use the editor you prefer.
 
poEdit is cross-platform (Windows, Unix, and probably Mac OS X in a near future).
 
poEdit is cross-platform (Windows, Unix, and probably Mac OS X in a near future).
Line 78: Line 90:
 
* [http://packages.debian.org/stable/devel/gettext-el Emacs po-mode],
 
* [http://packages.debian.org/stable/devel/gettext-el Emacs po-mode],
 
* ...
 
* ...
<br />
+
 
'''3. Configure Jmol <tt>''LANG''</tt>.po:'''
+
 
 +
'''3. Configure Jmol {{File|''LANG''.po}}:'''
  
 
<table border="0" cellspacing="0" width="100%"><tr><td>
 
<table border="0" cellspacing="0" width="100%"><tr><td>
Open Jmol <tt>''LANG''.po</tt> with poEdit.
+
Open Jmol {{File|''LANG''.po}} with poEdit.
  
 
Select Catalog / Settings in the menu.
 
Select Catalog / Settings in the menu.
Line 98: Line 111:
 
[[Image:PoEdit_Settings.png]]
 
[[Image:PoEdit_Settings.png]]
 
</td></tr></table>
 
</td></tr></table>
<br />
+
 
'''4. Translate Jmol <tt>''LANG''.po</tt>:'''
+
 
The main window of poEdit is divided into several areas.<br />
+
 
 +
'''4. Translate Jmol {{File|''LANG''.po}}:'''
 +
 
 +
The main window of poEdit is divided into several areas.
 +
 
 
The top area contains the list of strings to translate with their current translation. The background color of each line depends on the status of the translation:
 
The top area contains the list of strings to translate with their current translation. The background color of each line depends on the status of the translation:
 
* Blue: Not translated yet.
 
* Blue: Not translated yet.
Line 112: Line 129:
  
 
[[Image:PoEdit.png]]
 
[[Image:PoEdit.png]]
<br /><br />
+
 
'''5. Repeat steps 3 and 4 with JmolApplet <tt>''LANG''.po</tt>.'''
+
 
<br /><br />
+
 
'''6. Send the two .po files to a Jmol developer, so they will be added in the next Jmol release.'''<br />
+
'''5. Repeat steps 3 and 4 with JmolApplet {{File|''LANG''.po}}.'''
 +
 
 +
 
 +
 
 +
'''6. Send the two .po files to a Jmol developer, so they will be added in the next Jmol release.'''
 +
 
 
Emails: [mailto:nicove@users.sourceforge.net nicove@users.sourceforge.net], [mailto:Jmol-developers@lists.sf.net Jmol-developers@lists.sf.net].
 
Emails: [mailto:nicove@users.sourceforge.net nicove@users.sourceforge.net], [mailto:Jmol-developers@lists.sf.net Jmol-developers@lists.sf.net].
  
Line 122: Line 144:
  
 
Updating an existing translation for the Jmol application/applet is quite easy. Only a few steps are required to update the translation.
 
Updating an existing translation for the Jmol application/applet is quite easy. Only a few steps are required to update the translation.
<br /><br />
+
 
'''1. Download the files for the translation:'''<br />
+
 
Download <tt>''LANG''.po</tt> from the [http://svn.sourceforge.net/viewcvs.cgi/jmol/trunk/Jmol/src/org/jmol/translation/Jmol/ Jmol directory].<br />
+
 
Download <tt>''LANG''.po</tt> from the [http://svn.sourceforge.net/viewcvs.cgi/jmol/trunk/Jmol/src/org/jmol/translation/JmolApplet/ JmolApplet directory].<br />
+
'''1. Download the files for the translation:'''
Note: <tt>''LANG''</tt> means your language code: e.g. <tt>de</tt> for German, <tt>fr</tt> for French and so on.<br />
+
 
 +
Download {{File|''LANG''.po}} from the [http://svn.sourceforge.net/viewcvs.cgi/jmol/trunk/Jmol/src/org/jmol/translation/Jmol/ Jmol directory].
 +
 
 +
Download {{File|''LANG''.po}} from the [http://svn.sourceforge.net/viewcvs.cgi/jmol/trunk/Jmol/src/org/jmol/translation/JmolApplet/ JmolApplet directory].
 +
 
 +
Note: <tt>''LANG''</tt> means your language code: e.g. <tt>de</tt> for German, <tt>fr</tt> for French and so on.
 +
 
 
Note: Since both files have the same name, you will have to save them in different directories or rename them.
 
Note: Since both files have the same name, you will have to save them in different directories or rename them.
<br /><br />
+
 
 +
 
 +
 
 
'''2. Install an editor for .po files:'''
 
'''2. Install an editor for .po files:'''
 +
 
See step 2 in the explanations for adding a new translation.
 
See step 2 in the explanations for adding a new translation.
<br /><br />
+
 
'''3. Translate each <tt>''LANG''.po</tt>:'''<br />
+
 
 +
 
 +
'''3. Translate each {{File|''LANG''.po}}:'''
 +
 
 
See step 4 in the explanations for adding a new translation.
 
See step 4 in the explanations for adding a new translation.
<br /><br />
+
 
'''4. Send the two .po files to a Jmol developer, so they will be added in the next Jmol release.'''<br />
+
 
 +
 
 +
'''4. Send the two .po files to a Jmol developer, so they will be added in the next Jmol release.'''
 +
 
 
Emails: [mailto:nicove@users.sourceforge.net nicove@users.sourceforge.net], [mailto:Jmol-developers@lists.sf.net Jmol-developers@lists.sf.net].
 
Emails: [mailto:nicove@users.sourceforge.net nicove@users.sourceforge.net], [mailto:Jmol-developers@lists.sf.net Jmol-developers@lists.sf.net].
  
Line 141: Line 178:
 
=== Detailed explanation ===
 
=== Detailed explanation ===
  
1. Download and install [http://www.gnu.org/software/gettext/gettext.html gettext]. Linux users should try to install it using their distributions package management (like rpm, dpkg, apt, ...). Windows user download gettext from http://gnuwin32.sourceforge.net/packages/gettext.htm. Both make sure, that the gettext binaries are in your PATH environment variable.<br />
+
1. Download and install [http://www.gnu.org/software/gettext/gettext.html gettext]. Linux users should try to install it using their distributions package management (like rpm, dpkg, apt, ...). Windows user download gettext from http://gnuwin32.sourceforge.net/packages/gettext.htm. Both make sure, that the gettext binaries are in your PATH environment variable.
'''Note for Windows users:''' If you installed the gettext binaries into e.g. <tt>C:\Program Files\GnuWin32</tt>, then you need to add <tt>C:\Program Files\GnuWin32\bin;</tt> to the existing PATH environment variable: Control Panel &rarr; System &rarr; Environment Variable (Tab Extended) OR run the following command in a windows command shell: <tt>set PATH=%PATH%;C:\Program Files\GnuWin32\bin;.</tt>. Windows XP and Windows 2000 are currently supported.
+
 
<br /><br />
+
'''Note for Windows users:''' If you installed the gettext binaries into e.g. {{Directory|C:\Program Files\GnuWin32}}, then you need to add <tt>C:\Program Files\GnuWin32\bin;</tt> to the existing PATH environment variable: {{MenuItem|Control Panel}} &rarr; {{MenuItem|System}} &rarr; {{MenuItem|Environment Variable}} (Tab Extended) OR run the following command in a windows command shell: <tt>set PATH=%PATH%;C:\Program Files\GnuWin32\bin;.</tt>. Windows XP and Windows 2000 are currently supported.
2. All targets related to internationalisation and localisation issues are part of <tt>build-i18n.xml</tt>. To create PO-template files, run <tt>ant -f build-i18n.xml update-pot</tt>. All <tt>''LANG''.po</tt> files (which contain the translation and are maintained by the translator himself) are updated with <tt>ant -f build-i18n.xml update-po</tt>. To create the final message catalogs, run <tt>ant -f build-i18n.xml update-catalog</tt>.
+
 
<br /><br />
+
 
3. To create a translation in your language, go to <tt>src/org/jmol/translation/Jmol</tt> (for the application) or <tt>src/org/jmol/translation/JmolApplet</tt> (for the applet) and copy <tt>Jmol(Applet).pot</tt> to <tt>''LANG''.po</tt> - <tt>''LANG''</tt> means your language code: e.g. <tt>de</tt> for German, <tt>fr</tt> for French and so on.
+
 
<br /><br />
+
2. All targets related to internationalisation and localisation issues are part of {{File|build-i18n.xml}}. To create PO-template files, run <tt>ant -f build-i18n.xml update-pot</tt>. All {{File|''LANG''.po}} files (which contain the translation and are maintained by the translator himself) are updated with <tt>ant -f build-i18n.xml update-po</tt>. To create the final message catalogs, run <tt>ant -f build-i18n.xml update-catalog</tt>.
4. To begin your translation, open the newly created <tt>''LANG''.po</tt> with an editor of your choice - '''Windows users be aware, that the editor MUST NOT add any control characters (like e.g. Word does)!.''' There are also specialised editors for this work: e.g. [http://www.poedit.org/ poedit], [http://i18n.kde.org/tools/kbabel/ kbabel], or [http://gtranslator.sourceforge.net/ gtranslator].
+
 
<br /><br />
+
 
 +
 
 +
3. To create a translation in your language, go to {{Directory|src/org/jmol/translation/Jmol}} (for the application) or {{Directory|src/org/jmol/translation/JmolApplet}} (for the applet) and copy {{File|Jmol(Applet).pot}} to {{File|''LANG''.po}} - <tt>''LANG''</tt> means your language code: e.g. <tt>de</tt> for German, <tt>fr</tt> for French and so on.
 +
 
 +
 
 +
 
 +
4. To begin your translation, open the newly created {{File|''LANG''.po}} with an editor of your choice - '''Windows users be aware, that the editor MUST NOT add any control characters (like e.g. Word does)!.''' There are also specialised editors for this work: e.g. [http://www.poedit.org/ poedit], [http://i18n.kde.org/tools/kbabel/ kbabel], or [http://gtranslator.sourceforge.net/ gtranslator].
 +
 
 +
 
 +
 
 
5. The opened file will look like this:
 
5. The opened file will look like this:
  
Line 197: Line 243:
  
 
A line or block beginning with <tt>msgid</tt> contains the untranslated (or original) string inside double quotation marks. Above this line, you see the location entries <tt>#: path/to/file.java:line</tt> (where the string can be found in the source) and sometimes some special comments <tt>#, java-format</tt> or <tt>#, fuzzy</tt> or even <tt>#, fuzzy, java-format</tt> (telling you more about the format of a string or the state of a translation) - these lines are added and changed automatically by running <tt>ant -f build-i18n.xml update-po</tt>. Place your translation into the line or block beginning with <tt>msgstr</tt> and inside double quotation marks.
 
A line or block beginning with <tt>msgid</tt> contains the untranslated (or original) string inside double quotation marks. Above this line, you see the location entries <tt>#: path/to/file.java:line</tt> (where the string can be found in the source) and sometimes some special comments <tt>#, java-format</tt> or <tt>#, fuzzy</tt> or even <tt>#, fuzzy, java-format</tt> (telling you more about the format of a string or the state of a translation) - these lines are added and changed automatically by running <tt>ant -f build-i18n.xml update-po</tt>. Place your translation into the line or block beginning with <tt>msgstr</tt> and inside double quotation marks.
<br /><br />
+
 
6. After finishing, add your translation (<tt>''LANG''.po</tt>) to Jmol SVN and your language code to property <tt>all.Jmol(Applet).languages</tt> in <tt>build-i18n.xml</tt>.
+
 
<br /><br />
+
 
 +
6. After finishing, add your translation ({{File|''LANG''.po}}) to Jmol SVN and your language code to property <tt>all.Jmol(Applet).languages</tt> in {{File|build-i18n.xml}}.
 +
 
 +
 
 +
 
 
7. At the end of this short howto, we should speak about special situations and a few hints, you should consider:
 
7. At the end of this short howto, we should speak about special situations and a few hints, you should consider:
 
* double quotation marks inside a string must be escaped with a backslash: <tt>msgstr "... \" ..."</tt>
 
* double quotation marks inside a string must be escaped with a backslash: <tt>msgstr "... \" ..."</tt>
Line 209: Line 259:
  
 
The guides are written in XML. ...
 
The guides are written in XML. ...
<br /><br />
+
 
 +
 
 +
 
 
1. First install and download:
 
1. First install and download:
 
* [http://www.python.org/download/ Python] runtime
 
* [http://www.python.org/download/ Python] runtime
Line 221: Line 273:
  
 
Now you are done with the prerequisites.
 
Now you are done with the prerequisites.
<br /><br />
+
 
2. All targets related to internationalisation and localisation of the documentation are part of <tt>build-doc-i18n.xml</tt>. To create PO-template files, run <tt>ant -f build-doc-i18n.xml create-pot</tt>. All <tt>Jmol*Guide.''LANG''.po</tt> files (which contain the translation and are maintained by the translator himself) are updated with <tt>ant -f build-doc-i18n.xml update-po</tt>. To create the final (translated) XML file <tt>Jmol*Guide_''LANG''.docbook.xml</tt>, run <tt>ant -f build-doc-i18n.xml update-xml</tt>.
+
 
<br /><br />
+
 
3. To create a translation in your language, go to <tt>doc/source/po</tt> and copy <tt>Jmol*Guide.pot</tt> to <tt>Jmol*Guide.''LANG''.po</tt> - <tt>''LANG''</tt> means your language code: e.g. <tt>de</tt> for German, <tt>fr</tt> for French and so on.
+
2. All targets related to internationalisation and localisation of the documentation are part of {{File|build-doc-i18n.xml}}. To create PO-template files, run <tt>ant -f build-doc-i18n.xml create-pot</tt>. All {{File|Jmol*Guide.''LANG''.po}} files (which contain the translation and are maintained by the translator himself) are updated with <tt>ant -f build-doc-i18n.xml update-po</tt>. To create the final (translated) XML file {{File|Jmol*Guide_''LANG''.docbook.xml}}, run <tt>ant -f build-doc-i18n.xml update-xml</tt>.
<br /><br />
+
 
 +
 
 +
 
 +
3. To create a translation in your language, go to {{Directory|doc/source/po}} and copy {{File|Jmol*Guide.pot}} to {{File|Jmol*Guide.''LANG''.po}} - <tt>''LANG''</tt> means your language code: e.g. <tt>de</tt> for German, <tt>fr</tt> for French and so on.
 +
 
 +
 
 +
 
 
4. The rest is similar to the above Howto.
 
4. The rest is similar to the above Howto.
  

Revision as of 17:59, 17 May 2006

Jmol Internationalisation and Localisation

Several pieces of Jmol can be translated into your local language:



Translating this Wiki

The articles in this Wiki can be translated into your own language.

The explanation below will take two different situations:

  • When the page you want to translate is already translated into an other language.
  • When the page you want to translate is not translated into any other language.

We will suppose in the explanation that you want to translate a page named English_Page into XXXXX (language code: xx).


Page already translated into an other language

  • In the Template namespace, edit the existing page Lang:English_Page, add your language in it and save the page:
----
{| border="0" cellspacing="1"
|-
! valign="middle" | [[Image:Geographylogo.png]]
| valign="middle" align="left" | <span style="font-size:smaller">
Reference:
'''[[English_Page|English]]''' – 
Other:
<!--es-->[[English_Page/es|Español]] · 
<!--fr-->[[English_Page/fr|Français]] · 
<!--xx-->[[English_Page/xx|XXXXX]] · 
</span>
|}
----
  • Edit the English_Page to have the source code of the page, copy the entire source code (Ctrl+A, Ctrl+C) and cancel the page editing.
  • Start editing the page in your language (English_Page/xx), paste the source code (Ctrl+V) and then translate the page.


Page not translated into any other language

  • Edit the template page (Template:Lang:English_Page) and initialize it:
----
{| border="0" cellspacing="1"
|-
! valign="middle" | [[Image:Geographylogo.png]]
| valign="middle" align="left" | <span style="font-size:smaller">
Reference:
'''[[English_Page|English]]''' – 
Other:
<!--xx-->[[English_Page/xx|XXXXX]] · 
</span>
|}
----
  • Edit the English_Page, insert {{Lang:English_Page}} at the beginning, copy the entire source code (Ctrl+A, Ctrl+C) and save the page.
  • Start editing the page in your language (English_Page/xx), paste the source code (Ctrl+V) and then translate the page.


Translating the application/applet

In Jmol version 10.00.12 we changed from an unhandy (but well-known) translation process to a more powerful one using GNU's gettext suite. The following paragraphs contain a detailed explanation of this process. More documentation is available here.


Simple explanation to add a new translation

Adding a new translation for the Jmol application/applet is quite easy. Only a few steps are required to add the translation.

1. Download the files for the translation:

Download Jmol.pot and rename it to File icon.gifLANG.po.

Download JmolApplet.pot and rename it to File icon.gifLANG.po.

Note: LANG means your language code: e.g. de for German, fr for French and so on.

Note: Since both files have the same name, you will have to save them in different directories or rename them.


2. Install an editor for .po files:

The .po files can be edited with many editors, see Detailed explanation.

It's probably easier to use a dedicated editor, so the explanations below are based on poEdit, but feel free to use the editor you prefer. poEdit is cross-platform (Windows, Unix, and probably Mac OS X in a near future).

Many other editors exist:


3. Configure Jmol File icon.gifLANG.po:

Open Jmol File icon.gifLANG.po with poEdit.

Select Catalog / Settings in the menu.

Type the followings values in the fields:

  • Project name and version: Jmol
  • Team: Your language
  • Team's email address: Jmol-developers@lists.sf.net
  • Language: Your language
  • Country: Your country
  • Charset: UTF-8

Save the modifications

PoEdit Settings.png


4. Translate Jmol File icon.gifLANG.po:

The main window of poEdit is divided into several areas.

The top area contains the list of strings to translate with their current translation. The background color of each line depends on the status of the translation:

  • Blue: Not translated yet.
  • Yellow: Fuzzy translation (needs verification).
  • White: Translated.
  • Red: Error.

When you select a line in the top area, the bottom areas is updated with the following:

  • Top-left area: String to translate.
  • Bottom-left area: Current translation. Just type your translation in here.

PoEdit.png


5. Repeat steps 3 and 4 with JmolApplet File icon.gifLANG.po.


6. Send the two .po files to a Jmol developer, so they will be added in the next Jmol release.

Emails: nicove@users.sourceforge.net, Jmol-developers@lists.sf.net.



Simple explanation to update an existing translation

Updating an existing translation for the Jmol application/applet is quite easy. Only a few steps are required to update the translation.


1. Download the files for the translation:

Download File icon.gifLANG.po from the Jmol directory.

Download File icon.gifLANG.po from the JmolApplet directory.

Note: LANG means your language code: e.g. de for German, fr for French and so on.

Note: Since both files have the same name, you will have to save them in different directories or rename them.


2. Install an editor for .po files:

See step 2 in the explanations for adding a new translation.


3. Translate each File icon.gifLANG.po:

See step 4 in the explanations for adding a new translation.


4. Send the two .po files to a Jmol developer, so they will be added in the next Jmol release.

Emails: nicove@users.sourceforge.net, Jmol-developers@lists.sf.net.



Detailed explanation

1. Download and install gettext. Linux users should try to install it using their distributions package management (like rpm, dpkg, apt, ...). Windows user download gettext from http://gnuwin32.sourceforge.net/packages/gettext.htm. Both make sure, that the gettext binaries are in your PATH environment variable.

Note for Windows users: If you installed the gettext binaries into e.g. C:\Program Files\GnuWin32, then you need to add C:\Program Files\GnuWin32\bin; to the existing PATH environment variable: Control PanelSystemEnvironment Variable (Tab Extended) OR run the following command in a windows command shell: set PATH=%PATH%;C:\Program Files\GnuWin32\bin;.. Windows XP and Windows 2000 are currently supported.


2. All targets related to internationalisation and localisation issues are part of File icon.gifbuild-i18n.xml. To create PO-template files, run ant -f build-i18n.xml update-pot. All File icon.gifLANG.po files (which contain the translation and are maintained by the translator himself) are updated with ant -f build-i18n.xml update-po. To create the final message catalogs, run ant -f build-i18n.xml update-catalog.


3. To create a translation in your language, go to src/org/jmol/translation/Jmol (for the application) or src/org/jmol/translation/JmolApplet (for the applet) and copy File icon.gifJmol(Applet).pot to File icon.gifLANG.po - LANG means your language code: e.g. de for German, fr for French and so on.


4. To begin your translation, open the newly created File icon.gifLANG.po with an editor of your choice - Windows users be aware, that the editor MUST NOT add any control characters (like e.g. Word does)!. There are also specialised editors for this work: e.g. poedit, kbabel, or gtranslator.


5. The opened file will look like this:

# SOME DESCRIPTIVE TITLE.
# Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER
# This file is distributed under the same license as the PACKAGE package.
# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
#

These lines are comments. Adjust them and add a descritpive title, the right copyright and your name as author. Be aware, that lines beginning with #, or #: have a special meaning and are not normal comments.

#, fuzzy
msgid ""
msgstr ""
"Project-Id-Version: PACKAGE VERSION\n"
"Report-Msgid-Bugs-To: jmol-developers@lists.sourceforge.net\n"
"POT-Creation-Date: 2005-06-01 02:02+0200\n"
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
"Language-Team: LANGUAGE <LL@li.org>\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"

We call this part the po-headers. The line #, fuzzy says, that the headers are outdated. Customise "Project-Id-Version: PACKAGE VERSION\n", "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n", "Last-Translator: FULL NAME <EMAIL@ADDRESS>\n" and maybe "Language-Team: LANGUAGE <LL@li.org>\n" (if you don't belong to a language team, then write none) and remove the fuzzy comment. In every case make sure, that Content-Type and Content-Transfer-Encoding are right (if possible, use UTF-8).

If you plan to use poedit to do the translation, you can add several lines to the headers (replace LANGUAGE and COUNTRY).

"X-Poedit-Language: LANGUAGE\n"
"X-Poedit-Country: COUNTRY\n"
"X-Poedit-Basepath: ../../../..\n"

Then begin the "real" translation:

#: org/openscience/jmol/app/AboutDialog.java:57
#: org/openscience/jmol/app/GuiMap.java:155
msgid "About Jmol"
msgstr ""

#: org/openscience/jmol/app/AboutDialog.java:67
#: org/openscience/jmol/app/HelpDialog.java:77
#: org/openscience/jmol/app/WhatsNewDialog.java:68
#, java-format
msgid "Unable to find url \"{0}\"."
msgstr ""
[..]

A line or block beginning with msgid contains the untranslated (or original) string inside double quotation marks. Above this line, you see the location entries #: path/to/file.java:line (where the string can be found in the source) and sometimes some special comments #, java-format or #, fuzzy or even #, fuzzy, java-format (telling you more about the format of a string or the state of a translation) - these lines are added and changed automatically by running ant -f build-i18n.xml update-po. Place your translation into the line or block beginning with msgstr and inside double quotation marks.


6. After finishing, add your translation (File icon.gifLANG.po) to Jmol SVN and your language code to property all.Jmol(Applet).languages in File icon.gifbuild-i18n.xml.


7. At the end of this short howto, we should speak about special situations and a few hints, you should consider:

  • double quotation marks inside a string must be escaped with a backslash: msgstr "... \" ..."
  • single quotation marks must be doubled (two single quotation marks) for Java texts (#, java-format)
  • #, fuzzy means that the translation string is outdated (e.g. the original string changed) - in this situation, check your translation and adjust it if necessary - then you can remove the fuzzy string (e.g. line #, fuzzy, java-format becomes #, java-format)


Translating the Applet-, User- and Developers-Guide

The guides are written in XML. ...


1. First install and download:

Note for Linux users: Linux users should ALWAYS try to use their package management to install (software-)packages.

Note for Windows users: Windows users MUST add an environment variable PYTHON_PATH, which contains the directory where you installed Python, e.g. set PYTHON_PATH=C:\Program Files\Python24.

Now you are done with the prerequisites.


2. All targets related to internationalisation and localisation of the documentation are part of File icon.gifbuild-doc-i18n.xml. To create PO-template files, run ant -f build-doc-i18n.xml create-pot. All File icon.gifJmol*Guide.LANG.po files (which contain the translation and are maintained by the translator himself) are updated with ant -f build-doc-i18n.xml update-po. To create the final (translated) XML file File icon.gifJmol*Guide_LANG.docbook.xml, run ant -f build-doc-i18n.xml update-xml.


3. To create a translation in your language, go to doc/source/po and copy File icon.gifJmol*Guide.pot to File icon.gifJmol*Guide.LANG.po - LANG means your language code: e.g. de for German, fr for French and so on.


4. The rest is similar to the above Howto.



Translating the Jmol and FAH websites

... to write