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.
|
|
|
|
|
2011-02-28 12:08:01 -05:00
|
|
|
We are currently using http://www.transifex.net/[Transifex] as the translation
|
|
|
|
platform for pacman and libalpm. You will need to sign up for an account there
|
|
|
|
and then register with a translation team on the
|
|
|
|
http://www.transifex.net/projects/p/archlinux-pacman/[pacman project page].
|
2007-02-07 01:15:56 -05:00
|
|
|
|
2011-02-28 12:08:01 -05:00
|
|
|
NOTE: This may be old information due to our switch to Transifex, but 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:
|
|
|
|
http://www.gnu.org/software/gettext/manual/html_node/gettext.html[]. In
|
|
|
|
addition, this site presents a small tutorial that I found useful:
|
|
|
|
http://oriya.sarovar.org/docs/gettext/[].
|
2007-02-07 01:15:56 -05:00
|
|
|
|
2008-01-07 22:42:19 -05:00
|
|
|
|
2007-02-07 01:15:56 -05:00
|
|
|
Translating Messages
|
|
|
|
--------------------
|
|
|
|
|
2008-01-07 22:42:19 -05:00
|
|
|
Overview
|
|
|
|
~~~~~~~~
|
|
|
|
|
|
|
|
There are two separate message catalogs in pacman- one for the backend
|
|
|
|
(libalpm) and one for the frontend (pacman and scripts). These correspond to
|
|
|
|
the `lib/libalpm/po` and `po` directories in the pacman source, respectively.
|
|
|
|
|
|
|
|
Translation message files are a specially formatted text file containing the
|
|
|
|
original message and the corresponding translation. These po files can then
|
|
|
|
either be hand edited, or modified with a tool such as poedit, gtranslator or
|
|
|
|
kbabel. Using a translation tool tends to make the job easier.
|
|
|
|
|
2011-02-28 12:08:01 -05:00
|
|
|
Please read up on Transifex usage using the
|
|
|
|
http://help.transifex.net/[Transifex Help] if you are not familiar.
|
|
|
|
|
2011-03-21 00:37:56 -04:00
|
|
|
Here is an example set of commands if you have a source code checkout and are
|
|
|
|
not worried about any local translations being overwritten. The .tx/ directory
|
|
|
|
is checked into the git repository so is preconfigured with the two project
|
|
|
|
resources (See `tx status` output for a quick overview).
|
|
|
|
|
2011-06-22 12:06:34 -04:00
|
|
|
tx pull -f
|
|
|
|
poedit po/<mylang>.po
|
|
|
|
poedit lib/libalpm/po/<mylang>.po
|
|
|
|
tx push -t -l <mylang>
|
2011-03-21 00:37:56 -04:00
|
|
|
|
|
|
|
Or to just push one of the two available resources:
|
|
|
|
|
2011-06-22 12:06:34 -04:00
|
|
|
tx push -r archlinux-pacman.pacman-pot -t -l fi
|
|
|
|
tx push -r archlinux-pacman.libalpm-pot -t -l fi
|
2011-03-21 00:37:56 -04:00
|
|
|
|
2008-01-07 22:42:19 -05:00
|
|
|
See the <<Notes,Notes>> section for additional hints on translating.
|
|
|
|
|
|
|
|
Pre-release Updates
|
|
|
|
~~~~~~~~~~~~~~~~~~~
|
|
|
|
|
|
|
|
A week or two before each release, the codebase will go into a string freeze
|
2011-02-28 12:08:01 -05:00
|
|
|
and an email will be sent to the mailto:pacman-dev@archlinux.org[pacman-dev]
|
|
|
|
mailing list asking for translations. This email will have a prefix of
|
|
|
|
*[translation]* for anyone looking to set up an email filter.
|
2008-01-07 22:42:19 -05:00
|
|
|
|
2011-02-28 12:08:01 -05:00
|
|
|
At this time, the latest `.po` language files will be made available at the
|
|
|
|
Transifex project page. Each language will have two files available (backend
|
|
|
|
and frontend). Translators interested in helping are encouraged to use the
|
|
|
|
features of Transifex to let others know they are currently translating their
|
|
|
|
language.
|
2008-01-07 22:42:19 -05:00
|
|
|
|
|
|
|
Once a translator has completed the translation (*OR* realizes they do not have
|
2011-02-28 12:08:01 -05:00
|
|
|
time to finish), please upload your progress back to the Transifex site.
|
2007-02-07 01:15:56 -05:00
|
|
|
|
2011-02-28 12:08:01 -05:00
|
|
|
NOTE: Please upload your translations as soon as possible- this will give other
|
|
|
|
speakers of your language time to review your translations and update them as
|
|
|
|
necessary.
|
2008-01-07 22:42:19 -05:00
|
|
|
|
|
|
|
Incremental Updates
|
|
|
|
~~~~~~~~~~~~~~~~~~~
|
|
|
|
|
|
|
|
If you have more advanced needs you will have to get a copy of the pacman
|
|
|
|
repository.
|
2008-01-06 17:14:18 -05:00
|
|
|
|
2011-06-22 12:06:34 -04:00
|
|
|
git clone git://projects.archlinux.org/pacman.git pacman
|
2008-01-06 17:14:18 -05:00
|
|
|
|
|
|
|
Next, you will need to run `./autogen.sh` and `./configure` in the base
|
2008-01-07 22:42:19 -05:00
|
|
|
directory to generate the correct Makefiles. At this point, all necessary
|
|
|
|
make targets will be generated and we can begin updating the translation
|
|
|
|
files.
|
2008-01-06 17:14:18 -05:00
|
|
|
|
2008-01-07 22:42:19 -05:00
|
|
|
We need to first update the main message catalog file. Navigate into either the
|
|
|
|
`lib/libalpm/po` or `po` directory depending on which translation you wish to
|
|
|
|
work on first, and execute the following command. If you are working in the
|
|
|
|
`po/` tree, replace 'libalpm.pot' with 'pacman.pot':
|
2007-02-07 01:15:56 -05:00
|
|
|
|
2011-06-22 12:06:34 -04:00
|
|
|
make libalpm.pot-update
|
2007-02-12 11:19:35 -05:00
|
|
|
|
2008-01-07 22:42:19 -05:00
|
|
|
Next, update your specific language's translation file:
|
2008-01-06 17:14:18 -05:00
|
|
|
|
2011-06-22 12:06:34 -04:00
|
|
|
make <po file>-update
|
2007-02-07 01:15:56 -05:00
|
|
|
|
2008-01-07 22:42:19 -05:00
|
|
|
At this point, you can do the translation. To submit your changes, either email
|
|
|
|
the new `.po` file to the mailing-list with *[translation]* in the subject, or
|
|
|
|
submit a GIT-formatted patch (please do not include any `.pot` file changes).
|
|
|
|
|
|
|
|
As a shortcut, all translation files (including `.pot` files) can be updated
|
|
|
|
with the following command:
|
|
|
|
|
2011-06-22 12:06:34 -04:00
|
|
|
make update-po
|
2008-01-07 22:42:19 -05:00
|
|
|
|
|
|
|
Adding a New Language
|
|
|
|
~~~~~~~~~~~~~~~~~~~~~
|
|
|
|
|
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.
|
|
|
|
|
2008-01-07 22:42:19 -05:00
|
|
|
Notes[[Notes]]
|
|
|
|
~~~~~~~~~~~~~~
|
2008-01-06 17:14:18 -05:00
|
|
|
|
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
|
|
|
|
2011-06-22 12:06:34 -04:00
|
|
|
msgstr "This is a test translation"
|
2007-02-16 17:04:23 -05:00
|
|
|
|
2011-06-22 12:06:34 -04:00
|
|
|
msgstr ""
|
|
|
|
"This is a test translation"
|
2007-02-16 17:04:23 -05:00
|
|
|
|
2008-01-07 22:42:19 -05:00
|
|
|
If you want to test the translation (for example, the frontend one):
|
|
|
|
|
2011-06-22 12:06:34 -04:00
|
|
|
rm *.gmo stamp-po
|
|
|
|
make
|
|
|
|
cp <lang code>.gmo /usr/share/locale/<lang code>/LC_MESSAGES/pacman.mo
|
2008-01-07 22:42:19 -05:00
|
|
|
|
2007-02-16 17:04:23 -05:00
|
|
|
|
2007-02-07 01:15:56 -05:00
|
|
|
Translating Manpages
|
|
|
|
--------------------
|
|
|
|
|
2008-01-07 22:42:19 -05:00
|
|
|
There are currently no efforts underway to include translated manpages in the
|
|
|
|
pacman codebase. However, this is not to say translations are unwelcome. If
|
|
|
|
someone has experience with i18n manpages and how to best include them with our
|
|
|
|
source, please contact the pacman-dev mailing list at
|
|
|
|
mailto:pacman-dev@archlinux.org[].
|
|
|
|
|
|
|
|
Some community efforts have been made to translate manpages, and these can be
|
|
|
|
found in the link:http://aur.archlinux.org[AUR] (Arch User Repository). Please
|
|
|
|
check there first before undergoing a translation effort to ensure you are not
|
|
|
|
duplicating efforts.
|
2007-02-07 01:15:56 -05:00
|
|
|
|
2008-01-06 17:14:18 -05:00
|
|
|
/////
|
2011-06-22 12:06:34 -04:00
|
|
|
vim:set ts=4 sw=4 syntax=asciidoc noet spell spelllang=en_us:
|
2008-01-06 17:14:18 -05:00
|
|
|
/////
|