Note to Translators
(Another of the Prime Pages' resources)
The Largest Known Primes Icon

Note to Translators

Goal: To make the Top 5000 Primes pages (a.k.a, the Largest Known Primes) section of the Prime Pages' available to many more people by translating them into common languages. This will make it easier for those interested in large primes to read the lists, see the records and participate in the searches without needing to first learn English. The pages to be translated are found mostly in the /primes/, /bios/ and /top20/ directories on the web pages.


Most of the Prime Pages' web pages are dynamically generated, often using a half-dozen different included scripts. For that reason, translation of the files themselves is not a variable option. To make translation possible we use Gnu's gettext, perhaps the most well developed and commonly used tool for internationalization.

Messages in the programs are each put in a function call to gettext which then retrieves the translated version (if any). A file called messages.po containing all of the stings to be translated is automatically generated, and it is this file that translators translate. If a string is not translated in this file, then it will just be presented in its original English.

The messages.po file contains the English strings and (eventually) the translated version of each. Untranslated messages will look something like:

#: src/name.c:36
msgid "My name is Susan."
msgstr ""

After being translated, the message would be translated and look something like:

#: src/name.c:36
msgid "My name is Susan."
msgstr "Je m'appelle Susan"

The line src/name.c:36 indicates the program(s) and line(s) in which the string is used.

How do you translate?

First, if there is already someone translating into your language, you should join them (see the list here.) Otherwise, download messages.pot from (the t on .pot stands for template, it is a template from which each language's .po file is created). The load it into your choice of editor (see the next section) and begin.

The strings that you do not translate will just appear in their original English form. I can also create a smaller .pot file for you if you just want to focus on a part of the site. Finally, once you are ready to have the translation added, e-mail it back to me so that I can place it on the server.

By contributing translations to the Prime Pages, you are agreeing to the terms in our translation agreement.

What editor do you use?

The editing can be done 'by hand', but it is probably best to edit with a po-editor which knows the proper syntax and may have the ability to store all of your previously translated strings (sometimes called translation memory). These are available for all platforms: in Unix there is KBable for KDE GTranslator for GNOME, also Emacs with po-mode.el. The editor PoEdit appears to be available for most platforms (it worked well for me in Windows) and there is LocFactory for OS X...

And when the Prime Pages change?

While we are first converting these pages, the strings will change in bursts. The current strings will always be in this directory as messages.pot. You can down load this and merge it with your current translations (for example, using po-edit you open your existing .po file, then select "merge with pot" under the template menu). This will keep your finished translations and add any new ones.

Many .po editors can also make translation suggestions (marked fuzzy) when new strings are close to the old ones. Some of the suggestions are very poor! If the suggested translation is fine, just remove the fuzzy flag. Fuzzy translations will not be used on the Prime Pages.

Conventions and Examples

I would like all translators to follow some conventions. As time goes on we may add to these. I would appreciate you advice on what should be listed here.

  • Expressions such as %s, %d, and %f should be left alone, these are 'place holders' and will be filled in by a printf function. %s is any string of characters (including words and numbers) %d is an integer (only), and %f is always a floating point number...). Sometimes these are more elaborate such as: %6.2f or %.2f. There is one exception to this do not alter rule, see the example below.
  • Square brackets [ ] should not be altered. These mark where html code (usually web links or bold-facing) will be added. The words inside of the brackets should usually be translated.
  • The name 'Prime Pages' should not be altered.

While translating it is sometimes necessary to change the order of the placeholders. GetText has a way to do this. For example:

msgid "found a prime it %s digits on %s using code %s"
msgstr "using code %3$s on %2$s, found a prime with %1$s digits"
This takes the third string from the original translation and uses it first...