[Xfce-i18n] pt_BR translations

Daichi Kawahata daichi at xfce.org
Fri Nov 4 10:37:07 CET 2005


On Thu, 3 Nov 2005 23:27:51 -0200
Adriano Winter Bess wrote:

> Hi,

Hi,

> I'm new to list and I'm willing to help with pt_BR translations.

Welcome, I've already seen your name at goodies ;)

> I'd like to know who is in charge of them and how we can coordinate
> the efforts on the translations.

There's no coordinator (committer) in Brazilian Portuguese, so your
translations will be appreciated. As for the 4.2 branch, currently
there're a few untranslated strings in Xfce4-appfinder, and misc.
strings (see attached xfce-i18n.txt) as well.

In contrast, strings should be translated are gathered in the PO file
in trunk, only DocBook documents and XML files for the desktop are
exceptional.

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 --------------


                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 (alphabetically order):

Christian Biere <cbiere at users.sourceforge.net>
Daichi Kawahata <daichi at xfce.org>
Murphy <eqom14 at users.sourceforge.net>
Stavros Giannouris <stavrosg2002 at freemail.gr>
Thomas Sch?rger <trancetip at users.sourceforge.net>


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

It's recommended having translation for 4.2 firstly, since strings in
SVN trunk would be frequently changed unless they are frozen by developer.

Nonetheless, if you're going to complete the translation including XML
files, DocBook format user documents, the above modules are not enough,
instead you'll have to install whole sources for both 4.2 branch and
trunk. You can get useful scripts for this purpose from,

    o Checkout scripts by Jean-Fran?ois Wauthy <pollux at xfce.org>
      http://xfce.org/~pollux/for_translators/

If you don't have access permission to the SVN repository (via SSL),
replace the following,

    `svn co -N https://foo-projects.org/svn/xfce ./'

    with

    `svn co -N http://svn.foo-projects.org/svn/xfce ./'


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
Mousepad, Vi etc. of course, but it's highly recommended using one of
those editors.

Here's the links:

    o Emacs with PO mode - Major mode for GNU gettext PO files.
      http://www.gnu.org/software/gettext/manual/html_node/gettext_10.html

    o Vim with po.vim - A ftplugin for easier editing of GNU gettext PO files.
      http://vim.sourceforge.net/scripts/script.php?script_id=695

    o poEdit - A cross-platform gettext catalogs editor.
      http://www.poedit.org/

    o gtranslator - The GNOME 2.x translation making program.
      http://gtranslator.sourceforge.net/

    o KBabel - An advanced and easy to use PO-file editor.
      http://i18n.kde.org/tools/kbabel/

If you are going to continue as translator, you might want to learn
one of above.

