This is Gentoo's testing wiki. It is a non-operational environment and its textual content is outdated.
Please visit our production wiki at https://wiki.gentoo.org
Localization/Guide/ko
시간대
거주 지역에 따른 시스템의 시간을 적절하게 유지하려면 시간대를 선택해야합니다. OpenRC 기반 시스템 과 systemd 기반 시스템에서 시간을 설정하는 방법은 system time에 있습니다.
로캘 시스템
로캘이 무엇인가요?
A locale is a set of information that most programs use for determining country and language specific settings. The locales and their data are part of the system library and can be found at /usr/share/i18n/locales/ on most systems. A locale name is generally named ab_CD
where ab
is the two (or three) letter language code (as specified in ISO-639) and CD
is the two letter country code (as specified in ISO-3166). Variants like @euro
or @latin
are often appended to locale names, e.g. de_DE@euro
or nan_TW@latin
. Please explore Wikipedia to read more about locales and related articles.
로캘 환경 변수
로캘 설정의 다른 양상을 다루는 변수는 아래 표에 주어져 있습니다. 각각의 변수는 위에 주어진 ab_CD
형식과 같은 로캘 이름을 갖습니다.
Variable name | Explanation |
---|---|
LANG | Defines all locale settings at once, while allowing further individual customization via the LC_* settings below. |
LC_COLLATE | Define alphabetical ordering of strings. This affects e.g. output of sorted directory listings. |
LC_CTYPE | Define the character-handling properties for the system. This determines which characters are seen as alphabetic, numeric, and so on. This also determines the character set used, if applicable. |
LC_MESSAGES | Programs' localizations stored in /usr/share/locale/ for applications that use a message-based localization scheme (the majority of GNU programs; see the next chapters for further information on which programs do, and how to get the programs that don't to work). |
LC_MONETARY | Defines currency units and formatting of currency-type numeric values. |
LC_NUMERIC | Defines formatting of numeric values which aren't monetary. Affects things such as thousand separator and decimal separator. |
LC_TIME | Defines formatting of dates and times. |
LC_PAPER | Defines default paper size. |
LC_ALL | Overrides all other settings. |
에스토니아어권과 같은 일부 로캘의 경우 다른 정렬 기준을 사용하는데 반해, 어떤 프로그램은 기대하던 대로 기존의 영문 알파벳 정렬순서 방식으로 작성합니다. 따라서 시스템 범위 설정을 다룰 경우 LC_COLLATE 값을 C로 확실하게 설정하는것을 권장합니다.
나중에 모든 LC_* 변수 값을 다른 값으로 중복 우선적용하지 않도록 LC_ALL 변수의 사용을 적극 만류합니다. LC_ALL 변수 값을 설정하면 이 변수를 널 값으로 설정하기 전까지 다른 의미로 설정한 값을 바꾼다는 의미입니다. 시작 파일에서 이 변수값을 설정하지 않는게 좋습니다.
Most typically, users only set the LANG variable globally.
특정 로캘 생성
Most users will probably only use one or maybe two locales on their system. How additional locales can be specified is explained in the /etc/locale.gen file.
'"`UNIQ--pre-00000001-QINU`"'
This is a deprecated template. Help us update this template!
Use an
@euro
value from /usr/share/i18n/SUPPORTED/ as the locale when using the Euro currency symbol (€) on non UTF-8 based locales.다음 단계에서 locale-gen을 실행하십시오. /etc/locale.gen파일에 정의한 모든 로캘을 생성하며 locale-archive(/usr/lib/locale/locale-archive)에 기록합니다.
root #
locale-gen
* Generating 4 locales (this might take a while) with 1 jobs * (1/4) Generating en_GB.ISO-8859-1 ... [ ok ] * (2/4) Generating en_GB.UTF-8 ... [ ok ] * (3/4) Generating de_DE.ISO-8859-1 ... [ ok ] * (4/4) Generating de_DE.ISO-8859-15@euro ... [ ok ] * Generation complete
Verify that the selected locales are available by running locale -a.
user $
locale -a
C POSIX de_DE de_DE.iso88591 de_DE.iso885915@euro de_DE@euro deutsch en_GB en_GB.iso88591 en_GB.utf8 german
The /usr/lib/locale/locale-archive file can be shown by localedef.
user $
localedef --list-archive
Its raw content can be displayed using the strings command.
user $
strings /usr/lib/locale/locale-archive | less
로캘 설정
OpenRC
OpenRC 로캘 설정을 환경 변수에 저장했다고 해봅니다. 보통 /etc/env.d/02locale(시스템 범위) 와 ~/.bashrc (사용자 정의) 파일에 지정합니다. 자세한 내용은 UTF-8 게시글에 있습니다. /etc/env.d/02locale 시스템 영역 설정 파일은 eselect locale로 관리할 수 있습니다. 예를 들어 LANG 변수를 C
값으로 설정하려면:
root #
eselect locale list
Available targets for the LANG variable: [1] C [2] POSIX [3] en_US [4] en_US.iso885915 [5] en_US.utf8 [ ] (free form)
root #
eselect locale set 1
Of course, editing the file manually is possible as well to diversify the locale variables.
/etc/env.d/02locale
/etc/env.d/02locale에 기본 시스템 로캘 설정LANG="de_DE.UTF-8" LC_COLLATE="C"
It's also possible, and pretty common especially in a more traditional UNIX environment, to leave the global settings unchanged, i.e. in the C
locale. Users can still specify their preferred locale in their own shell RC file:
~/.bashrc
사용자 로캘 설정export LANG="de_DE.UTF-8" export LC_COLLATE="C"
Another way of configuring system is to leave it in the default C
locale, but enable UTF-8 character representation at the same time. This option is achieved using the following settings in /etc/env.d/02locale:
'"`UNIQ--pre-0000000B-QINU`"'
This is a deprecated template. Help us update this template!
Using the above snippet, users will be able to see localized file names properly, while not being forced to completely use the selected language.
Once the right locale is set up, be sure to update the environment variables to make the system aware of the change.
시스템 범위 기본 로캘:
root #
env-update && source /etc/profile
사용자 지정 로캘:
user $
source ~/.bashrc
그 다음 Ctrl + Alt + Backspace 키를 눌러 X 서버를 죽이고 로그아웃 한 다음 사용자로 로그인하십시오.
이제, 설정한 내용이 제대로 바뀌었는지 확인해보겠습니다:
user $
locale
systemd
With systemd set the locale with the localectl command. Check the list of available locales with:
root #
localectl list-locales
그 다음 원하는 로캘을 선택하십시오:
root #
localectl set-locale LANG=de_DE.utf8
마지막으로 결과가 괜찮은지 확인하십시오:
root #
localectl | grep "System Locale"
System Locale: LANG=de_DE.utf8
콘솔용 키보드 배치
OpenRC
The keyboard layout used by the console is set in /etc/conf.d/keymaps by the keymap variable. Valid values can be found in /usr/share/keymaps/YOUR_ARCH/. i386 has further subdivisions into layout (qwerty/, azerty/, etc.). Some languages have multiple options - experiment with the various options to decide which one fits the needs best.
/etc/conf.d/keymaps
콘솔 키맵 설정keymap="de" #keymap="de-latin1" #keymap="de-latin1-nodeadkeys"
systemd
With systemd the keymap layout used for the console can be set using the localectl command. First check the available keymap layouts:
root #
localectl list-keymaps
Then set the requested console keymap layout:
root #
localectl set-keymap it
마지막으로 콘솔 키맵 배치를 올바르게 설정했는지 확인하십시오:
root #
localectl | grep "VC Keymap"
VC Keymap: it
X 서버용 키보드 배치
OpenRC
The keyboard layout to be used by the X server is specified in /etc/X11/xorg.conf.d/30-keyboard.conf by the XkbLayout option. For details visit the Xorg guide and the article about Keyboard layout switching.
systemd
systemd 에서 X11 서버용 키보드 배치는 localectl 명령으로 설정할 수 있습니다. 먼저 존재하는 X11 키보드 배치가 어떤 것들이 있는지 확인하십시오:
root #
localectl list-x11-keymap-layouts
다음 요청한 X11 키맵 배치를 설정하십시오:
root #
localectl set-x11-keymap it
마지막으로 X11 키맵 배치를 올바르기 설정했는지 확인하십시오:
root #
localectl | grep "X11 Layout"
X11 Layout: it
NLS
메시지 기반 지역화를 지원하는 프로그램에서 지역별 표시가 동작하고, nls
(Native Language Support) USE 플래그 설정을 보유하게 하려면, USE 플래그를 설정한 상태에서 프로그램을 컴파일하십시오. /usr/share/locale/<locale>/LC_MESSAGES/<package>.mo 파일에 메시지 문자열이 있습니다. nls를 사용하는 대부분의 프로그램은 지역화 메시지를 추출해서 사용할 gettext 라이브러리도 필요합니다. 물론, 포티지는 필요한 경우 자동으로 설치합니다.
nls
USE 플래그를 활성화 하면 일부 꾸러미를 다시 이머지 해야합니다:
root #
emerge --ask --changed-use --deep --with-bdeps=y @world
LINGUAS
There is also an additional USE_EXPAND flag called LINGUAS [1], which affects the localization files that get installed in gettext-based programs. The variable takes in space-separated list of language codes, and a suggested place to set it is /etc/portage/make.conf:
root #
nano -w /etc/portage/make.conf
## (Add in the LINGUAS variable. For instance, for German, Finnish and English:) LINGUAS="de fi en"
LINGUAS=""
로 설정하면 대부분의 이빌드에서 꾸러미 기본 언어로 설치하며, 어떤 LC_MESSAGES
파일도 설치하지 않습니다. 또한 그 이상의 어떤 언어 꾸러미도 다운로드하고 설치하지도 않습니다. 예를 들어 현재 app-office/libreoffice 안정 꾸러미는 LINGUAS
에 정의한 언어 꾸러미를 다운로드하고 설치하는 app-office/libreoffice-l10n 에서 언어 지원을 받습니다. libreoffice의 기본 언어는 en_US
이며 app-office/libreoffice-l10n에는 en_US
플래그가 없습니다. 따라서 libreoffice에서는 LINGUAS=""
설정을 참고하여 en_US
언어를 지원합니다.
A list of installed programs making use of the LINGUAS USE_EXPAND flag and their supported languages can be shown as follows:
user $
eix -I -U linguas
사용할 수 있는 LINGUAS 변수 값 목록은 /usr/portage/profiles/desc/linguas.desc 파일로 제공합니다:
user $
grep -i french /usr/portage/profiles/desc/linguas.desc
fr - French locale fr_CA - French locale for Canada fr_FR - French locale for France
After setting the LINGUAS USE_EXPAND flag it may be necessary to re-emerge some packages:
root #
emerge --ask --changed-use --deep --with-bdeps=y @world
LINGUAS as a USE_EXPAND'ed variable is being replaced by the L10N variable (see below). This avoids a conceptual clash with the standard gettext behaviour. After a transition time for packages to be converted, LINGUAS will become a regular environment variable.
L10N
Another USE_EXPAND variable called L10N decides which extra localization support will be installed. This is commonly used for downloads of additional language packs by packages. Similar to LINGUAS, the variable takes a space separated list of language tags, and it can be set in /etc/portage/make.conf:
root #
nano -w /etc/portage/make.conf
## (Add in the L10N variable. For instance, for German and Brazilian Portuguese:) L10N="de pt-BR"
To set it per-package, edit /etc/portage/package.use and prefix the requested language packs with "l10n_", as shown in the next example:
/etc/portage/package.use
app-text/aspell l10n_de l10n_pt_BR
Note that while the common two letter language codes (like de
or fr
) are identical in LINGUAS and L10N, more complex entries have a different syntax because L10N uses IETF language tags (aka BCP 47). For example, pt_BR
and sr@latin
in LINGUAS become pt-BR
and sr-Latn
in L10N, respectively.
A list of L10N values that can be used is provided as /usr/portage/profiles/desc/l10n.desc:
user $
grep -i portuguese /usr/portage/profiles/desc/l10n.desc
pt - Portuguese pt-BR - Portuguese (Brazil) pt-PT - Portuguese (Portugal)
After setting the L10N USE_EXPAND variable it may be necessary to re-emerge some packages:
root #
emerge --ask --changed-use --deep --with-bdeps=y @world
추가 참조
- Configuring locales (Gentoo Handbooks)
- Keyboard layout inside the Evdev article
- X resources
- The Euro symbol (€) for the console and in X
외부 자료
- Locales and Internationalization (gnu.org)
- L10N USE_EXPAND variable replacing LINGUAS
- Michał Górny:How LINGUAS are thrice wrong!
- [gentoo-dev] [RFC] How to deal with LINGUAS mess?
- [gentoo-dev] [RFC] Masterplan for solving LINGUAS problems
References
This page is based on a document formerly found on our main website gentoo.org.
The following people contributed to the original document: Alexander Holler, Steven Lucy, Benny Chuang, Lars Weiler, Tobias Scherbaum, Flammie Pirinen, nightmorph, klondike
They are listed here because wiki history does not allow for any external attribution. If you edit the wiki article, please do not add yourself here; your contributions are recorded on each article's associated history page.