So you want to have PledgeBank in your own language? We've hopefully made it relatively straightforward.
Firstly, do contact us so we can keep track of things, and perhaps put you in touch with other people translating into the same language. Also, sign up to our mailing list to discuss translations.
Do let us know if there's anything below that is hard to understand. The instructions assume you're running Windows, apologies for that – users of other operating systems should be able to work out what similar steps to take.
There are two ways to translate the file - manually or using poEdit, a program to help with translations. If you're new at translating, I recommend using poEdit, as it keeps track of untranslated strings and things like that.
If there are any problems or questions at any stage, contact us or ask on the mailing list.
% placeholders: Sadly, these are a bit more complicated. The first are % placeholders. These appear within text and stand for something missing – %d means a number, %s means some more text. For example, a sentence to give the colour of a cat and its size, in Spanish:
"The cat is %s and %d centimetres long." "El gato tiene %s y %d centímetros de largo."
The colours would be translated separately elsewhere in the file. If a situation arises where you need to refer to the % placeholders in a different order from the English, you need to specify which placeholder goes where. Here's an example, but ask if this comes up in your translation (hopefully it won't :) ) :
"I have %s the %s." (I have read the book.) "Ich habe das %2$s %1$s." (Ich habe das Buch gelesen.)
For example, in French:
msgid "The cat is black." msgstr "Le chat est noir."
If the translated line needs to include a double quote, you put a slash before it. For example, in German:
msgid "He said \"I like cheese.\"" msgstr "Er sagte \"Ich liebe Käse.\""
If it is a large block to be translated, it will be on more than one line. To show this, the first line is the empty string "", with the original or translated text on further lines; "\n" is used to mean a new line. For example, in Italian:
msgid "" "I have 2 dogs, 1 cat, 1 guinea pig and a giraffe.\n" "The giraffe has a long neck, and the two dogs are" "called Bill and Ben." msgstr "" "Ho 2 cani, 1 gatto, 1 cavia e un giraffe.\n" "Il giraffe ha un collo lungo ed i due cani sono" "denominati Bill e Ben."
% placeholders: Sadly, there are a couple of things that makes things a bit more complicated. The first are % placeholders. These appear within text and stand for something missing – %d means a number, %s means some more text. For example, a sentence to give the colour of a cat and its size, in Spanish:
msgid "The cat is %s and %d centimetres long." msgstr "El gato tiene %s y %d centímetros de largo."
The colours would be translated separately elsewhere in the file. If a situation arises where you need to refer to the % placeholders in a different order from the English, you need to specify which placeholder goes where. Here's an example, but ask if this comes up in your translation (hopefully it won't :) ) :
msgid "I have %s the %s." (I have read the book.) msgstr "Ich habe das %2$s %1$s." (Ich habe das Buch gelesen.)
Plurals: These are the other more complicated thing. These use % placeholders to give different results depending on the value of a number. It's probably easiest if I just give an example, in Portuguese:
msgid "I have %d dog." msgid_plural "I have %d dogs." msgstr[0] "Eu tenho %d cão." msgstr[1] "Eu tenho %d cães."
Some languages have three plurals – simply add a msgstr[2] line for the third, and I can sort out making sure it uses the right one.
Matthew Somerville
13th November 2005