Translating Linuxconf messages: quick start Introduction Linuxconf sports a very sophisticated and unique translation system. Translating all the various messages in Linuxconf should take few hours. Tracking the evolution of Linuxconf is relatively painless. Starting with Linuxconf 1.9r25-8, some tools have been created to get you started in no time. This document describe the process for both the linuxconf core and independant modules. You will find information about independant modules at the end. 11.. BBeeffoorree yyoouu ssttaarrtt You need Linuxconf's sources. The translation is handled in the messages subdirectory. Get the sources and compile Linuxconf. This is needed because the translation utilities are delivered with Linuxconf. You should read the document translate/translat.doc. It explains the technology used to make Linuxconf translatable. This should save you a lot of time and make the tracking of the various new Linuxconf release a lot more easier than anything else. Translating Linuxconf involves two different operation. You must translate all messages use by Linuxconf itself and then translate all the help screens. 22.. LLaayyoouutt ooff tthhee mmeessssaaggeess ssuubb--ddiirreeccttoorryy The messages directory contain various scripts and Makefile and one sub-directory per language. The English "original" language is contained in the sources directory. The messages/sources directory contains messages extracted directly from the C++ source file. Don't modify those files. These file are automaticly maintained by the "make msg" command. Your work will be lost. 33.. SSttaarrttiinngg aa ttrraannssllaattiioonn pprroojjeecctt ffoorr aa nneeww llaanngguuaaggee To start a new translation, run the script initlang.sh with a single argument. This argument is the ID of the language. This may be the two letters ISO standard identifying your country. It can be anything. It has to be different from any other translation distributed with Linuxconf. Once the initlang.sh has been run, enter the subdirectory just created. There is a bunch of dic files. Each file correspond to a source directory in the Linuxconf project. You may want to browse the source to better understand the context of a message. It should not be necessary. 44.. SSttaarrttiinngg ttoo wwoorrkk 44..11.. MMooddiiffyyiinngg tthhee ..ddiicc ffiilleess 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. 44..22.. LLaayyoouutt ooff aa ddiicc ffiillee 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. +o E: Error message +o F: Dialog field title +o I: Dialog introduction or field explanation +o M: Menu entry +o N: Notice +o P: Privilege explanation +o T: Dialog title 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. 44..33.. IInnssttaalllliinngg tthhee mmeessssaaggeess 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. 44..44.. UUssiinngg yyoouurr ttrraannssllaattiioonn 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. 44..55.. TThhee mmeessssaaggeess ddoo nnoott sshhooww uupp ?? 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 44..66.. KKeeeeppiinngg tthhee ppaaccee wwiitthh LLiinnuuxxccoonnff _L_i_n_u_x_c_o_n_f 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'). 44..77.. IInnssppeeccttiinngg ..ddiicc ffiilleess ffoorr ccoommmmoonn eerrrroorrss After you have completed the translation of dictionary files, you can use the chkdic.pl script to find common errors. This script tries to find some common mistakes created when manually edited dictionary files. Currently supported features: +o check if previous line of continuing line of message is correctly ended with \n (string for new line character) +o check if messages doesn't contain duplicated tags +o check if messages doesn't contain tag for old message +o check if after translation tag is not empty translation +o find all untranslated messages +o find too long messages The script must be run in the directory holding the dic files. It can also help by preparing synchronized dictionary files for translation with passing proper parameter. You can get all options by invoking it with --help. The script was written by Peter Ivanyi . 55.. IInnddeeppeennddaanntt mmoodduulleess Independant modules are linuxconf components which are compiled outside of the main Linuxconf source tree. While the same technology is used, things are a little simpler. 55..11.. SSoouurrccee llaayyoouutt ooff aann iinnddeeppeennddaanntt mmoodduullee A module has a single .dic file. So the layout goes like this: module_name/ module_name/module_name.dic module_name/messages/lang_id.dic For example, for a module called fooconf translated in french and finish, you would get: fooconf/ fooconf/fooconf.dic fooconf/messages/fi.dic fooconf/messages/fr.dic Note that fooconf/fooconf.dic is the official english text extract from the source code using the "make msg" command. 55..22.. IInnssttaalllliinngg mmeessssaaggeess ffoorr iinnddeeppeennddaanntt mmoodduulleess To install the message, simply do make install. Given the simplicity and size of a module, installing everything, including every language translation is quick (famous last word). 55..33.. TTrraannssllaattiinngg aanndd kkeeeeppiinngg aa ttrraannssllaattiioonn ccuurrrreenntt You use the following command make LANG=xx syncmsg It will update messages/xx.dic.