Project

General

Profile

Development git patches » History » Version 4

« Previous - Version 4/15 (diff) - Next » - Current version
tan, 12/30/2009 01:40 AM
First workable version complete, added information on the process of keeping a translation up to date


Creating Translation git patches

About these instructions

There are two sets of instructions here; one for first-time setup, one for already existing setups.

First-time setup

1. Create a directory to hold the git repository

$ mkdir quassel-dev
$ cd quassel-dev

2. Create a git copy of the master from git.quassel-irc.org

$ git clone git://git.quassel-irc.org/quassel.git

3. Change into your new copy of the git repository

$ cd quassel

4. Set your personal preferences

$ git config --global user.name "Your full name here" 
$ git config --global user.email "your.email@address.here"

5. At this point you have your very own working copy of the central git repository which you can make changes to. Now is a good time to fire up your favorite .po-editor, and start editing your language file (you should edit the file in your local git repository).
As an example based on the path I've used here, the Norwegian Bokmaal translation file:

~/quassel-dev/quassel/po/quassel_nb_NO.po

When you have edited the file(s), you should follow the steps in the "Existing setups" below to create the git patch file(s).

Existing setups

Here, I assume you have either followed the instructions above, or already have a git repository clone from the master.
Also, I expect that you are inside the local 'quassel' repository as per 3. in the "First-time setup" above.

1. If you want to keep your local repository up to date with the central one, you just need to synchronize

$ git pull --rebase

2. After you have done your changes to the .po file for your language, you can chech that the changes are recorded by git
(all your changes will be shown, press <space> to move one page further, and <q> to stop showing the differences/changes)

$ git diff

3. Then it's time to add your changes to the local index

$ git add .

4. You then commit the changes you have done (which will give some feedback like the one I've provided below)
(You should change the "Fixed some small inconsistencies" tekst with some short description of your changes)

$ git commit -m "Fixed some small inconsistencies." 
[master edc8b8a] Fixed some small inconsistencies.
 1 files changed, 8 insertions(+), 9 deletions(-)

5. You can now check the status of you git repository (which will give some feedback like the one I've provided below)

$ git status
# On branch master
# Your branch is ahead of 'origin/master' by 1 commit.
#
nothing to commit (working directory clean)

6. You then create the actual patch-file (note that the name of the file is the description provided in 4. above)

$ git format-patch origin/master
0001-Fixed-some-small-inconsistencies.patch

7. Congratulations! :-)
This file is now ready and you can send it to: devel at quassel-irc.org.

The Process

The process of keeping a translation up to date, is simply summed up as "git add / commit / format-patch".
But you also need to follow what's written in the README.Translations file in the 'quassel/po' directory. Here's an excerpt from it:

In order to create or update a translatable file, run the following command
in the directory i18n/:

./update.sh xx

where xx is the two-letter language code according to ISO 639 (which,
if needed, may be suffixed by a country code according to ISO 3166).
Quassel will automatically load these translation files based on the
system locale. Examples for valid codes: de, en_US

You can open translation files with poedit for example and add/edit translated strings.

The *.po files can and should be kept in sync with the source code by running
update.sh regularly (existing translations won't be removed).

NOTE: Remember to remove X-Virgin-Header line if you want to preserve your header.

Note that the X-Virgin-Header line referred to above, is inside the .po-file for your language.