1How to do translations for sweep - a quick overview 2=================================================== 3 4(Includes information from Mathieu Roy and Silvia Pfeiffer) 5 6For more detailed information refer to: 7http://www.gnu.org/manual/gettext/index.html 8 9 10(1) How to create and test a translation for a new language? 11------------------------------------------------------------ 12Grab the po/sweep.pot file and copy it to the new language, 13naming the file after a language code as defined by ISO 639: 14ll.po (e.g. fr.po), with a possible country-specific adaptation 15as in ll_CC.po. 16[For the codes, refer to 17http://www.gnu.org/software/gettext/manual/html_node/Language-Codes.html#Language-Codes] 18 19Translate the strings in that file and save it in the /po folder. 20 21Edit the "configure.ac" file (in sweep-x.x.x folder), adding the 22new language to the "ALL_LINGUAS directive. 23 24Should look like this : 25ALL_LINGUAS="fr se de" 26AM_GNU_GETTEXT 27 28The next "configure" will include the new language, the next 29"make dist" will create the machine-readable translation, and the 30next "make install" will copy it to the system folder where 31gettext can find it. 32 33Testing the new translation goes via setting of environment 34variables (LANG is usually enough). 35 36Mathieu recommends: 37[user@host /]$ export LANG="fr_FR"&&LC_ALL="fr"&&LINGUAS="fr" 38(configures this terminal until you close it) 39[user@host /]$ sweep 40(should work in french) 41 42 43 44(2) How to keep the code and its translations up to date? 45--------------------------------------------------------- 46 47When coding, keep marking displayed text with _("blah") where function 48calls are possible or N_("blah") for statically defined strings. Where 49the string is actually used in the program, you need to put another 50_(variable) around it! A proposed guideline from gnu.org is to use 51format strings instead of string concatenation and to keep sentences 52within one string. 53 54CAUTION: Be aware that when you mark a string with N_("blah"), this 55only marks it for translation. 56 57When creating new code files (.[ch]) with translatable strings in 58them, they need to be added manually to the po/POTFILES.in file. 59The next "configure" will then automatically take care of creating 60the po/POTFILES file and the "make" thereafter will create the 61updated po/sweep.pot file. For merging those updated strings into 62existing translations, a "make dist" is required. 63 64When a translator updates his/her translation file, copy it back to 65the /po directory. It will be compiled into machine-readable form with 66the next "make dist" and installed with the next "make install". 67