Translations
------------

TortoiseSVN is still in development so translations of all resources is
also a work 'in progress'.

General
-------
The TortoiseSVN project uses gettext PO (portable object) files for its
translation. PO files are plain text, so you can even translate using a
normal text editor. The only thing you have to take care of is that the
editor can handle the UTF-8 charset. There is a wide range of tools out
there that can handle and manipulate PO files.
We recommend that you use Poedit (http://poedit.sourceforge.net) on Windows
or Virtaal (http://translate.sourceforge.net/wiki/virtaal/index)
which is platform independent.

This description assumes that you use poEdit.

Getting started
---------------
If you want to implement a new language for TortoiseSVN do the following.

1) Use TortoiseSVN (or any other SubVersion client) to check out:
   https://svn.code.sf.net/p/tortoisesvn/code/trunk/Languages/
   (You will get more than one file)
   or point your browser to:
   https://svn.code.sf.net/p/tortoisesvn/code/trunk/Languages
   right-click on Tortoise.pot and save this file to your local harddisk.
   Tortoise.pot is the portable object template (hence .pot) for the
   translation.

2) Rename Tortoise.pot to Tortoise_xx.po, where xx is your two letter
   ISO-639-1 language code. Look up your language code here:
   http://www.loc.gov/standards/iso639-2/langcodes.html
   If you want to translate into a language that has two different locales
   and you *really* need the second locale, add the two letter ISO-3166
   locale code. If you're not sure about your country code, look here:
   http://www.iso.ch/iso/en/prods-services/iso3166ma/02iso-3166-code-lists/list-en1.html.
   Please keep in mind that we would like to have as few translations as
   possible that cover as many languages as possible. We would not be
   very happy at having to maintain a (de_CH) Swiss German, (de_AT)
   Austrian German and (de_DE) German German translation. :-)
   But if it's necessary like in Chinese, sure go ahead. We are happy with
   simplified (zh_CN) and traditional (zh_TW) Chinese.

3) Now translate what you can using your po editor. If you are not sure
   with one or the other translation, mark it as "fuzzy". You can enter
   a comment in poEdit to give some information about your thoughts to
   other translators.
   If you are not sure about the meaning of the original sentence ask on
   the list.

4) Add a header with '#' comments to the PO file using a normal text edi-
   tor that explains which language you translated and the terminology
   you used, like:
   #
   # German translations for TortoiseSVN
   # This file is distributed under the same license as the subversion package.
   #
   # Translation dictionary:
   #
   # argument     parameter
   # bogus        ungültig
   # checkout     auschecken (denglisch, ich weiß, aber akzeptabel)
   # client       Client, des Client
   # commit       übertragen
   # item         Objekt
   # label        Marke / Markierung

5) Make sure your file is saved in UTF-8 encoding and that it does *not*
   begin with UTF-8 BOMs (Byte Order Marks)

6) Send your Tortoise_xx.po to the mailing list (translators@tortoisesvn.tigris.org).
   or, if you have a SourceForge account (http://sourceforge.net), request
   commit access to the project via the translators mailing list, you may
   commit your translations directory to the TortoiseSVN repository.

Adding to an existing translation
---------------------------------
1) Get hold of Tortoise.pot and the Tortoise_xx.po you want to improve

2) Start poEdit with Tortoise_xx.po and select "Update from .pot file"
   from the "Catalog" Menu

3) Select Tortoise.pot and wait until poEdit has finished merging the
   template and the current translation.

4) The untranslated strings (and fuzzy translations) are always at the
   top of the list.

5) Translate what you can and send the resulting PO file back to the
   mailing list (translators@tortoisesvn.tigris.org).


Important
---------
Please pay special attention to cases where placeholders for variables like
"%s" or "%d" appear in the original text. They have to be in the exact
same order in the translation, which means that you sometimes have to
use "bad" grammar  in your language. If you reverse the parameters
it may crash the translated application.

Format your translation
--------------------------
Please format your translation before send Tortoise_xx.po to the
mailing list, or commit to the TortoiseSVN repository. You can do it
like this:
    $ msgmerge --no-wrap -o Tortoise_xx.po.new Tortoise_xx.po Tortoise.pot
    $ mv -f Tortoise_xx.po.new Tortoise_xx.po

This can minimize the svn diff output, reviewing your translation is easy.

What now?
---------
That's all you have to do. We'll take care of creating the resource dlls
and installers for the different language packs.

Building your own dlls
----------------------
If you want to test the translations you made yourself, before you release
them, you need four things:

- The "raw" language resource dlls for your version of TortoiseSVN. Please ask on
  the developers list. We'll gladly provide you with the necessary files.
- The pot file for your version of TortoiseSVN e.g:
  https://svn.code.sf.net/p/tortoisesvn/code/tags/version_1.0.8/...
- Any po file for your language. Either pick one from tags or the latest
  po file from trunk
- The ResText utility that is used to insert the data from the po file
  into your resource dlls:
  http://tortoisesvn.tigris.org/files/documents/406/14560/ResText.zip

Once you finished your installation, you run:

restext apply TortoiseProcLang.dll ..\bin\TortoiseProcNNNN.dll Tortoise_CC.po
restext apply TortoiseMergeLang.dll ..\bin\TortoiseMergeNNNN.dll Tortoise_CC.po

where NNNN is your four digit country code (1031 for germany)
and CC is your 2 letter country code (de for germany)

You can find the four digit country code at
http://www.microsoft.com/globaldev/reference/lcid-all.mspx
under the column LCID dec.

After successfully creating your dlls, copy them into:
C:\Program Files\TortoiseSVN\Languages
Now you should be able to select your language from the combobox on the
TortoiseSVN main setting page.
