# 25.4.特定语言的区域配置

## 25.4.1. 俄语语言（KOI8-R 编码）

本节展示了将 FreeBSD 系统本地化为俄语所需的特定设置。有关每种设置类型的完整描述，请参阅[使用本地化](https://docs.freebsd.org/en/books/handbook/l10n/#using-localization)。

要为登录 shell 设置此语言环境，向每个用户的 **\~/.login\_conf** 文件中添加以下行：

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

要配置控制台，向 **/etc/rc.conf** 文件中添加以下行：

```ini
keymap="ru.utf-8"
scrnmap="utf-82cp866"
font8x16="cp866b-8x16"
font8x14="cp866-8x14"
font8x8="cp866-8x8"
mousechar_start=3
```

对于 **/etc/ttys** 中的每个 `ttyv` 条目，使用 `cons25r` 作为终端类型。

要配置打印功能，需要一个特殊的输出过滤器将 KOI8-R 转换为 CP866，因为大多数带有俄语字符的打印机使用硬件代码页 CP866。FreeBSD 包含一个默认过滤器用于此目的，路径为 **/usr/libexec/lpr/ru/koi2alt**。要使用此过滤器，在 **/etc/printcap** 文件中添加以下条目：

```ini
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)](https://man.freebsd.org/cgi/man.cgi?query=printcap\&sektion=5\&format=html)。

要为挂载的 MS-DOS® 文件系统配置俄语文件名，在 **/etc/fstab** 中添加条目时包括 `-L` 和语言环境名称：

```sh
/dev/ad0s2      /dos/c  msdos   rw,-Lru_RU.KOI8-R 0 0
```

有关更多细节，请参阅 [mount\_msdosfs(8)](https://man.freebsd.org/cgi/man.cgi?query=mount_msdosfs\&sektion=8\&format=html)。

要为 Xorg 配置俄语字体，安装 [x11-fonts/xorg-fonts-cyrillic](https://cgit.freebsd.org/ports/tree/x11-fonts/xorg-fonts-cyrillic/) 包。然后，检查 **/etc/X11/xorg.conf** 文件中的 `"Files"` 部分。以下行必须在任何其他 `FontPath` 条目之前添加：

```ini
FontPath   "/usr/local/lib/X11/fonts/cyrillic"
```

更多的西里尔字母字体可以在 Ports 中找到。

要启用俄语键盘，在 **/etc/xorg.conf** 的 `"Keyboard"` 部分中添加以下行：

```ini
Option "XkbLayout"   "us,ru"
Option "XkbOptions"  "grp:toggle"
```

确保该文件中的 `XkbDisable` 被注释掉。

对于 `grp:toggle`，使用右 Alt 键；对于 `grp:ctrl_shift_toggle`，使用 **Ctrl**+**Shift**；对于 `grp:caps_toggle`，使用 CapsLock。在 LAT 模式下，仍然可以使用 **Shift**+**CapsLock** 访问旧的 CapsLock 功能。`grp:caps_toggle` 在 Xorg 中因某些未知原因无法工作。

如果键盘上有“Windows®”键，且某些非字母键映射不正确，可以在 **/etc/xorg.conf** 中添加以下行：

```ini
Option "XkbVariant" ",winkeys"
```

> **注意**
>
> 俄语 XKB 键盘可能无法与未本地化的应用程序一起使用。最小本地化的应用程序应在程序早期调用 `XtSetLanguageProc (NULL, NULL, NULL)` 函数。

请参阅 <http://koi8.pp.ru/xwin.html> 以获取更多关于 Xorg 应用程序本地化的说明。有关 KOI8-R 编码的更多一般信息，请参考 <http://koi8.pp.ru/>。

## 25.4.2. 其他语言特定资源

本节列出了一些为配置其他语言环境提供的附加资源。

### 台湾的繁体中文

FreeBSD-Taiwan 项目为 FreeBSD 提供了中文 HOWTO，网址为 <http://netlab.cse.yzu.edu.tw/~statue/freebsd/zh-tut/>。

### 希腊语本地化

有关 FreeBSD 中希腊语支持的完整文章，请访问 [此处](https://www.freebsd.org/doc/gr/articles/greek-language-support/)，仅有希腊语版本，作为官方 FreeBSD 希腊文文档的一部分。

### 日语和韩语本地化

对于日语，请参阅 [http://www.jp.FreeBSD.org/](http://www.jp.freebsd.org/)，对于韩语，请参阅 [http://www.kr.FreeBSD.org/](http://www.kr.freebsd.org/)。

### 非英语 FreeBSD 文档

一些 FreeBSD 贡献者已将 FreeBSD 文档的部分内容翻译为其他语言。可以通过 [FreeBSD 网站](https://www.freebsd.org/) 或 **/usr/share/doc** 中的链接访问这些文档。


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://handbook.bsdcn.org/di-25-zhang-ben-di-hua-i18nl10n-de-shi-yong-he-she-zhi/25.4.-te-ding-yu-yan-de-qu-yu-pei-zhi.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
