Fix some easy to find double translations
[pacman-ng.git] / doc / translation-help.txt
blob5be15dffebd50e03a658d0d1c6d7eff957bec1f5
1 Pacman - Translating
2 ====================
4 This document is here to guide you in helping translate pacman messages,
5 libalpm messages, and the manpages for the entire pacman package.
7 We are currently using http://www.transifex.net/[Transifex] as the translation
8 platform for pacman and libalpm. You will need to sign up for an account there
9 and then register with a translation team on the
10 http://www.transifex.net/projects/p/archlinux-pacman/[pacman project page].
12 NOTE: This may be old information due to our switch to Transifex, but the
13 gettext website is a very useful guide to read before embarking on translation
14 work, as it describes many of the commands in more detail than I will here:
15 http://www.gnu.org/software/gettext/manual/html_node/gettext.html[].  In
16 addition, this site presents a small tutorial that I found useful:
17 http://oriya.sarovar.org/docs/gettext/[].
20 Translating Messages
21 --------------------
23 Overview
24 ~~~~~~~~
26 There are two separate message catalogs in pacman- one for the backend
27 (libalpm) and one for the frontend (pacman and scripts). These correspond to
28 the `lib/libalpm/po` and `po` directories in the pacman source, respectively.
30 Translation message files are a specially formatted text file containing the
31 original message and the corresponding translation. These po files can then
32 either be hand edited, or modified with a tool such as poedit, gtranslator or
33 kbabel. Using a translation tool tends to make the job easier.
35 Please read up on Transifex usage using the
36 http://help.transifex.net/[Transifex Help] if you are not familiar.
38 See the <<Notes,Notes>> section for additional hints on translating.
40 Pre-release Updates
41 ~~~~~~~~~~~~~~~~~~~
43 A week or two before each release, the codebase will go into a string freeze
44 and an email will be sent to the mailto:pacman-dev@archlinux.org[pacman-dev]
45 mailing list asking for translations. This email will have a prefix of
46 *[translation]* for anyone looking to set up an email filter.
48 At this time, the latest `.po` language files will be made available at the
49 Transifex project page.  Each language will have two files available (backend
50 and frontend). Translators interested in helping are encouraged to use the
51 features of Transifex to let others know they are currently translating their
52 language.
54 Once a translator has completed the translation (*OR* realizes they do not have
55 time to finish), please upload your progress back to the Transifex site.
57 NOTE: Please upload your translations as soon as possible- this will give other
58 speakers of your language time to review your translations and update them as
59 necessary.
61 Incremental Updates
62 ~~~~~~~~~~~~~~~~~~~
64 If you have more advanced needs you will have to get a copy of the pacman
65 repository.
67     git clone git://projects.archlinux.org/pacman.git pacman
69 Next, you will need to run `./autogen.sh` and `./configure` in the base
70 directory to generate the correct Makefiles. At this point, all necessary
71 make targets will be generated and we can begin updating the translation
72 files.
74 We need to first update the main message catalog file. Navigate into either the
75 `lib/libalpm/po` or `po` directory depending on which translation you wish to
76 work on first, and execute the following command.  If you are working in the
77 `po/` tree, replace 'libalpm.pot' with 'pacman.pot':
79     make libalpm.pot-update
81 Next, update your specific language's translation file:
83     make <po file>-update
85 At this point, you can do the translation. To submit your changes, either email
86 the new `.po` file to the mailing-list with *[translation]* in the subject, or
87 submit a GIT-formatted patch (please do not include any `.pot` file changes).
89 As a shortcut, all translation files (including `.pot` files) can be updated
90 with the following command:
92     make update-po
94 Adding a New Language
95 ~~~~~~~~~~~~~~~~~~~~~
97 Making a new language is not too hard, but be sure to follow all the steps.
98 You will have to do the following steps in both the `lib/libalpm/po/` and `po/`
99 directories, substituting where appropriate. First, edit the `LINGUAS` file and
100 add your new language code at the bottom. Next, run the following command,
101 substituting 'libalpm.pot' or 'pacman.pot' for potfile depending on which
102 directory you are currently working in:
104         msginit -l <lang code> -o <lang code>.po -i <potfile>
106 You can then also add your language code to the end of the `LINGUAS` file
107 located in each po directory.
109 Look at the current message files for more guidance if necessary. Once you
110 create the new language file, you may need to slightly modify the headers;
111 try to make them look similar to the other .po file headers. In addition, for
112 all new translations we would strongly recommend using UTF-8 encoding.
114 Notes[[Notes]]
115 ~~~~~~~~~~~~~~
117 msgid and msgstr 'variables' can be on as many lines as necessary. Line breaks
118 are ignored- if you need a literal line break, use an `\n` in your string. The
119 following two translations are equivalent:
121     msgstr "This is a test translation"
123     msgstr ""
124     "This is a test translation"
126 If you want to test the translation (for example, the frontend one):
128     rm *.gmo stamp-po
129     make
130     cp <lang code>.gmo /usr/share/locale/<lang code>/LC_MESSAGES/pacman.mo
133 Translating Manpages
134 --------------------
136 There are currently no efforts underway to include translated manpages in the
137 pacman codebase. However, this is not to say translations are unwelcome. If
138 someone has experience with i18n manpages and how to best include them with our
139 source, please contact the pacman-dev mailing list at
140 mailto:pacman-dev@archlinux.org[].
142 Some community efforts have been made to translate manpages, and these can be
143 found in the link:http://aur.archlinux.org[AUR] (Arch User Repository). Please
144 check there first before undergoing a translation effort to ensure you are not
145 duplicating efforts.
147 /////
148 vim: set ts=2 sw=2 syntax=asciidoc et:
149 /////