FANDOM


Languages 02

The language options available for Set language.

Foldit relies on volunteer translators to translate the game's user interface into different languages.

The client translation list on the Foldit website shows the translations that have already been shared.

Translation uses a format called gettext. Foldit supplies a template file called foldit.pot containing all messages and text which need to be translated. There are currently around 900 messages which can be translated.

Translators can use programs like Poedit, which work with the .pot file format. The end result is a file called foldit.cc.po, where cc is the two-character "country code" as defined in the ISO 3166-1 alpha-2 standard.

The gettext format is text-based, and the .po file output format is very similar to the .pot template input format. So a specialized program is not absolutely required. Any text editor which supports UTF-8 can be used.

The Set language option on the login screen lets users select one of the existing translations. See Foldit Translations for more on the existing translations of Foldit.

The sections below describe the process of translating Foldit in detail.

Select an editorEdit

The first step is to select an editor which works with the gettext (.pot and .po) format.

Poedit is freeware, and is available in Windows, Linux, and Mac versions. The freeware version is functional, but there's also a "pro" version, which offers additional features for a fee.

Lokalize is another option, freeware available in Linux and Windows version. There's is also a "Lokalise" translation program, which offers a free trial, but is not freeware.

A specialized editor may be helpful, especially when updating an existing translation. Any text editor with support for UTF-8 encoding can be used, however.

Locate the template fileEdit

The template file foldit.pot is located in the resources/locale directory under the main Foldit directory. The resources directory is updated periodically as part of Foldit's automatic software update process.

The current resources directory has a name like

cmp-resources-releaseid/resources/locale/

where releaseid is a hexadecimal release identifier.

A typical path would look like this:

C:\Foldit\cmp-resources-1e8bcb69156e40a1336e1f920fdaa0a0\resources\locale

This directory contains the template foldit.pot, the existing foldit.cc.po tranlations, and other unrelated files.

Update the template fileEdit

The template file foldit.pot distributed with Foldit is outdated. See additional messages for translation and additional intro puzzle messages for translation for more translatable messages.

The Foldit feedback Translation: messages missing from template file also contains an updated foldit.pot and a test "Slovene" translation, foldit.sl.po, that be used to help determine where untranslated text is appearing. (See the attachments on the most recent feedback comments.)

Load the template fileEdit

Load updated foldit.pot into the selected editor.

The typical steps if using Poedit:

  1. Start Poedit.
  2. Click "Create new translation"
  3. Locate foldit.pot as described in the previous step, and select it
  4. Select a translation language
  5. Begin translating...

The process of translating is described in detail in the next section.

As always, it's best to periodically save your work, regardless of which editor you're using.

When saving, select a directory that is not part of the Foldit installation. Specifically, the resources directory is periodically replaced when Foldit is updated. The old version of the resources directory is deleted when this happens.

Once the translation is complete, you can share it via the client translation list or the add client translation page.

Translate Foldit after loading template fileEdit

Poedit 01

The Foldit template file foldit.pot loaded into the Poedit editor.

Most translatable items, or "messages", are simple, something like this:

Show only my solutions

Using a simple text editor, put the translation of each message that begins with "msgid" in the following area that begins with "msgstr".

In Poedit, simply enter the translation of the source text field into the translation field

Показать мои решения

Some messages have special character sequences. In particular, be aware of backslashes "\" and percent signs "%".

A backslash followed by small case latin "n" is a "newline", "\n". Newlines show where one line of text ends and new one begins in the English version of Foldit.

Your goal is to keep your translation to approximately the same number of lines. For example:

Main\nMenu

is displayed as two lines within a button.

Your translation should try to fit there as well:

Главное\nMenu

The "%" is is generally followed a small latin letter "s" or "d", so "%s" or "%d".

These symbols are placeholders for values that is filled in when you play Foldit. Place them together in the appropriate places within the translated sentence.

  • %s = placeholder for string (sequence of characters)
  • %d = placeholder for number

For example:

Your buddy %s has passed you on puzzle %s

The two "%s" placeholders will be replaced by your buddy's name and the puzzle's title.

The translation might look like this:

Ваш друг %s обогнал Вас в пазле %s

There are currently over 850 messages in Foldit.

Many of the messages contain the same or similar words, such as "password", "wiggle", "shake", "mutate", "band", "open", "close", and so on.

There are also many common science terms, such as "amino acid", "sheet", "loop", "helix", and "helices".

Starting with a good understanding of how to translate these common words and related phrases will probably make the process much easier.

Some of the intro puzzle names, like "Sheets and Ladders", have a whimsical quality, that may be difficult to translate. ("Sheets and Ladders" is a play on the name of the board game "Snakes and Ladders", for example.)

One estimate from several years ago was it takes around 10 to 20 hours to translate the messages.

Merging an existing translation with a new template fileEdit

As discussed above, the template file foldit.pot may be updated on occassion. Messages be be added, changed, or deleted.

Poedit and similar editors simplify the process of updating an existing translation in this case.

In Poedit, open the existing translation, then select "Catalog -> Update from POT file... and locate the new version of foldit.pot.

The new and modified messages from foldit.pot will be merged into the translation file.

To Do and MiscellaneousEdit

  • Discuss use of translation memory
  • Discuss crowdsourcing translations
  • Need discussion of UTF-8 and different operating systems
  • Need discussion of testing a new translation. = See create mo on the Foldit website. The .mo is the "machine object" created from a .po file.
  • Linux notes:
    • It may be prudent to save the current foldit.pot in the same directory as language.po so changes can be detected. Use msgmerge to update language.po file with the newer foldit.pot. Check the head of the file for "POT-Creation-Date"
    • msgfmt converts language.po to language.mo
    • GNU gettext documentation has in-depth information
    • It is possible to combine multiple *.po files into a compendium using msgcat. This has not yet been tested
    • Use msggrep to match patterns in *.po files
    • Use msgfilter to take an existing language file and adapt for another dialect
    • To determine translation string count:
egrep -c msgid cmp-resources-releaseid/resources/locale/foldit.pot
    • Subtract 1 since the first msgid is blank
Community content is available under CC-BY-SA unless otherwise noted.