Swedish translation
Daichi Kawahata
daichi at xfce.org
Thu Oct 6 09:22:19 CEST 2005
On Wed, 5 Oct 2005 21:17:27 +0200
Alexander Toresson wrote:
> On 9/24/05, Daichi Kawahata <daichi at xfce.org> wrote:
> > If you're considering Swedish users' benefits, please try to have
> > translation in Xfce 4.2 branch at first, and if possible please
> > learn by heart the contents of following page,
> >
> > http://www.loculus.nl/xfce/documentation/docs-4.2/xfce-i18n.txt
>
> I've tried following these instructions, but when I do svn checkout
> http://svn.foo-projects.org/svn/xfce/modules/4.2-po, I do not get a
> single makefile, so it's plain impossible to run make update-po --
> are these instructions out-dated?
That's right, my fault and it's not one of official documents. I'll
attach newly one in which you can ignore my messy composition. Only
problem comes with the absence of Makefile/POT file/sources, therefore
you can't use 'make update-po' would be a line wrapping, i.e. with this
make instruction, a single line over the 80 characters will be wrapped.
However if you don't care about that, I'll update your giving PO files
on my side.
Thank you for your pointing out and please try to start your work as
soon as possible, next release coming soon!
Regards,
--
Daichi
Language Codes: http://www.w3.org/WAI/ER/IG/ert/iso639.htm
Country Codes: http://www.ics.uci.edu/pub/ietf/http/related/iso3166.txt
-------------- next part --------------
;; -*- mode: text; coding: utf-8; -*-
SHORT GUIDE ABOUT TRANSLATING MESSAGES
0. LICENSE AND AUTHORS
======================
This document is provided under the Creative Commons Public License
2.5 (http://creativecommons.org/licenses/by/2.5/). It is based on
the contributions by the following authors:
Christian Biere <cbiere at users.sourceforge.net>
Thomas Sch?rger <trancetip at users.sourceforge.net>
Murphy <eqom14 at users.sourceforge.net>
Daichi Kawahata <daichi at xfce.org>
1. INTRO
========
This is a short summary of the gettext documentation. See the APPENDIX
if this information isn't sufficient for you.
2. Get the PO files from the SVN repository
===========================================
You can get the latest PO files from SVN,
$ svn checkout http://svn.foo-projects.org/svn/xfce/modules/trunk-po
or current stable version 4.2,
$ svn checkout http://svn.foo-projects.org/svn/xfce/modules/4.2-po
NOTE: It's recommended having translation for 4.2 at first, SVN trunk
version would be frequently changed unless they are frozen by developer.
NOTE: To be afraid, if you're going to complete the translation, the
above modules are not enough, instead you'll have to install whole
sources for both 4.2 branch and trunk.
3. Get the editor for PO file editing
=====================================
You can use a text editor Emacs with `po-mode', VIM with ftplugin `po.vim'
or a graphical PO file editor like `poEdit (requires wxWidgets)',
`gtranslator (requires GNOME)', `KBabel (requires KDE)', these editor
have special features for editing PO file. You can use normal editor like
vi etc. of course, but it's highly recommended using one of those editors.
NOTE: Please let me (daichi at xfce.org) know if you know something else.
4. Contact with the former translator in your language
======================================================
To save your time from duplicate work already on going, it's better to
contact the translator in the header string,
Last-Translator: Last Translator <foo at bar>
if that address isn't used no longer or you couldn't get touch with
the last translator, then please post your message to the
Xfce translations mailing list <xfce-i18n at xfce.org>
5. Prepare the PO file (only works in 4.2 branch)
=================================================
To create the PO file for your language, simply type,
$ msginit
in the target po directory, according to the your current locale, it
creates lang.po in which the suitable header strings will be given
automatically without your bothering. This newly created PO file,
however, doesn't have UTF-8 charset, so you'll need to convert its
charset to UTF-8 later.
NOTE: The command "msginit" works only if target po directory has
generated .pot file, therefore, it's impossible using this command in
trunk module currently, instead you'll have to get whole source tree
from SVN repository.
6. Translate the messages
=========================
In the PO file you'll find something like this:
#: main.c:42
msgid "Hello world"
msgstr ""
If you want to translate to German, you would change the 3rd line to
the following:
msgstr "Hallo Welt"
Don't touch the string behind ``msgid''! If you find typos or the like,
this string must be corrected in the source file. If you see a string
with a ``%'' in it, then leave the part with ``%'' as-is and don't
change the order of these ``words''. Also keep the character after an
backslash ``\'' as-is. For example:
msgid "%-8s are %d time faster than %s.\n"
msgstr "%-8s sind %d mal schneller als %s.\n"
``\n'' means ``newline'' in which line will be new-lined on output, or
another example from Xfmedia:
msgid ""
"This is a printf-like format string controlling the display of the "
"playlist. Xfmedia will replace the following symbols:\n"
"\t%p: Artist/Performer\n"
"\t%t: Track Title\n"
"\t%a: Album Name\n"
"\t%T: Track Number\n"
"\t%g: Genre\n"
"\t%y: Year\n"
"\t%f: Filename\n"
"\t%%: a percent sign"
in that case ``\t'' inserts the `'tab'' space on output, note that on
translation, you should use actual ``tab'' space or ``enter'' instead
of putting ``\t'', ``\n''.
See man printf(3) for details about the syntax, if you have problems
with it.
You don't have to translate every message. If you cannot or don't
want to translate a message just leave ``msgstr ""'' as-is. Don't
copy the string of msgid!
Some strings contain a single underscore (e.g., "_Edit list..." from
Xfdesktop). In this case the underscore declares the following letter
as accelerator key. In this example, the key combination <Alt>+E or
sometimes <Control>+E would activate the GUI element associated with
this string. You should use an appropriate character as accelerator
in the translation as well, just append an underscore to selected
character:
msgid "_Edit list..."
msgstr "_Liste bearbeiten..."
If you change the accelerator key, try to make sure that the chosen
key doesn't clash with another one in the same scope. In rare cases,
you might want to discard the underscore so that no accelerator will
be available for the GUI element.
6.1 Translation Context
=======================
The GUI often uses single words or short word combinations. When used
as a frame title a colon is appended the English to disambiguate its
meaning. Another possibility to disambiguate especially short strings
is using the character '|' as separator. If the English text contains
this character, the part up to the '|' may contain a comment for
translator and/or simply declare a name space so that the word can be
translated in a certain meaning even if the same word is used with
different meanings in other places. For example (from Xfce4-panel):
msgid "tip|Info"
msgstr "Informaci?n"
In the translated string discard everything up to the first '|' and
translate the rest only.
7 Convert the output to UTF-8 (if it's not already UTF-8 encoded)
=================================================================
$ iconv -f CHARSET -t UTF-8 lang.po > utf8.po
$ mv utf8.po lang.po
Replace CHARSET by the one you use e.g., if you are from Western
Europe it's probably ISO-8859-1. Otherwise see what echo $LC_CTYPE
says, and strip the part up to the . (dot). For example:
$ echo $LC_CTYPE
ja_JP.eucJP
$ iconv -f eucJP -t UTF-8 lang.po > utf8.po
$ mv utf8.po lang.po
If you use Vim you can also convert lines on the fly like this:
:,!iconv -f ISO-8859-1 -t UTF-8
This usually works even if your terminal doesn't support UTF-8
encoded character sets.
8. Checking and Submitting the PO file
======================================
First, verify that your PO file is correct:
$ msgfmt --check --check-accelerators=_ -o /dev/null lang.po
You should get no warnings, but if you got them, fix it following
outputted warning messages. After checking, you can send your
translation to:
Xfce translations mailing list <xfce-i18n at xfce.org>
if you are going to send multiple files at once, please use 'tar +
bzip2/gzip' format.
NOTE: This part is so important that please don't post your
translations to the list unless you have no warning.
9. Stay tuned! (it requires full source)
========================================
The messages may be changed from release to release and with growing
functionality there will be more messages that should be translated.
Thus, translation isn't something static. Every few month there will
be a few more sentences to be translated.
To update the PO files to reflect any changes to translatable strings
in the source files simply update your files from SVN and run
$ cd po
$ make update-po
This will scan the source files for translatable strings, will (re-)build
the file `package.pot' and will use msgmerge to update the PO files from
the POT file.
After that you can check your language's PO file for missing/fuzzy
translations and add/correct them with you favorite editor.
When you're finished, you should run `make update-po' again. This will
wrap your .po file's lines properly to have a maximum line width of 80
characters.
10. Desktop files (4.2 branch only and it requires full source)
===============================================================
The Name, GenericName, and Comment keys should be translated. The
format is:
Key[locale]=localestring
For example (from Xfcalendar):
Name=Xfce Calendar
[...]
Name[he]=??? ??? Xfce
Make sure the file stays UTF-8 encoded.
NOTE: This isn't required if you're having translation for SVN trunk
version, instead you'll have to install decent intltool. If you are
using Emacs, `desktop-entry-mode' would be useful for checking file
validation.
11. XML files for desktop menu (it requires full source)
========================================================
You might want to localize desktop menu appearing by right click on the
desktop, your files are,
For 4.2 branch:
xfdesktop/branches/xfce_4_2/menu.xml.lang
xfdesktop/branches/xfce_4_2/modules/menu/xfce-registered-categories.xml.lang
For trunk:
xfdesktop/trunk/menu.xml.lang
xfdesktop/trunk/modules/menu/xfce-registered-categories.xml.lang
to translate into your language, follow the instructions in those files,
after translations and installation finished, the desktop menu will be
automatically localized.
NOTE: If you have already installed those XML files but would like to
check your modified translations on the fly, remove
$(HOME)/.config/xfce4/desktop/menu.xml
then, newly translations will appear.
12. FEEDBACK
============
If you have comments, ideas or corrections, use:
Xfce translations mailing list <xfce-i18n at xfce.org>
Daichi Kawahata <daichi at xfce.org> (current maintainer)
Your feedback will be gratefully appreciated.
13. APPENDIX
============
The complete GNU gettext manual:
http://www.gnu.org/manual/gettext/index.html
Standard country codes (ISO 3166):
http://www.ics.uci.edu/pub/ietf/http/related/iso3166.txt
Standard language codes (ISO 639):
http://www.w3.org/WAI/ER/IG/ert/iso639.htm
Freedesktop.org desktop entry spec:
http://www.freedesktop.org/standards/desktop-entry-spec/
Translation Project:
http://www.iro.umontreal.ca/translation/HTML/index.html
Xfce translations statistics:
http://xfce.org/~kelnos/xfce4/i18n/
More information about the Xfce4-dev
mailing list