The Linux Danish/International HOWTO <author>Niels Kristian Bech Jensen <tt/nkbj@sslug.dk/ <date>v2.6, 9 March 2000 <abstract> <nidx>Danish language support (see Danish)</nidx> <nidx>Danish</nidx> This document describes how to configure Linux and various Linux applications for Danish locale standards such as keyboard, font, paper-size etc. It is hoped that Linux users from other places in Western Europe will find this document useful too. </abstract> <toc> <sect>Introduction <nidx>Danish!introduction</nidx> <p> All European users of almost any operating system have two problems: The first is to tell the computer that you have a non-American keyboard, and the second is to get the computer to display the special characters. To make matters worse some applications will also consider you an exception if you are not an American and require special options or the setting of environment variables. Under Linux you change the way your computer interprets the keyboard with the commands <tt/loadkeys/ and <tt/xmodmap/. <tt/loadkeys/ will modify the keyboard for plain Linux while <tt/xmodmap/ makes the modifications necessary when the handshaking between X11 and Linux is imperfect. To display the characters you need to tell your applications that you use the ISO-8859-1 (a.k.a. Latin-1) international set of glyphs. This is not always necessary, but a number of key applications need special attention. This HOWTO is intended to tell Danish users how to do this. If you continue to have problems after reading this you can try the German HOWTO, the Linux Keyboard and Console HOWTO or the ISO 8859-1 National Character Set FAQ. Many of the hints contained herein are cribbed from there. See section <ref id="docs" name="Other documents of relevance"> for pointers to these documents. You should also send me a mail describing your problems. A final problem is that error-messages, menus and documentation of the applications are mostly in English. There is a GNU project under way to address this problem. You can see what it is all about by downloading the file <tt/ABOUT-NLS/ or the package <tt/gettext-0.10.tar.gz/ (or any later version) from your favourite mirror of the GNU archive. This project needs volunteers for the translations. Send a mail to <tt/da-request@li.org/ with the body ``subscribe'' if you want to contribute to the Danish part of the project. The documentation in the <tt/gettext/ package describes how to use such translations in your own programs. <sect>Keyboard setup <nidx>Danish!keyboard configuration</nidx> <sect1>Loading a keytable<label id="loadkbd"> <nidx>Danish!keytable, loading</nidx> <p> You have two tools for configuring your keyboard. Under plain Linux you have <tt/loadkeys/ and under X11 you have <tt/xmodmap/. To try out <tt/loadkeys/ type one of these two commands: <verb> loadkeys /usr/lib/kbd/keytables/dk.map </verb> or <verb> loadkeys /usr/lib/kbd/keytables/dk-latin1.map </verb> The difference between the two keymaps is that <tt>dk-latin1.map</tt> enables `dead' keys while <tt>dk.map</tt> does not. Dead keys are explained in section <ref id="deadkeys" name="Dead keys and accented characters">. The program <tt/loadkeys/ and the keymaps are part of the package <tt/kbd-0.??.tar.gz/ which (with differing version numbers ??) is available with all Linux distributions. Usually <tt/loadkeys/ is executed at boot-time from one of the scripts under the directory <tt>/etc/rc.d/</tt>. Details vary between distributions. (Note for non-Danish readers: Support for other languages is enabled in a similar manner. Use <tt/es.map/ for Spanish keyboards etc.) Versions of XFree86 up to and including v3.1.2 will normally follow the keymap used by plain Linux, but you can modify keyboard behavior under X11 with <tt/xmodmap/. Usually the X11 initialization process will run this command automatically if you have a file called <tt>.Xmodmap</tt> in your home directory. In XFree86 v3.2 and higher you should have the following <tt/Keyboard/ section in your <tt>/etc/XF86Config</tt> (or <tt>/etc/X11/XF86Config</tt>) file (it should be made automatically by the program <tt/XF86Setup/ if you choose a Danish keytable): <verb> Section "Keyboard" Protocol "Standard" XkbRules "xfree86" XkbModel "pc101" XkbLayout "dk" XkbVariant "nodeadkeys" EndSection </verb> The only keyboard variant available at the moment is <tt/"nodeadkeys"/, but dead keys can still be made to work. See section <ref id="deadkeys" name="Dead keys and accented characters"> for more information on this. <sect1>Getting the AltGr key to work under X11 <nidx>Danish!AltGr key</nidx> <nidx>Danish!X!AltGr key</nidx> <p> For versions of XFree86 up to and including v3.1.2 you should edit the file <tt>/etc/XF86Config</tt> (or <tt>/etc/X11/XF86Config</tt>) and make sure the line <verb> RightAlt ModeShift </verb> appears in the <tt>Keyboard</tt> section. Usually you can do this by uncommenting the appropriate line. In XFree86 v3.1.2 you can use <tt/AltGr/ as an alias for <tt/RightAlt/. The <tt/AltGr/ key should work as expected in XFree86 v3.2 and higher if you choose Danish keyboard support. <sect2>Making {, [, ] and } work under Metro-X <nidx>Danish!X!Metro-X</nidx> <p> You can't input the characters ``{'' <tt/(<AltGr><7>)/, ``['' <tt/(<AltGr><8>)/, ``]'' <tt/(<AltGr><9>)/ and ``}'' <tt/(<AltGr><0>)/ under the Metro-X server. This bug has been observed under versions 3.1.5 and 3.1.8 of the server. To correct this bug you have to edit the file <tt>/usr/X11R6/lib/X11/xkb/symbols/dk</tt> and change the lines <verb> key <AE07> { [ 7, slash ] }; key <AE08> { [ 8, parenleft ] }; key <AE09> { [ 9, parenright ] }; key <AE10> { [ 0, equal ] }; </verb> to <verb> key <AE07> { [ 7, slash ], [ braceleft, NoSymbol ] }; key <AE08> { [ 8, parenleft ], [ bracketleft, NoSymbol ] }; key <AE09> { [ 9, parenright ], [ bracketright, NoSymbol ] }; key <AE10> { [ 0, equal ], [ braceright, NoSymbol ] }; </verb> <sect1>Dead keys and accented characters<label id="deadkeys"> <nidx>Danish!dead keys</nidx> <p> Dead keys are those that do not type anything until you hit another key. Tildes and umlauts are like this by default under plain Linux if you use the <tt>dk-latin1.map</tt> keymap. This is the default behaviour for these keys under Microsoft Windows as well. <sect2>Removing dead key functionality <nidx>Danish!dead keys!removing</nidx> <p> <itemize> <item>Removing dead key functionality under plain Linux and XFree86 v3.1.2 Under plain Linux type <verb> loadkeys dk.map </verb> <item>Removing dead key functionality under XFree86 v3.2 and higher Put the following line in the <tt/Keyboard/ section of your <tt>/etc/XF86Config</tt> (or <tt>/etc/X11/XF86Config</tt>) file: <verb> XkbVariant "nodeadkeys" </verb> </itemize> <sect2>Invoking dead key functionality <nidx>Danish!dead keys!invoking</nidx> <p> <itemize> <item>Invoking dead key functionality under plain Linux Under plain Linux type <verb> loadkeys dk-latin1.map </verb> <item>Invoking dead key functionality under X11R6 sessions First you must make sure you are running XFree86 v3.1.2 or higher. Download and install everything related to the newest release if you have a lower version number. Neither compose nor dead keys will work in X11R6 applications unless these are compiled with support for accented (8-bit) character input. An example of such an application is <tt/GNU emacs/ version 19.30 (or higher.) Some X11 applications still do not support this input method. Eventually this situation might improve, but until that happens you can either hack your applications or submit polite bug reports to the program authors. The latter approach is often the most efficient. See section <ref id="programming" name="Programming tips for X11"> for some advice on what needs to be done. Next you will have to map a key to <tt/Multi_key/ (<tt/Compose/.) The <tt>Scroll Lock</tt> key is most likely already mapped as such if you use XFree86 v3.1.2 (you can verify this with the program <tt/xev/,) and it is easy to map the right <tt/Control/ key by uncommenting the appropriate line in the <tt/Keyboard/ section of the XFree86 configuration file (often <tt>/etc/XF86Config</tt> or <tt>/etc/X11/XF86Config</tt>.) If you wish to use some other key, or if you are using XFree86 v3.2 or higher and want to change the default, you should put something like <verb> keycode 78 = Multi_key </verb> in your <tt>˜/.Xmodmap</tt> file. The statement in the example defines <tt/Scroll Lock/ as the <tt/Compose/ key. The default <tt/Compose/ key in XFree86 v3.2 and higher is <tt><Shift><AltGr></tt>. XFree86 v3.2 and higher comes without support for the dead keys on the standard Danish keyboard. To get this support you have to change a few lines in the <tt/xkb_symbols "basic"/ section of the file <tt>/usr/X11R6/lib/X11/xkb/symbols/dk</tt>. The lines <verb> key <AE12> { [ acute, grave ], [ bar, dead_ogonek ] }; key <AD12> { [ diaeresis, asciicircum ], [ asciitilde, dead_macron ] }; </verb> should be changed to <verb> key <AE12> { [ dead_acute, dead_grave ], [ bar, dead_ogonek ] }; key <AD12> { [ dead_diaeresis, dead_circumflex ], [ dead_tilde, dead_macron ] }; </verb> After these changes you can get support for dead keys by removing the line <verb> XkbVariant "nodeadkeys" </verb> from the <tt/Keyboard/ section of your <tt>/etc/XF86Config</tt> (or <tt>/etc/X11/XF86Config</tt>) file. (Note for non-Danish readers: There are files for many local keyboard maps in <tt>/usr/X11R6/lib/X11/xkb/symbols</tt>.) The available keystroke combinations are listed in <tt>/usr/X11R6/lib/X11/locale/iso8859-1/Compose</tt>. There are some bugs in that file you will want to fix: <itemize> <item>The line reading <verb> <dead_tilde> <space> : "~" tilde </verb> should be changed to <verb> <dead_tilde> <space> : "~" asciitilde </verb> <item>In several places <tt/asciicircum/ is misspelled as <tt/asciicirum/ </itemize> Finally make sure your shells and/or applications are set up for ISO-8859-1 compatibility as described in section <ref id="apps" name="International character sets in specific applications"> and you should be all set. </itemize> <sect1> Making $ (the dollar sign), ø (oslash) and Ø (Oslash) work <nidx>Danish!setting up $, ø, Ø</nidx> <sect2>$ (the dollar sign) <nidx>Danish!setting up $</nidx> <p> There is a bug in the Danish keymaps causing the dollar sign to be accessed with <tt><Shift><4></tt> instead of <tt><AltGr><4></tt> by default. If this is a problem for you, determine what keymap you load at boot-time. You can find it by looking around in the directory <tt>/etc/rc.d/</tt> or simply by paying attention to what happens at boot-time. On my computer the relevant keymap is called <tt>/usr/lib/kbd/keytables/dk-latin1.map</tt>. You can fix the problem by changing the line <verb> keycode 5 = four dollar dollar </verb> in the keymap file to <verb> keycode 5 = four currency dollar </verb> and then (re-)loading the keytable as described in section <ref id="loadkbd" name="Loading a keytable">. Currency (dansk: ``soltegn'') is the default <tt><Shift><4></tt> character on a Danish keyboard. This should fix the problem for both X11 and plain Linux. <sect2>ø (oslash) and Ø (Oslash) <nidx>Danish!setting up ø, Ø</nidx> <p> In some older distributions ``ø'' and ``Ø'' appear as cent and yen. Find the line for keycode 40 in the keymap file and change it from <verb> keycode 40 = cent yen </verb> to <verb> keycode 40 = +oslash +Ooblique </verb> This bug appears to have been fixed in <tt/kbd-0.88.tar.gz/ and newer versions. The plus signs are necessary to get <tt/Caps Lock/ working properly. ``Oslash'' can be used as an alias for ``Ooblique'' in <tt/kbd-0.90.tar.gz/ and newer versions. You can read more about keyboard configuration at <url url="http://www.ibbnet.nl/~anne/keyboard.html" name="this site">. <sect>Display and application setup <nidx>Danish!display configuration</nidx> <nidx>Danish!application configuration</nidx> <p> Most applications need to be compiled as ``8-bit-clean'' to work well with European characters. Some need a few extra hints to get it right. <sect1>Loading the ISO-8859-1 font on the console <nidx>Danish!application!font loading</nidx> <nidx>Danish!application!ISO-8859-1 font</nidx> <p> Execute the following commands from your shell prompt: <verb> setfont lat1u-16.psf </verb> In Red Hat Linux 5.2 and higher you can do this by adding these lines to <tt>/etc/sysconfig/i18n</tt>: <verb> SYSFONT=lat1u-16.psf SYSTERM=linux </verb> Due to a bug in the <tt/ncurses/ package on Red Hat Linux 5.2, you also have to change ``linux-lat'' to ``linux'' in <tt>/etc/profile.d/lang.sh</tt>. This is not necessary in Red Hat Linux 6.0. <sect1>The Euro symbol <nidx>Danish!the Euro symbol</nidx> <p> A new symbol has been added to the Danish character set: The symbol for the Euro (the new currency of the European Monetary Union.) A new character set called ISO-8859-15 a.k.a. latin0 (or latin9) has been created to replace ISO-8859-1 (latin1.) You must use the <url name="EURO" url="ftp://ftp.freshmeat.net/pub/euro-patch/"> package to get support for latin0. The package includes both fonts and keymaps. <sect1>Characters you can display under Linux <nidx>Danish!displayable characters</nidx> <p> Type <tt>dumpkeys -l | less</tt> at the prompt to find out which characters that are readily available. You can map them to your keyboard via the keymap files mentioned in section <ref id="loadkbd" name="Loading a keytable">. <sect1>International character sets in specific applications<label id="apps"> <nidx>Danish!applications!character sets in</nidx> <p> A number of applications demand special attention. This section describes how to set up configuration files for them. <descrip> <tag/<tt>bash</tt>:/ <nidx>Danish!applications!bash</nidx> Put the following in your <tt>˜/.inputrc</tt> file: <verb> set meta-flag on set convert-meta off set output-meta on </verb> <tag/<tt>elm</tt>:/ <nidx>Danish!applications!elm</nidx> Put the following definitions in your <tt>˜/.elm/elmrc</tt> file: <verb> charset = iso-8859-1 displaycharset = iso-8859-1 textencoding = 8bit </verb> This may not work on some versions of <tt/elm/. You can get partial <bf/MIME/ support in <tt/elm/ if you use <tt/metamail/. <tag/<tt>emacs</tt>:/ <nidx>Danish!applications!emacs</nidx> Put the following in your <tt>˜/.emacs</tt> or the the system-wide initialization file (probably <tt>/usr/lib/emacs/site-lisp/default.el</tt> or <tt>/usr/share/emacs/site-lisp/default.el</tt>): <verb> (standard-display-european t) (set-input-mode (car (current-input-mode)) (nth 1 (current-input-mode)) 0) </verb> Dead keys should work under GNU emacs provided you use GNU emacs v19.30 or higher and XFree86 v3.1.2 or higher (it works for me anyway,) so do not start researching available elisp packages implementing ``electric keys'' or anything like that. If you want to implement European keyboard conventions in emacs without upgrading, the best choice is probably the <tt/remap/ package available from <url url="ftp://sunsite.auc.dk/pub/emacs/auctex/ftp/auctex/" name="SunSite DK">. There are also two packages called <tt/iso-acc.elc/ and <tt/iso-trans.elc/ included with emacs that have similar functionality, but they are not nearly as powerful. <tag/<tt>groff</tt>:/ <nidx>Danish!applications!groff</nidx> Issue the command as <verb> groff -Tlatin1 <your_groff_input_file> </verb> if you want ISO-8859-1 text output. Remember to change this in <tt>/etc/man.config</tt> to get latin1 characters working in <tt/man/ (don't remove the <tt/-mandoc/ switch.) <tag/<tt>ispell</tt> --- Spell checking in Danish:/ <nidx>Danish!applications!ispell</nidx> First make sure that you install version 3.1.20 instead of version 4.0 of <tt>ispell</tt>. The latter is obsolete and multiple brain-damaged. You can download the sources for <tt>ispell</tt> at <url url="ftp://sunsite.auc.dk/pub/gnu/" name="the GNU archive"> and you can get a Danish dictionary from <url url="http://www.sslug.dk/ispell/idanish/dansk.html" name="SSLUG">. Follow the compilation instructions and you should have no trouble (One caveat: When defining the variables necessary for compilation you must tell ispell that Linux is a SysV type OS by defining the variable <tt/USG/.) When you have installed the Danish dictionary for <tt/ispell/ you can check the spelling of a Danish language file by executing the command: <verb> ispell -d danish -T latin1 -w "æøåÆØÅ" <your_danish_text_file> </verb> (Note for non-Danish readers: You can find dictionaries for most Western languages by reading the file <tt/Where/ included with the sources for <tt/ispell/.) <tag/<tt>joe</tt>:/ <nidx>Danish!applications!joe</nidx> Issue the command as <verb> joe -asis </verb> or put the following in your <tt>˜/.joerc</tt> file: <verb> -asis </verb> The hyphen character <em/must/ be in the first column. <tag/<tt>kermit</tt>:/ <nidx>Danish!applications!kermit</nidx> This is as close as I can get, but not completely satisfying yet. Put the following in your <tt>˜/.kermrc</tt> file: <verb> set terminal bytesize 8 set command bytesize 8 set file bytesize 8 set language danish set file character-set latin1-iso set transfer character-set latin1-iso set terminal character-set latin1-iso </verb> I think there are more variables to set, but they are hiding. You would have to modify these settings if the remote system is DOS or OS/2 based. <tag/<tt>less</tt>:/ <nidx>Danish!applications!less</nidx> Set the following environment variable: <verb> LESSCHARSET=latin1 </verb> This is not necessary if your system support locales. Then you should just set <tt/LANG/, <tt/LC_CTYPE/ or <tt/LC_ALL/ (see section <ref id="locale" name="Locale support in libc 5.4.x and higher">.) <tag/<tt>ls</tt>:/ <nidx>Danish!applications!ls</nidx> Issue the command as <verb> ls -N </verb> or possibly <verb> ls --8bit </verb> <tag/<tt>lynx</tt>:/ <nidx>Danish!applications!lynx</nidx> Put the following definition in your <tt>˜/.lynxrc</tt> file: <verb> character_set=ISO Latin 1 </verb> This can also be set via the <tt/Options/ menu in <tt/lynx/. Type `o' and set the relevant option. <tag/<tt>man</tt>:/ <nidx>Danish!applications!man</nidx> See entry for <tt/groff/ in this section. <tag/<tt>metamail</tt>:/ <nidx>Danish!applications!metamail</nidx> Set the following environment variable: <verb> MM_CHARSET=ISO-8859-1 </verb> <tag/<tt>nn</tt>:/ <nidx>Danish!applications!nn</nidx> Put the following in your <tt>˜/.nn/init</tt> file: <verb> set data-bits 8 </verb> <tag/<tt>pine</tt>:/ <nidx>Danish!applications!pine</nidx> Put the following definition in your <tt>˜/.pinerc</tt> file: <verb> character-set=ISO-8859-1 </verb> This can also be set via the <tt/Setup/, <tt/Config/ menu option in <tt/pine/. It won't hurt to enable <tt/enable-8bit-esmtp-negotiation/ and <tt/enable-8bit-nntp-posting/ (for news) in that menu too. <tag/<tt>rlogin</tt>:/ <nidx>Danish!applications!rlogin</nidx> Issue the command as <verb> rlogin -8 foo.bar.dk </verb> <tag/<tt>sendmail</tt>:/ <nidx>Danish!applications!sendmail</nidx> Put (or uncomment) the following in your <tt>/etc/sendmail.cf</tt> file: <verb> O SevenBitInput=False O EightBitMode=pass8 O DefaultCharSet=iso-8859-1 </verb> <tag/<tt>tcsh</tt>:/ <nidx>Danish!applications!tcsh</nidx> Put the following in your <tt>/etc/csh.login</tt> or <tt>˜/.tcshrc</tt> file: <verb> setenv LANG C </verb> Actually you just have to define one of the environment variables <tt/LANG/ or <tt/LC_CTYPE/. The value does not matter. Read the <tt/tcsh/ man page for more information. <tag/<tt>telnet</tt>:/ <nidx>Danish!applications!telnet</nidx> Put one line of the following type in your <tt>˜/.telnetrc</tt> file for <bf/each/ host you want to log on to using <tt/telnet/: <verb> <hostname> set outbinary true </verb> Example: <verb> localhost set outbinary true foo.bar.dk set outbinary true </verb> <label id="latex"><tag>&tex;/&latex;:</tag> <nidx>Danish!applications!&tex;</nidx> <nidx>Danish!applications!&latex;</nidx> There are several problems with &tex;/&latex;: You want &latex; to understand the special characters and you do not want &latex; to put in English words like ``Chapter'' at the beginning of every chapter or use English typesetting conventions. Under &latexe; the header of your input file should look something like this: <verb> \documentclass[a4paper]{article} \usepackage[latin1]{inputenc} \usepackage{t1enc} \usepackage[danish]{babel} </verb> The first <tt/usepackage/ statement ensures that &latex; will interpret European characters correctly, so you do not have to use escape codes for European characters. The second one is not strictly necessary, but it is recommended including it to use the new EC fonts (previously called DC fonts.) The third <tt/usepackage/ statement defines a range of standards for typesetting texts in Danish. All the major Linux distributions now includes the <bf/teTeX/ package. To set up teTeX you must run the script <tt/texconfig/. Here you can choose Danish hyphenation (dansk: ``orddeling''), A4 papersize for <tt/dvips/ and <tt/xdvi/ etc. All new Linux distributions include &latexe;, but on older systems you might come across &latex; 2.09. If that happens you can use <verb> \documentstyle[a4,isolatin]{article} </verb> to include support for ISO-8859-1 characters and European paper sizes. A better thing to do would be to ask your system administrator to upgrade to &latexe;. <tt/isolatin.sty/ is available from all <url url="ftp://sunsite.auc.dk/pub/tex/ctan/" name="CTAN servers">. Some people prefer to use emacs in a special mode which translates ``special'' letters into &tex; escape codes, but this method is obsolete. <tag/<tt>tin</tt>:/ <nidx>Danish!applications!tin</nidx> Put the following definitions in your <tt>˜/.tin/headers</tt> file: <verb> Mime-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: 8bit </verb> Now you can post messages with the proper Danish characters in the message body. </descrip> <sect>Miscellaneous problems <nidx>Danish!miscellaneous problems</nidx> <nidx>Danish!problems</nidx> <sect1>Time zone <nidx>Danish!problems!time zone</nidx> <p> Denmark is placed in the Central European Time zone (CET or MET,) which (in the winter) is equivalent to Greenwich Mean Time plus 1 (GMT+1.) You set the time zone on a Linux system by making a symbolic link between <tt>/usr/lib/zoneinfo/localtime</tt> and the file in <tt>/usr/lib/zoneinfo/</tt> with a name corresponding to your zone or country. Danes will want to execute one of the commands <verb> ln -sf /usr/lib/zoneinfo/MET /etc/localtime </verb> or <verb> ln -sf /usr/lib/zoneinfo/Europe/Copenhagen /etc/localtime </verb> This automatically sets Daylight Saving Time (GMT+2) in the summer. You synchronize the system time with the CMOS clock by issuing the command <tt/clock/ as root. If your CMOS clock is set to GMT (a.k.a. UTC --- the standard on proper Unix systems) use <verb> clock -u -s </verb> or if your CMOS clock is set to local time use <verb> clock -s </verb> <sect1>A4 papersize <nidx>Danish!problems!paper size</nidx> <nidx>Danish!problems!A4-sized paper</nidx> <p> <itemize> <item><tt/ghostscript/: Add the command line option <tt/-sPAPERSIZE=a4/. <item><tt/ghostview/: Define the following Xresource: <verb> Ghostview.pageMedia: A4 </verb> <item><tt>&tex;/&latex;</tt>, <tt/dvips/, <tt/xdvi/: See the entry for &tex;/&latex; in section <ref id="latex" name="International character sets in specific applications">. </itemize> <sect1>Text file formats for other platforms <nidx>Danish!problems!text file formats</nidx> <nidx>Danish!problems!DOS file formats</nidx> <p> You can translate files between an ISO-8859-1 formatted text file and e.g. a DOS text file using codepage 850 with the <tt/recode/ package. A DOS file called <tt>foo.txt</tt> would be translated into a proper Unix file with the command <verb> recode cp850:latin1 foo.txt </verb> <tt/recode/ is available as <tt/recode-3.4.tar.gz/ from all mirrors of <url url="ftp://sunsite.auc.dk/pub/gnu/" name="the GNU archive">. <sect>Locale support in libc 5.4.x and higher<label id="locale"> <nidx>Danish!locale support</nidx> <p> The locale support has been updated in <tt/libc 5.4.x/. You can avoid many of the individual program setups described in section <ref id="apps" name="International character sets in specific applications"> if the programs on your system is prepared for locale support. The Debian distribution comes with this support if you install the <tt/wg15-locale/ package. Systems with <tt/GNU libc 2/ (<tt/libc 6.x/) support locales by default (see remarks about Red Hat Linux release 5.0 later in this section.) If you use a system without locale support, you can add such support using the following method: <enum> <item>Make sure you have the latest <tt/libc 5.4.x/ library. You can get this from <url url="ftp://ftp.yggdrasil.com/private/hjl/" name="Yggdrasil Computing">. <item>Make sure you have the <tt/localedef/ program installed. It should come with the library. <item>Get the locale sources. You can get them from DKUUG. You need to get both <url url="ftp://dkuug.dk/i18n/WG15-collection/locales/" name="locale"> and <url url="ftp://dkuug.dk/i18n/WG15-collection/charmaps/" name="charmap"> sources. <item>Put the locale sources in <tt>/usr/share/i18n/locales/</tt> and the charmap sources in <tt>/usr/share/i18n/charmaps/</tt>. <item>Execute the <tt/localedef/ program to build the locale data files: <verb> localedef -ci da_DK -f ISO_8859-1:1987 da_DK </verb> (Note for non-Danish readers: You can build locale data files for other locales in the same way. All locale and charmap sources are at the DKUUG site.) </enum> To enable support for the Danish locale on a system with locale support you just have to set one of the following environment variables: <verb> LANG=da_DK </verb> or <verb> LC_ALL=da_DK </verb> Try <tt/da_DK.ISO_8859-1/ if <tt/da_DK/ does not work. Both environment variables set all the individual locale catgories. You can also set a single locale category by using the name of the category as an environment variable. The locale catogories are: <verb> Locale category Application --------------- ----------- LC_COLLATE Collation of strings (sort order.) LC_CTYPE Classification and conversion of characters. LC_MESSAGES Translations of yes and no. LC_MONETARY Format of monetary values. LC_NUMERIC Format of non-monetary numeric values. LC_TIME Date and time formats. LC_ALL Sets all of the above (overrides all of them.) LANG Sets all the categories, but can be overridden by the individual locale categories. </verb> In Red Hat Linux 5.2 you can set the environment variables LANG and/or LC_ALL in the file <tt>/etc/sysconfig/i18n</tt> by adding lines such as this: <verb> LC_ALL=da_DK </verb> A few programs such as <tt/bash/ and <tt/GNU emacs/ still need specific setup as described in section <ref id="apps" name="International character sets in specific applications">, but most should work without further attention. Programs such as <tt/nvi/ which did not work with 8 bit characters before should work now. Locale support should be more common as distributions based on the new <tt/GNU libc 2/ become available. Beware that although Red Hat Linux release 5.0 comes with <tt/GNU libc 2/, the locale support is not working. You have to build the locale data files by executing <tt/localedef/ yourself. You can build the Danish locale data files with the following command: <verb> localedef -c -i da_DK -f ISO-8859-1 da_DK </verb> As of <tt/glibc-2.0.7-4.i386.rpm/ the locale data files are included with the libraries and this is no longer necessary. <sect>Programming tips for X11<label id="programming"> <nidx>Danish!X programming</nidx> <p> Displaying 8-bit charaters is easy. You can use them just as you would use 7-bit ASCII. Getting applications to accept input of special characters is an entirely different matter. If you are using e.g. the Xt toolkit and a widget set like Motif you need only add one line to your program. As your <bf/first/ call to Xt use <tt/XtSetLanguageProc/. Like this: <verb> int main (int argc, char** argv) { ... XtSetLanguageProc (NULL, NULL, NULL); top = XtAppInitialize ( ... ); ... } </verb> Now your program will automagically look up the <tt/LC_CTYPE/ variable and interpret dead keys etc. according to the <tt/Compose/ tables in <tt>/usr/X11R6/lib/X11/locale/</tt>. This should work for all Western European keyboard layouts and is entirely portable. As XFree86 multilanguage support gets better your program will also be useful in Eastern Europe and the Middle East. This method of input is supported by Xt, Xlib and Motif v1.2 (and higher.) According to the information I have available it is only partially supported by Xaw. If you have further information on this subject I would like to hear from you. This section was adapted from a more extensive discussion in Michael Gschwind's Programming for Internationalization. See section <ref id="docs" name="Other documents of relevance"> for a pointer to that document. <sect>Getting X11 applications to speak Danish <nidx>Danish!X program customization</nidx> <p> To get Danish texts on menus, buttons, etc. in a well behaved X11 application, you just have to translate the resource strings defining the texts. Jacob Nordfalk has done such translations for a lot of applications including <tt/Netscape/ and <tt/Ghostview/. The translations and a description of how to install them can be found at <url url="http://alf.nbi.dk/~nordfalk/ovs/" name="this site">. <sect>Information resources <nidx>Danish!information resources</nidx> <sect1>Other documents of relevance<label id="docs"> <nidx>Danish!documents, additional</nidx> <p> The HOWTOs are available from all mirrors of <tt/www.linuxdoc.org/. There is a Danish mirror at <url url="http://sunsite.auc.dk/ldp/HOWTO/" name="SunSite DK">. The German HOWTO (in German) by Winfried Trümper. A lot of other national HOWTOs such as Finnish, Spanish and Polish are also available in the native languages. The Linux Keyboard and Console HOWTO by Andries Brouwer. The ISO 8859-1 National Character Set FAQ and Programming for Internationalization (plus much more) by Michael Gschwind is available from <url url="http://www.vlsivie.tuwien.ac.at/mike/i18n.html" name="this site">. <sect1>FTP and Web sites<label id="ftp"> <nidx>Danish!FTP sites</nidx> <nidx>Danish!WWW sites</nidx> <p> <url url="http://www.sslug.dk/" name="SSLUG (Skåne Sjælland Linux User Group)"> is a Swedish/Danish Linux user group. Their mailing list is a good place to get help with Linux in Danish (or Swedish.) They are also hosts for <url url="http://www.sslug.dk/DanishHowto/" name="this document">. AUC in Ålborg is the home of <url url="ftp://sunsite.auc.dk/pub/os/linux/" name="SunSite DK"> which has the Debian and Red Hat distributions, the latest kernels, a mirror of the <url url="http://sunsite.auc.dk/ldp/" name="Linux Documentation Project"> and mirrors of <url url="ftp://sunsite.auc.dk/pub/os/linux/sunsite/" name="metalab.unc.edu"> and <url url="ftp://sunsite.auc.dk/pub/gnu/" name="the GNU archive">. There is also a mirror of <url url="ftp://sunsite.auc.dk/pub/tex/ctan/" name="the CTAN archive"> with everything you need to get &tex; and &latex; running. <sect>Credits and legal stuff <nidx>Danish!credits and legal stuff</nidx> <p> Thanks to Peter Dalgaard, Anders Majland, Jon Haugsand, Jacob Nordfalk, the authors of the German HOWTO, Michael Gschwind and numerous others for suggestions and help with several questions. And a big thanks to the people at Aalborg University Center for writing and making available several of the packages described in this document. A special Thank You to Thomas Petersen; the original author of this document. <sect1>Legal stuff <p> Trademarks are owned by their owners. Although the information given in this document is believed to be correct, the author will accept no liability for the content of this document. Use the tips and examples given herein at your own risk. Copyright © 1996 by Thomas Petersen. Copyright © 1997-2000 by Niels Kristian Bech Jensen. This document may be distributed only subject to the terms and conditions set forth in the LDP license at <url url="http://www.linuxdoc.org/COPYRIGHT.html" name="http://www.linuxdoc.org/COPYRIGHT.html">. </article>