Project

General

Profile

Development translations » History » Version 1

johu, 08/27/2010 01:02 PM
copied stuff from old page

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