📄 lang-setup.html
字号:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"><html xmlns="http://www.w3.org/1999/xhtml"><head><meta name="generator" content="HTML Tidy, see www.w3.org" /><title>Localizing FreeBSD to Specific Languages</title><meta name="GENERATOR" content="Modular DocBook HTML Stylesheet Version 1.7" /><link rel="HOME" title="FreeBSD Handbook" href="index.html" /><link rel="UP" title="Localization - I18N/L10N Usage and Setup" href="l10n.html" /><link rel="PREVIOUS" title="Compiling I18N Programs" href="l10n-compiling.html" /><link rel="NEXT" title="The Cutting Edge" href="cutting-edge.html" /><link rel="STYLESHEET" type="text/css" href="docbook.css" /></head><body class="SECT1" bgcolor="#FFFFFF" text="#000000" link="#0000FF" vlink="#840084"alink="#0000FF"><div class="NAVHEADER"><table summary="Header navigation table" width="100%" border="0" cellpadding="0"cellspacing="0"><tr><th colspan="3" align="center">FreeBSD Handbook</th></tr><tr><td width="10%" align="left" valign="bottom"><a href="l10n-compiling.html"accesskey="P">Prev</a></td><td width="80%" align="center" valign="bottom">Chapter 18 Localization - I18N/L10N Usageand Setup</td><td width="10%" align="right" valign="bottom"><a href="cutting-edge.html"accesskey="N">Next</a></td></tr></table><hr align="LEFT" width="100%" /></div><div class="SECT1"><h1 class="SECT1"><a id="LANG-SETUP" name="LANG-SETUP">18.5 Localizing FreeBSD toSpecific Languages</a></h1><div class="SECT2"><h2 class="SECT2"><a id="RU-LOCALIZE" name="RU-LOCALIZE">18.5.1 Russian Language (KOI8-REncoding)</a></h2><i class="AUTHORGROUP"><span class="CONTRIB">Originally contributed by</span> Andrey A.Chernov.</i> <p>For more information about KOI8-R encoding, see the <a href="http://koi8.pp.ru/"target="_top">KOI8-R References (Russian Net Character Set)</a>.</p><div class="SECT3"><h3 class="SECT3"><a id="AEN26995" name="AEN26995">18.5.1.1 Locale Setup</a></h3><p>Put the following lines into your <tt class="FILENAME">~/.login_conf</tt> file:</p><pre class="PROGRAMLISTING">me:My Account:\ :charset=KOI8-R:\ :lang=ru_RU.KOI8-R:</pre><p>See earlier in this chapter for examples of setting up the <ahref="using-localization.html#SETTING-LOCALE">locale</a>.</p></div><div class="SECT3"><h3 class="SECT3"><a id="AEN27002" name="AEN27002">18.5.1.2 Console Setup</a></h3><ul><li><p>For the FreeBSD versions before 5.0 add the following line to your kernelconfiguration file:</p><pre class="PROGRAMLISTING">options SC_MOUSE_CHAR=0x03</pre><p>For FreeBSD versions 4.4 and up insert the following line into <ttclass="FILENAME">/etc/rc.conf</tt>:</p><pre class="PROGRAMLISTING">mousechar_start=3</pre></li><li><p>Use following settings in <tt class="FILENAME">/etc/rc.conf</tt>:</p><pre class="PROGRAMLISTING">keymap="ru.koi8-r"scrnmap="koi8-r2cp866"font8x16="cp866b-8x16"font8x14="cp866-8x14"font8x8="cp866-8x8"</pre></li><li><p>For each <var class="LITERAL">ttyv*</var> entry in <ttclass="FILENAME">/etc/ttys</tt>, use <var class="LITERAL">cons25r</var> as the terminaltype.</p></li></ul><p>See earlier in this chapter for examples of setting up the <ahref="using-localization.html#SETTING-CONSOLE">console</a>.</p></div><div class="SECT3"><h3 class="SECT3"><a id="AEN27022" name="AEN27022">18.5.1.3 Printer Setup</a></h3><p>Since most printers with Russian characters come with hardware code page CP866, aspecial output filter is needed to convert from KOI8-R to CP866. Such a filter isinstalled by default as <tt class="FILENAME">/usr/libexec/lpr/ru/koi2alt</tt>. A Russianprinter <tt class="FILENAME">/etc/printcap</tt> entry should look like:</p><pre class="PROGRAMLISTING">lp|Russian local line printer:\ :sh:of=/usr/libexec/lpr/ru/koi2alt:\ :lp=/dev/lpt0:sd=/var/spool/output/lpd:lf=/var/log/lpd-errs:</pre><p>See <a href="http://www.FreeBSD.org/cgi/man.cgi?query=printcap&sektion=5"><spanclass="CITEREFENTRY"><span class="REFENTRYTITLE">printcap</span>(5)</span></a> for adetailed description.</p></div><div class="SECT3"><h3 class="SECT3"><a id="AEN27034" name="AEN27034">18.5.1.4 <spanclass="TRADEMARK">MS-DOS</span>® FS and Russian Filenames</a></h3><p>The following example <ahref="http://www.FreeBSD.org/cgi/man.cgi?query=fstab&sektion=5"><spanclass="CITEREFENTRY"><span class="REFENTRYTITLE">fstab</span>(5)</span></a> entry enablessupport for Russian filenames in mounted <span class="TRADEMARK">MS-DOS</span>®filesystems:</p><pre class="PROGRAMLISTING">/dev/ad0s2 /dos/c msdos rw,-Wkoi2dos,-Lru_RU.KOI8-R 0 0</pre><p>The option <var class="OPTION">-L</var> selects the locale name used, and <varclass="OPTION">-W</var> sets the character conversion table. To use the <varclass="OPTION">-W</var> option, be sure to mount <tt class="FILENAME">/usr</tt> beforethe <span class="TRADEMARK">MS-DOS</span> partition because the conversion tables arelocated in <tt class="FILENAME">/usr/libdata/msdosfs</tt>. For more informations, see the<a href="http://www.FreeBSD.org/cgi/man.cgi?query=mount_msdos&sektion=8"><spanclass="CITEREFENTRY"><span class="REFENTRYTITLE">mount_msdos</span>(8)</span></a> manualpage.</p></div><div class="SECT3"><h3 class="SECT3"><a id="AEN27053" name="AEN27053">18.5.1.5 X11 Setup</a></h3><ol type="1"><li><p>Do <a href="using-localization.html#SETTING-LOCALE">non-X locale setup</a> first asdescribed.</p><div class="NOTE"><blockquote class="NOTE"><p><b>Note:</b> <a id="RUSSIAN-NOTE" name="RUSSIAN-NOTE"></a>The Russian KOI8-R localemay not work with old <b class="APPLICATION"><spanclass="TRADEMARK">XFree86</span>™</b> releases (lower than 3.3). <bclass="APPLICATION"><span class="TRADEMARK">XFree86</span> 4.X</b> is now the defaultversion of the X Window System on FreeBSD. This should not be an issue unless you areusing an old version of FreeBSD.</p></blockquote></div></li><li><p>Go to the <ahref="http://www.FreeBSD.org/cgi/url.cgi?ports/russian/X.language/pkg-descr"><ttclass="FILENAME">russian/X.language</tt></a> directory and issue the followingcommand:</p><pre class="SCREEN"><samp class="PROMPT">#</samp> <kbd class="USERINPUT">make install</kbd></pre><p>The above port installs the latest version of the KOI8-R fonts. <bclass="APPLICATION"><span class="TRADEMARK">XFree86</span> 3.3</b> already has someKOI8-R fonts, but these are scaled better.</p><p>Check the <var class="LITERAL">"Files"</var> section in your <ttclass="FILENAME">/etc/XF86Config</tt> file. The following lines must be added <spanclass="emphasis"><i class="EMPHASIS">before</i></span> any other <varclass="LITERAL">FontPath</var> entries:</p><pre class="PROGRAMLISTING">FontPath "/usr/X11R6/lib/X11/fonts/cyrillic/misc"FontPath "/usr/X11R6/lib/X11/fonts/cyrillic/75dpi"FontPath "/usr/X11R6/lib/X11/fonts/cyrillic/100dpi"</pre><p>If you use a high resolution video mode, swap the 75 dpi and 100 dpi lines.</p></li><li><p>To activate a Russian keyboard, add the following to the <varclass="LITERAL">"Keyboard"</var> section of your <tt class="FILENAME">XF86Config</tt>file.</p><p>For <b class="APPLICATION"><span class="TRADEMARK">XFree86</span> 3.X</b>:</p><pre class="PROGRAMLISTING">XkbLayout "ru"XkbOptions "grp:caps_toggle"</pre><p>For <b class="APPLICATION"><span class="TRADEMARK">XFree86</span> 4.X</b>:</p><pre class="PROGRAMLISTING">Option "XkbLayout" "ru"Option "XkbOptions" "grp:caps_toggle"</pre><p>Also make sure that <var class="LITERAL">XkbDisable</var> is turned off (commentedout) there.</p><p>The RUS/LAT switch will be <b class="KEYCAP">CapsLock</b>. The old <bclass="KEYCAP">CapsLock</b> function is still available via <bclass="KEYCAP">Shift</b>+<b class="KEYCAP">CapsLock</b> (in LAT mode only).</p><p>If you have ``<span class="TRADEMARK">Windows</span>®'' keys on your keyboard, andnotice that some non-alphabetical keys are mapped incorrectly in RUS mode, add thefollowing line in your <tt class="FILENAME">XF86Config</tt> file.</p><p>For <b class="APPLICATION"><span class="TRADEMARK">XFree86</span> 3.X</b>:</p><pre class="PROGRAMLISTING">XkbVariant "winkeys"</pre><p>For <b class="APPLICATION"><span class="TRADEMARK">XFree86</span> 4.X</b>:</p><pre class="PROGRAMLISTING">Option "XkbVariant" "winkeys"</pre><div class="NOTE"><blockquote class="NOTE"><p><b>Note:</b> The Russian XKB keyboard may not work with old <bclass="APPLICATION"><span class="TRADEMARK">XFree86</span></b> versions, see the <ahref="lang-setup.html#RUSSIAN-NOTE">above note</a> for more information. The Russian XKBkeyboard may also not work with non-localized applications as well. Minimally localizedapplications should call a <code class="FUNCTION">XtSetLanguageProc (NULL, NULL,NULL);</code> function early in the program. See <a href="http://koi8.pp.ru/xwin.html"target="_top">KOI8-R for X Window</a> for more instructions on localizing X11applications.</p></blockquote></div></li></ol></div></div><div class="SECT2"><h2 class="SECT2"><a id="AEN27121" name="AEN27121">18.5.2 Traditional ChineseLocalization for Taiwan</a></h2><p>The FreeBSD-Taiwan Project has an Chinese HOWTO for FreeBSD at <ahref="http://netlab.cse.yzu.edu.tw/~statue/freebsd/zh-tut/"target="_top">http://netlab.cse.yzu.edu.tw/~statue/freebsd/zh-tut/</a> using many Chineseports. Current editor for the <var class="LITERAL">FreeBSD Chinese HOWTO</var> is ShenChuan-Hsing <code class="EMAIL"><<ahref="mailto:statue@freebsd.sinica.edu.tw">statue@freebsd.sinica.edu.tw</a>></code>.</p><p>Chuan-Hsing Shen <code class="EMAIL"><<ahref="mailto:statue@freebsd.sinica.edu.tw">statue@freebsd.sinica.edu.tw</a>></code>has created the <a href="http://netlab.cse.yzu.edu.tw/~statue/cfc/" target="_top">ChineseFreeBSD Collection (CFC)</a> using FreeBSD-Taiwan's <varclass="LITERAL">zh-L10N-tut</var>. The packages and the script files are available at <ahref="ftp://freebsd.csie.nctu.edu.tw/pub/taiwan/CFC/"target="_top">ftp://freebsd.csie.nctu.edu.tw/pub/taiwan/CFC/</a>.</p></div><div class="SECT2"><h2 class="SECT2"><a id="AEN27135" name="AEN27135">18.5.3 German Language Localization(for All ISO 8859-1 Languages)</a></h2><p>Slaven Rezic <code class="EMAIL"><<ahref="mailto:eserte@cs.tu-berlin.de">eserte@cs.tu-berlin.de</a>></code> wrote atutorial how to use umlauts on a FreeBSD machine. The tutorial is written in German andavailable at <a href="http://www.de.FreeBSD.org/de/umlaute/"target="_top">http://www.de.FreeBSD.org/de/umlaute/</a>.</p></div><div class="SECT2"><h2 class="SECT2"><a id="AEN27143" name="AEN27143">18.5.4 Japanese and Korean LanguageLocalization</a></h2><p>For Japanese, refer to <a href="http://www.jp.FreeBSD.org/"target="_top">http://www.jp.FreeBSD.org/</a>, and for Korean, refer to <ahref="http://www.kr.FreeBSD.org/" target="_top">http://www.kr.FreeBSD.org/</a>.</p></div><div class="SECT2"><h2 class="SECT2"><a id="AEN27154" name="AEN27154">18.5.5 Non-English FreeBSDDocumentation</a></h2><p>Some FreeBSD contributors have translated parts of FreeBSD to other languages. Theyare available through links on the <a href="../../../../index.html" target="_top">mainsite</a> or in <tt class="FILENAME">/usr/share/doc</tt>.</p></div></div><div class="NAVFOOTER"><hr align="LEFT" width="100%" /><table summary="Footer navigation table" width="100%" border="0" cellpadding="0"cellspacing="0"><tr><td width="33%" align="left" valign="top"><a href="l10n-compiling.html"accesskey="P">Prev</a></td><td width="34%" align="center" valign="top"><a href="index.html"accesskey="H">Home</a></td><td width="33%" align="right" valign="top"><a href="cutting-edge.html"accesskey="N">Next</a></td></tr><tr><td width="33%" align="left" valign="top">Compiling I18N Programs</td><td width="34%" align="center" valign="top"><a href="l10n.html" accesskey="U">Up</a></td><td width="33%" align="right" valign="top">The Cutting Edge</td></tr></table></div><p align="center"><small>This, and other documents, can be downloaded from <ahref="ftp://ftp.FreeBSD.org/pub/FreeBSD/doc/">ftp://ftp.FreeBSD.org/pub/FreeBSD/doc/</a>.</small></p><p align="center"><small>For questions about FreeBSD, read the <ahref="http://www.FreeBSD.org/docs.html">documentation</a> before contacting <<ahref="mailto:questions@FreeBSD.org">questions@FreeBSD.org</a>>.<br />For questions about this documentation, e-mail <<ahref="mailto:doc@FreeBSD.org">doc@FreeBSD.org</a>>.</small></p></body></html>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -