Project

General

Profile

Development git patches » History » Version 9

tan, 02/27/2010 08:33 PM
added a link to Sput's blog about rosetta

1 1 tan
h1. Creating Translation git patches
2 1 tan
3 1 tan
{{toc}}
4 1 tan
5 9 tan
*Warning! For translators, as of 27. Feb 2010 - read this:* http://quassel-irc.org/node/109
6 9 tan
7 1 tan
h2. About these instructions
8 1 tan
9 1 tan
There are two sets of instructions here; one for first-time setup, one for already existing setups.
10 1 tan
11 1 tan
h2. First-time setup
12 1 tan
13 1 tan
1. Create a directory to hold the git repository
14 1 tan
<pre>$ mkdir quassel-dev
15 1 tan
$ cd quassel-dev</pre>
16 1 tan
17 1 tan
2. Create a git copy of the master from git.quassel-irc.org
18 1 tan
<pre>$ git clone git://git.quassel-irc.org/quassel.git</pre>
19 1 tan
20 1 tan
3. Change into your new copy of the git repository
21 1 tan
<pre>$ cd quassel</pre>
22 1 tan
23 3 tan
4. Set your personal preferences
24 3 tan
<pre>$ git config --global user.name "Your full name here"
25 3 tan
$ git config --global user.email "your.email@address.here"</pre>
26 1 tan
27 1 tan
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).
28 1 tan
As an example based on the path I've used here, the Norwegian Bokmaal translation file: <pre>~/quassel-dev/quassel/po/quassel_nb_NO.po</pre>
29 1 tan
30 2 tan
When you have edited the file(s), you should follow the steps in the "Existing setups" below to create the git patch file(s).
31 1 tan
32 1 tan
h2. Existing setups
33 1 tan
34 1 tan
Here, I assume you have either followed the instructions above, or already have a git repository clone from the master.
35 4 tan
Also, I expect that you are inside the local 'quassel' repository as per 3. in the "First-time setup" above.
36 1 tan
37 4 tan
1. If you want to keep your local repository up to date with the central one, you just need to synchronize
38 4 tan
<pre>$ git pull --rebase</pre>
39 4 tan
40 8 tan
2. After you have done your changes to the .po file for your language, you can check that the changes are recorded by git
41 1 tan
(all your changes will be shown, press <space> to move one page further, and <q> to stop showing the differences/changes)
42 3 tan
<pre>$ git diff</pre>
43 1 tan
44 7 tan
3. Then it's time to add your changes to the local index (change <path-to-file> with complete path to your .po-file)
45 7 tan
<pre>$ git add <path-to-file></pre>
46 3 tan
47 4 tan
4. You then commit the changes you have done (which will give some feedback like the one I've provided below)
48 6 tan
(You should change the "Fixed some small inconsistencies" text with some short description of your changes)
49 3 tan
<pre>$ git commit -m "Fixed some small inconsistencies."
50 3 tan
[master edc8b8a] Fixed some small inconsistencies.
51 3 tan
 1 files changed, 8 insertions(+), 9 deletions(-)</pre>
52 3 tan
53 4 tan
5. You can now check the status of you git repository (which will give some feedback like the one I've provided below)
54 1 tan
<pre>$ git status
55 3 tan
# On branch master
56 3 tan
# Your branch is ahead of 'origin/master' by 1 commit.
57 1 tan
#
58 1 tan
nothing to commit (working directory clean)</pre>
59 1 tan
60 4 tan
6. You then create the actual patch-file (note that the name of the file is the description provided in 4. above)
61 1 tan
<pre>$ git format-patch origin/master
62 1 tan
0001-Fixed-some-small-inconsistencies.patch</pre>
63 4 tan
64 4 tan
7. Congratulations! :-) 
65 4 tan
This file is now ready and you can send it to: devel _at_ quassel-irc.org.
66 4 tan
67 4 tan
h2. The Process
68 4 tan
69 4 tan
The process of keeping a translation up to date, is simply summed up as "git add / commit / format-patch".
70 4 tan
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:
71 4 tan
72 4 tan
bq. In order to create or update a translatable file, run the following command
73 5 tan
in the directory po/:
74 4 tan
75 4 tan
bq. ./update.sh xx
76 4 tan
77 4 tan
bq. where xx is the two-letter language code according to ISO 639 (which,
78 4 tan
if needed, may be suffixed by a country code according to ISO 3166).
79 4 tan
Quassel will automatically load these translation files based on the
80 4 tan
system locale. Examples for valid codes: de, en_US
81 4 tan
82 4 tan
bq. You can open translation files with poedit for example and add/edit translated strings.
83 4 tan
84 4 tan
bq. The *.po files can and should be kept in sync with the source code by running
85 4 tan
update.sh regularly (existing translations won't be removed).
86 4 tan
87 4 tan
bq. NOTE: Remember to remove X-Virgin-Header line if you want to preserve your header.
88 4 tan
89 4 tan
Note that the X-Virgin-Header line referred to above, is inside the .po-file for your language.