Next Previous Contents

4. Starting to work

4.1 Modifying the .dic files

The .dic files have a very simple format. Each message has an identifier. It is followed by the original English text. You must add your translation right after the English version.

Don't delete the English version. It serves two purposes. The script syncmsg.sh can compare the English version in your translation tree with the English version in the sources directory. This way, it can tell you which message was modified in Linuxconf so you can adjust easily your translation. Further, modified messages are always sorted and place at the beginning of the dic file. To help you spot them easily a comment is prepend to each modified message telling you if the message was modified or is new.

The English version is also useful because it lets you translate a little at a time. When you generate the dictionary used by Linuxconf at runtime, the msgcomp utility will pick your translation when available and will stuff the dictionary with the English version when the translation is missing.

4.2 Layout of a dic file

So a dic file looks like

    @version 0
    # *** new message
    !N_MISSING
        :E %s does not exist
    # *** new message
    !N_NOEXEC
        :E %s is not executable
    # *** new message
    !F_ALIASNAME
        :E alias name
    # *** new message
    !F_FILTER
        :E Filter program
        

The word following the exclamation mark is the message ID. This is the key to locate the message usage in the C++ source if needed. The ID start generally with a letter and a underscore. This letter should let you identify the type of message. Here are few in use.

Once translated, a dic file looks like

    @version 0
    !N_MISSING
        :E %s does not exist
        :T %s n'existe pas
    !N_NOEXEC
        :E %s is not executable
        :T %s n'est pas executable
    !F_ALIASNAME
        :E alias name
        :T synonyme
    !F_FILTER
        :E Filter program
        :T Programme filtre
        

As you see, I have removed all the comments (starting with #) so I know I have processed a message. A :T line has been added for the translation and I have left the :E line unchanged.

4.3 Installing the messages

Once you have translated enough, you can run the installmsg.sh script. It processes all .dic file and produces a file

    /usr/lib/linuxconf/linuxconf-msg-VERSION.lang
        

where lang is the identifier of the language (the directory name).

You may run this script after having translated just a few message to see how it goes. I suggest you start with the main.dic file and translated 10-20 messages. You should see few lines of the main menu change so you know you are on the good track.

You can continue later at your own pace as you know that non translated messages are still waiting with a comment in front of them.

4.4 Using your translation

The "features" menu of the Linuxconf's main menu contain one entry to switch the operation language. Using ^X, you get a help list showing which one are available. If your is not, it means you have not run the installmsg.sh script.

4.5 The messages do not show up ?

If for any reason the message dictionary for you language is not readable (not there in /usr/lib/linuxconf/help.LANG_ID), Linuxconf revert silently to english.

If you define the following environment variable, Linuxconf will be a little more verbose about missing language dictionary. It is especially helpful to make sure you have covered all modules.

        export SHOWDICERR=on
        

4.6 Keeping the pace with Linuxconf

Linuxconf is evolving all the time with new features. It means that your translation will need some work from time to time. To do that, install the latest sources of Linuxconf and run the following command in the messages directory:

        syncmsg.sh language_id
        

It will list all the dictionary processed and will show which ones have some work to do. Edit those file and the work to do (new messages, updates messages) will be right at the beginning.

New messages will be introduced by the comment

        # *** new message
        

Updated messages will be introduced by the comment

        # *** updated message
        

Updated messages present 3 versions of the text. The :E version is the one taken from the source. It is up to date. The :T version is your own translation. The :Z version is the original English version you have used to do your translation. This helps you find out what exactly have changed (sometime just a missing 's').

4.7 Inspecting .dic files for common errors

After you have completed the translation of dictionary files, you can use the chkdic.pl script to find common errors. This script try to find some common mistakes created when manually edited dictionary files. Currently supported features:

The script must be run in the directory holding the dic files. It does not require any parameter. The script was written by Peter Ivanyi <ivanyi@internet.sk>.


Next Previous Contents