2008-01-06 17:14:18 -05:00
|
|
|
Pacman - Translating
|
|
|
|
====================
|
2007-02-07 01:15:56 -05:00
|
|
|
|
|
|
|
This document is here to guide you in helping translate pacman messages,
|
|
|
|
libalpm messages, and the manpages for the entire pacman package.
|
|
|
|
|
|
|
|
A quick note- the gettext website is a very useful guide to read before
|
|
|
|
embarking on translation work, as it describes many of the commands in more
|
|
|
|
detail than I will here:
|
2008-01-06 17:14:18 -05:00
|
|
|
http://www.gnu.org/software/gettext/manual/html_node/gettext.html[]
|
2007-02-07 01:15:56 -05:00
|
|
|
|
|
|
|
In addition, this site presents a small tutorial that I found useful:
|
2008-01-06 17:14:18 -05:00
|
|
|
http://oriya.sarovar.org/docs/gettext/[]
|
2007-02-07 01:15:56 -05:00
|
|
|
|
|
|
|
Translating Messages
|
|
|
|
--------------------
|
|
|
|
|
2007-12-19 18:05:03 -05:00
|
|
|
The message files are located in two directories in pacman- lib/libalpm/po/ for
|
|
|
|
the translation of the backend, and po/ for the translation of the frontend and
|
|
|
|
the scripts.
|
|
|
|
Each language has a .po file associated with it; the .pot file is the template
|
|
|
|
file for creating new .po files and updating the messages in them when the code
|
|
|
|
changes.
|
2007-02-07 01:15:56 -05:00
|
|
|
|
2008-01-06 17:14:18 -05:00
|
|
|
First things first. If you haven't already, you will need to get a copy of the
|
|
|
|
pacman repository.
|
|
|
|
|
|
|
|
git clone git://projects.archlinux.org/pacman.git pacman
|
|
|
|
|
|
|
|
Next, you will need to run `./autogen.sh` and `./configure` in the base
|
|
|
|
directory to generate the correct Makefiles. To update all the translation
|
|
|
|
files, run this command in one of the two message file directories:
|
|
|
|
|
|
|
|
make update-po
|
2007-02-07 01:15:56 -05:00
|
|
|
|
2007-02-12 11:19:35 -05:00
|
|
|
At this point, the .pot file is regenerated from the source code with an
|
|
|
|
updated string list, and the existing po files are merged if necessary to add
|
|
|
|
new messages or remove old ones. These po files can then either be hand edited,
|
2007-12-19 18:05:03 -05:00
|
|
|
or modified with a tool such as poedit, gtranslator or kbabel.
|
2007-02-12 11:19:35 -05:00
|
|
|
|
|
|
|
These steps make it easier to just update your language and not every po file.
|
2008-01-06 17:14:18 -05:00
|
|
|
If you are working in the `po/` tree, replace 'libalpm.pot' with 'pacman.pot':
|
|
|
|
|
|
|
|
make libalpm.pot-update
|
|
|
|
make <po file>-update
|
2007-02-07 01:15:56 -05:00
|
|
|
|
|
|
|
Making a new language is not too hard, but be sure to follow all the steps.
|
2008-01-06 17:14:18 -05:00
|
|
|
You will have to do the following steps in both the `lib/libalpm/po/` and `po/`
|
|
|
|
directories, substituting where appropriate. First, edit the `LINGUAS` file and
|
2007-12-19 18:05:03 -05:00
|
|
|
add your new language code at the bottom. Next, run the following command,
|
2008-01-06 17:14:18 -05:00
|
|
|
substituting 'libalpm.pot' or 'pacman.pot' for potfile depending on which
|
|
|
|
directory you are currently working in:
|
|
|
|
|
2007-02-07 01:15:56 -05:00
|
|
|
msginit -l <lang code> -o <lang code>.po -i <potfile>
|
|
|
|
|
2008-01-06 17:14:18 -05:00
|
|
|
You can then also add your language code to the end of the `LINGUAS` file
|
|
|
|
located in each po directory.
|
2007-03-07 11:57:22 -05:00
|
|
|
|
2007-02-07 01:15:56 -05:00
|
|
|
Look at the current message files for more guidance if necessary. Once you
|
|
|
|
create the new language file, you may need to slightly modify the headers;
|
|
|
|
try to make them look similar to the other .po file headers. In addition, for
|
|
|
|
all new translations we would strongly recommend using UTF-8 encoding.
|
|
|
|
|
2007-12-19 18:05:03 -05:00
|
|
|
If you want to test the translation (for example, the frontend one):
|
2008-01-06 17:14:18 -05:00
|
|
|
|
|
|
|
rm *.gmo stamp-po
|
|
|
|
make
|
|
|
|
cp <lang code>.gmo /usr/share/locale/<lang code>/LC_MESSAGES/pacman.mo
|
2007-12-19 18:05:03 -05:00
|
|
|
|
2007-03-07 11:57:22 -05:00
|
|
|
Finally, submitting your translations in patch form is not essential for new
|
|
|
|
languages, but highly recommended for future updates to the translations.
|
|
|
|
|
2008-01-06 17:14:18 -05:00
|
|
|
Notes
|
|
|
|
~~~~~
|
|
|
|
|
2007-03-07 11:57:22 -05:00
|
|
|
msgid and msgstr 'variables' can be on as many lines as necessary. Line breaks
|
2008-01-06 17:14:18 -05:00
|
|
|
are ignored- if you need a literal line break, use an `\n` in your string. The
|
2007-03-07 11:57:22 -05:00
|
|
|
following two translations are equivalent:
|
2007-02-16 17:04:23 -05:00
|
|
|
|
2008-01-06 17:14:18 -05:00
|
|
|
msgstr "This is a test translation"
|
2007-02-16 17:04:23 -05:00
|
|
|
|
2008-01-06 17:14:18 -05:00
|
|
|
msgstr ""
|
|
|
|
"This is a test translation"
|
2007-02-16 17:04:23 -05:00
|
|
|
|
|
|
|
|
2007-02-07 01:15:56 -05:00
|
|
|
Translating Manpages
|
|
|
|
--------------------
|
|
|
|
|
|
|
|
(To Be Announced)
|
|
|
|
|
2008-01-06 17:14:18 -05:00
|
|
|
/////
|
|
|
|
vim: set ts=2 sw=2 syntax=asciidoc et:
|
|
|
|
/////
|