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