13.5. Localizing FreeBSD to Specific Languages

13.5.1. 俄語 (KOI8-R 字碼)

Originally contributed by Andrey A. Chernov .

想要得到更多有關 KOI8-R 字碼的資訊,請看 KOI8-R References (俄語網路字元集)

13.5.1.1. Locale Setup

Put the following lines into your ~/.login_conf file:

    me:My Account:\
    	:charset=KOI8-R:\
    	:lang=ru_RU.KOI8-R:

See earlier in this chapter for examples of setting up the locale.

13.5.1.2. 終端機設定

  • For the FreeBSD versions before 5.0 把下面這行加到您的核心設定檔裡:

        options		SC_MOUSE_CHAR=0x03

    For the FreeBSD versions 5.0 and up insert the following line into /etc/rc.conf:

        mousechar_start=3
  • /etc/rc.conf 中的俄語終端機設定應該長得像:

        keymap="ru.koi8-r"
        scrnmap="koi8-r2cp866"
        font8x16="cp866b-8x16"
        font8x14="cp866-8x14"
        font8x8="cp866-8x8"
  • 每個 /etc/ttysttyv* 的終端機型態則要從 cons25 換成 cons25r

See earlier in this chapter for examples of setting up the console.

13.5.1.3. 印表機設定

大多數附有俄文字型的印表機的硬體字型頁碼都是 CP866,所以必須要有一個轉換程式來做 KOI8-R -> CP866 的工作。系統安裝好以後內定的轉換程式是 /usr/libexec/lpr/ru/koi2alt。 所以想要使用俄文印表機的使用者必須在 /etc/printcap 做下列設定:

    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:

想要獲得更多資訊,請看 printcap(5)

13.5.1.4. MS-DOS FS 以及俄文檔名

下面是在 fstab(5) 中啟動 MSDOS FS 俄文檔名支援的例子:

    /dev/ad0s2      /dos/c  msdos   rw,-W=koi2dos,-L=ru_RU.KOI8-R 0 0

請看 mount_msdos(8) 以得到有關 -W-L 選項的詳細說明。

13.5.1.5. X11 設定

  1. 先把 非 X 的 locale 設定 設好。

    Note: 俄文 KOI8-R locale 可能無法在舊版的 XFree86 (低於 3.3 版者) 下正常運作。 /usr/ports/x11/XFree86 裡的 XFree86 port 是最新版的 XFree86 ,所以果您是從那裡安裝 XFree86 的話,它會正常運作。隨著最新版 FreeBSD 套件一起發行的 XFree86 也可以正常運作 (當然要先檢查看看版本是不是小於 3.3) 。

  2. /usr/ports/russian/X.language 目錄下並執行以下的指令:

        # make install

    這個 port 會把最新版的 KOI8-R 字型安裝上去。 XFree86 3.3 已經有一些 KOI8-R 字型了, 不過這套字型的縮放功能比較好。

    檢查您的 /etc/XF86Config"Files" 段落,下面這幾行必須要放在其他 FontPath 的前面:

        FontPath   "/usr/X11R6/lib/X11/fonts/cyrillic/misc"
        FontPath   "/usr/X11R6/lib/X11/fonts/cyrillic/75dpi"
        FontPath   "/usr/X11R6/lib/X11/fonts/cyrillic/100dpi"

    如果您用的是高解析度顯示模示的話,把 75 dpi 和 100 dpi 這兩行對調過來。

  3. To activate a Russian keyboard, add the following to the "Keyboard" section of your XF86Config file.

    For XFree86 v3.*:

        XkbLayout  "ru"
        XkbOptions "grp:caps_toggle"

    For XFree86 v4.*:

        Option "XkbLayout"   "ru"
        Option "XkbOptions"  "grp:caps_toggle"

    並確定您的XkbDisable 是關掉 (被註解掉了)的狀態。

    CapsLock 被用來當作 RUS/LAT 的切換。 而 Shift+CapsLock 做的則是舊的 CapsLock 的功能(只有在 LAT 模式下才是如此) 。

    If you have "Windows" keys on your keyboard, and notice that some non-alphabetical keys are mapped incorrectly in RUS mode, add the following line in your XF86Config file.

    For XFree86 v3.*:

        XkbVariant "winkeys"

    For XFree86 v4.*:

        Option "XkbVariant" "winkeys"

    Note: 俄文的 XKB 鍵盤可能無法在舊版的 XFree86 下正常運作。請看 above note 以得到更多資訊。俄文的 XKB 鍵盤也無法在 non-localized 的應用程式下正常運作,至少 localized 的應用程式必須在程式的一開始就呼叫 XtSetLanguageProc (NULL, NULL, NULL); 函數。 See KOI8-R for X-Window for more instructions on localizing X11 applications.

13.5.2. Traditional Chinese Localization for Taiwan

The FreeBSD-Taiwan Project has an I18N/L10N tutorial for FreeBSD at http://freebsd.sinica.edu.tw/~ncvs/zh-l10n-tut/index.html using many /usr/ports/chinese/* applications. The editor for the zh-L10N-tut is Clive Lin . You can also cvsup the following collections at freebsd.sinica.edu.tw:

CollectionDescription
outta-port tag=.Beta-quality Ports Collection for Chinese
zh-L10N-tut tag=.Localizing FreeBSD Tutorial in BIG-5 Traditional Chinese
zh-doc tag=.FreeBSD Documentation Translation to BIG-5 Traditional Chinese

Chuan-Hsing Shen has created the Chinese FreeBSD Collection (CFC) using FreeBSD-Taiwan's zh-L10N-tut. The packages and the script files are available at ftp://ftp.csie.ncu.edu.tw/OS/FreeBSD/taiwan/CFC/.

13.5.3. 德語 (ISO 8859-1)

Slaven Rezic 寫了一份有關如何在 FreeBSD 下使用德語變母音的教學文件。 這份文件是用德文寫成的,您可以在 http://www.de.FreeBSD.org/de/umlaute/ 取得這份文件。

13.5.4. Japanese and Korean Language Localization

For Japanese, refer to http://www.jp.FreeBSD.org/, and for Korean, refer to http://www.kr.FreeBSD.org/.

13.5.5. Non-English FreeBSD Documentation

Some FreeBSD contributors have translated parts of FreeBSD to other languages. They are available through links on the main site or in /usr/share/doc.