Translating JabRef

Introduction List of translation files The format of the property files Using Popeye for editing translations How to contribute your translation

Translating JabRef

Introduction

JabRef comes with a set of translations into other languages, currently Chinese (simplified), Danish, English, French, German, Indonesian, Italian, Japanese, Norwegian, Turkish and Vietnamese.

We are constantly looking for translators and translations into other languages. For example a Spanish or Portugese translation would be valuable and of course translations into any other language would be very much appreciated.

Contributing a new language to JabRef is easy since JabRef is prepared for multilanguage support. It only requires the creation of a new set of translation files - so-called property files. These are text files containing one text entry per line that can easily be generated using the java program Popeye a from a graphical user interface.

Furthermore, for a translation to be available within JabRef, a corresponding line must be added in the Java class GUIGlobals (found in the directory src/java/net/sf/jabref/GUIGlobals.java in the JabRef source code tree). The line is inserted in the static {} section where the map LANGUAGES is populated. The code must of course be recompiled after this modification.

If you are interested in translating JabRef or if you have suggestions or questions, please contact us using the jabref-users mailing list.

List of translation files

In the JabRef source code tree, the property files reside in the src/resource directory. For each language there are three files (denotes the country code for the language):

The format of the property files

Each entry is first given in English, then in the other language, with the two parts separated by an '=' character. For instance, a line can look like this in a German translation file:

Background_color_for_optional_fields=Hintergrundfarbe_f\u00fcr_optionale_Felder

Note that each space character is replaced by an underscore, both in the English and the translated version.

Some entries contain “variables” that are inserted at runtime by JabRef - this can for instance be a file name or a file type name:

Synchronizing_%0_links...=Synchronisiere_%0-Links...

A variable is denoted by %0, %1, %2 etc. In such entries, simply repeat the same notation in the translated version.

As we can see, there are several “special” characters: the percent sign and the equals sign, along with the colon character. If these characters are to be part of the actual text in an entry, they must be escaped in the English version, as with the colon in the following example:

Error_writing_XMP_to_file\:_%0=Fehler_beim_Schreiben_von_XMP_in_die_Datei:_%0

Using Popeye for editing translations

To make it easier to keep track of your translation, we recommend using an application called Popeye. This application lets you set up a project including those property files and languages that you want to follow. You have to download langproper-0.55.jar from this homepage. This version properly handles the property files generated by JabRef. Sourcecode of Popeye 0.55 is available at github.

How to contribute your translation

Before deciding to become a regular translator for JabRef, consider that the application is evolving constantly, meaning that translators need to keep updating their translations! We are interested in supporting as many languages as possible, but we don't want incomplete translations.

If you are still interested, you will need to contact the project manager - preferably through the jabref-users mailing list. Then you can send over your initial versions of the translation files, and your language can be added to the current development version of JabRef. You will be made a member of the project group, and given the necessary access to our source control tree. This requires you to have a user account at SourceForge. This means that you will need to learn the basics of using the git version control system. The JabRef's git repository page at SourceForge and the sourceforge git documentation are places to start learning this, although there are several other tutorials available on the web.

Using git you will be able to keep your local files updated, and you need to translate new text entries as they are added to your language's files.

To test your translation you must be able to compile the source tree after making your additions. This requires you to install the Java Development Kit 6.0 or newer, and Apache Ant. Building JabRef with Ant is quite easy - simply enter the root directory of the source tree with a terminal or a cmd shell (under Windows), and run the command “ant”. If everything is working as it should, the JabRef jar file should be built in the build/lib directory below the root directory. The jar file is executable either by double-clicking or by running the command

java -jar build/lib/JabRef-X.jar

where “X” is the current version number in the source tree.

More information is available at our Wiki page.