NOTE: Let us (xfce-i18n 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'.

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.

Okay, sometimes you see the special marks, format-indicator in your
PO file like bellow,

    #: ../xfce4-about/info.c:262
    #, fuzzy
    msgid "About Xfce 4"
    msgstr "O XFce 4"

with the `fuzzy' mark, your translations never affect, probably you
will ask "What's the `fuzzy'?", don't worry, the more you are familiar
with translation under gettext mechanism, the more you are getting know
what `fuzzy' means, anyway if you translate a string, delete this mark,

    #: ../xfce4-about/info.c:262
    msgid "About Xfce 4"
    msgstr "O XFce 4"

now, the translated string will appear for a certain place. "Then, how
should I do the following case?" you might wonder,

    #: ../thunar/thunar-properties-dialog.c:547
    #, fuzzy, c-format
    msgid "%s Info"
    msgstr "%s Info"

in that case, `c-format' is format-indicator, i.e. string `%s Info' must
be a C format string and, like above mentioned, you'll have to leave `%s'
as-is. Simply remove `, fuzzy',

    #: ../thunar/thunar-properties-dialog.c:547
    #, c-format
    msgid "%s Info"
    msgstr "%s Info"

(more continues...)

TODO:

    o An order switching with '$2%s $1%s'.
    o An explanation for plural mechanism.
    o Commenting with `#'.
    o Distinguish in between UI and Tooltip string (punctuation).


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. 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[et]=Xfce kalender
    Name[eu]=Xfce egutegia
    Name[fi]=Xfce Kalenteri
    Name[fr]=Calendrier Xfce
    Name[he]=??? ??? Xfce
    [...]
    Comment=Desktop calendar
    Comment[et]=T??laua kalender
    Comment[eu]=Xfce egutegia
    Comment[fi]=Ty?p?yt?kalenteri
    Comment[fr]=Calendrier de bureau
    Comment[he]=??? ???
    [...]
    GenericName=Calendar
    GenericName[en_US]=Calendar
    GenericName[et]=Kalender
    GenericName[eu]=Egutegia
    GenericName[fi]=Kalenteri
    GenericName[hu]=Kalend?rium

Make sure the file stays UTF-8 encoded, language order should be
alphabetically.

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.

Here they are:

    o The desktop files should be translated

    xfcalendar/branches/xfce_4_2/plugin/xfce-xfcalendar-settings.desktop
    xfcalendar/branches/xfce_4_2/xfcalendar.desktop
    xfce-mcs-manager/branches/xfce_4_2/xfce-setting-show/xfce-settings-manager.desktop
    xfce-mcs-plugins/branches/xfce_4_2/plugins/display_plugin/xfce-display-settings.desktop
    xfce-mcs-plugins/branches/xfce_4_2/plugins/keyboard_plugin/xfce-keyboard-settings.desktop
    xfce-mcs-plugins/branches/xfce_4_2/plugins/mouse_plugin/xfce-mouse-settings.desktop
    xfce-mcs-plugins/branches/xfce_4_2/plugins/ui_plugin/xfce-ui-settings.desktop
    xfce-utils/branches/xfce_4_2/gdm/xfce.desktop
    xfce-utils/branches/xfce_4_2/xftaskbar/plugin/xfce-taskbar-settings.desktop
    xfce4-appfinder/branches/xfce_4_2/src/xfce4-appfinder.desktop
    xfce4-iconbox/branches/xfce_4_2/settings/xfce-iconbox-settings.desktop
    xfce4-mixer/branches/xfce_4_2/settings/xfce-mixer-settings.desktop
    xfce4-panel/branches/xfce_4_2/settings/xfce-panel-settings.desktop
    xfce4-session/branches/xfce_4_2/settings/session/xfce-session-settings.desktop
    xfce4-session/branches/xfce_4_2/settings/splash/xfce-splash-settings.desktop
    xfdesktop/branches/xfce_4_2/menueditor/xfce-menueditor.desktop
    xfdesktop/branches/xfce_4_2/settings/xfce-backdrop-settings.desktop
    xffm/branches/xfce_4_2/plugin-mcs/xfce-filemanager-settings.desktop
    xffm/branches/xfce_4_2/src/Xfbook.desktop
    xffm/branches/xfce_4_2/src/Xfdiff.desktop
    xffm/branches/xfce_4_2/src/Xffm.desktop
    xffm/branches/xfce_4_2/src/Xffstab.desktop
    xffm/branches/xfce_4_2/src/Xfglob.desktop
    xffm/branches/xfce_4_2/src/Xfmime_edit.desktop
    xffm/branches/xfce_4_2/src/Xfsamba.desktop
    xffm/branches/xfce_4_2/src/Xftree.desktop
    xfprint/branches/xfce_4_2/mcs-plugin/xfce-xfprint-settings.desktop
    xfprint/branches/xfce_4_2/xfprint-manager/xfprint-manager.desktop
    xfprint/branches/xfce_4_2/xfprint/xfprint.desktop
    xfwm4/branches/xfce_4_2/mcs-plugin/xfce-wm-settings.desktop
    xfwm4/branches/xfce_4_2/mcs-plugin/xfce-workspaces-settings.desktop

TODO:

    o HOWTO - making an one-stop patch.


9. XML files for desktop and panel menu (it requires full source)
==================================================================

You might want to localize desktop menu appears by right click on the
desktop, your files are,

    o For SVN 4.2 branch

    xfdesktop/branches/xfce_4_2/menu.xml.${lang}
    xfdesktop/branches/xfce_4_2/modules/menu/xfce-registered-categories.xml.${lang}

    o For SVN 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: The above XML files are exact same in both 4.2 and trunk, so
you only have to translate either one.

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.

Also there's a XML file for the panel menu in SVN 4.2 branch,

    xfce4-panel/branches/xfce_4_2/contents.xml.${lang}

in which, you can translate the strings within the `<Caption>Hello</Caption>',
`<Tooltip>World</Tooltip>'.


10. Credits and Licenses
=========================

There're credits files in 4.2 branch:

    xfce-utils/branches/xfce_4_2/xfce4-about/AUTHORS.${lang}
    xfce-utils/branches/xfce_4_2/xfce4-about/AUTHORS.html.${lang}
    xfce-utils/branches/xfce_4_2/xfce4-about/BSD.${lang}
    xfce-utils/branches/xfce_4_2/xfce4-about/BSD.html.${lang}
    xfce-utils/branches/xfce_4_2/xfce4-about/COPYING.${lang}
    xfce-utils/branches/xfce_4_2/xfce4-about/COPYING.html.${lang}
    xfce-utils/branches/xfce_4_2/xfce4-about/GPL.${lang}
    xfce-utils/branches/xfce_4_2/xfce4-about/GPL.html.${lang}
    xfce-utils/branches/xfce_4_2/xfce4-about/INFO.${lang}
    xfce-utils/branches/xfce_4_2/xfce4-about/INFO.html.${lang}
    xfce-utils/branches/xfce_4_2/xfce4-about/LGPL.${lang}
    xfce-utils/branches/xfce_4_2/xfce4-about/LGPL.html.${lang}

Probably, you don't need to translate all files, except AUTHORS(.html)
and INFO(.html). Make sure these files should be UTF-8 encoded.


11. Checking your translations in the actual situation
=======================================================

As for the SVN trunk, the relevant module should be built and installed.
This is only for the brave and those that know what to do, instructions
and information are to be found elsewhere.

As for the SVN 4.2 branch, and assuming that the translator has this
installed, it is a matter of running

    $ msgfmt -c -o ${lang}.mo ${lang}.po
    $ su
    # cp ${lang}.mo ${xfce-prefix}/share/locale/${lang}/LC_MESSAGES/${package}.mo

and restarting the application.


12. Submitting translated files
================================

As for the PO files, check whether your PO file is valid:

    $ 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.

WARNING: This part is so important that please don't post your
translations to the list unless you get no warnings.

TODO:

    o HOWTO create a patch


13. 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, it requires full source codes in which you'll have
to run

    $ ./autogen.sh

    when you are in the trunk/ tree, or in branches/xfce_4_2 tree

    $ ./configure

will be required in the each module's directory at first, then simply
update your files,

    $ 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.

TODO:

    o Sometimes, it requires updating POFILES.in in the first place.


14. DocBook formatted documents
================================

  (under construction)

  o TODO:

    Modified CSS file (xfce-rtl.css) for the RTL languages.


15. Web page translation
=========================

  (under construction)


16. Conversation with The Developers
=====================================

  (under construction)


17. 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.


18. 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 Xfce-i18n mailing list