2.3 Localization Flashcards

2
Q

Why is it important to configure locale settings?

A

The locale settings determine the way inforation is displayed on the computer and how data is encoded. If set incorrectly, information may be presented to users in ways that are unfamiliar to them, and data integrity issues may occur within applications and databases.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

What type of elements can be configured using the locale settings?

A

The locale settings can configure the language and encoding of the text displayed on screen, character classes, sort order, number formatting, currency type, currency format, and date/time format.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
4
Q

What is the syntax of the locale settings?

A

The locale setting uses the format: Language_territory.codset@modifier. Examples: en_GB.UTF-8 and de_DE.euro.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
5
Q

Which environment variable overrides all other locale settings?

A

The LC_ALL variable is a special variable for overriding all other settings. It sets all locales to the same setting.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
6
Q

What is a locale?

A

A locale is a set of files that Linux uses to determine country and language-specific settings for various applications.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
7
Q

What does the locale setting do?

A

The locale setting determines the way data displays on a computer:

  • The language and encoding of the text displayed on screen
  • Character classes
  • Sort order
  • Number formatting
  • Currency type and format
  • Date and time display
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
8
Q

What are the key characteristics of the locale setting?

A

The locale setting:

  • Uses configuration files that are part of the system library and are located in /usr/share/locale on most distributions.
  • Uses language codes specified in ISO-639 and county codes specified in ISO-3166.
  • Uses the format: language_territory.codset@modifier. Examples: en_GB.UTF-8, de_DE.euro, and en_IE.iso885915@euro.
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
9
Q

How are locale codes implemented?

A

Locale codes are implemented using environment variables. For example LANG=en_US.UTF-8 specifies that the computer uses US English with a UTF-8 encoding when displaying information.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
10
Q

What are the four components of the locale setting?

A
  1. Language - ISO 639 language code, always lowercase
  2. Territory - ISO 3166 country code, always uppercase
  3. Codeset - Encoding format, such as UTF-8 or UTF-16
  4. Modifier - Seldom used
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
11
Q

What is the order of precedence for the locale variables?

A
  • If the LC_ALL variable is set, it overrides all LC_* variables, whether they are set or not. They are not even checked.
  • if the LC_ALL variable is not set or is null, then the values of the individual LC_* variables are used.
  • if the LC_ALL variable is not set and an individual LC_* variable is not set or is null, then the value of the LANG variable is used as the value of the unset LC_* variable.
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
12
Q

How do you view all current locale settings?

A

The locale command displays all current locale settings.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
13
Q

What does the locale command do?

A

The locale command displays all current locale settings.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
14
Q

How do you view the current encoding being used on the system?

A

The locale charmap command displays the current encoding being used on the system.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
15
Q

What does the locale charmap command do?

A

The locale charmap command displays the current encoding being used on the system.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
16
Q

How do you view a list of all available locale settings on the system?

A

The locale -a command displays a list of all available locale settings on the system.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
17
Q

What does the locale -a command do?

A

The locale -a command displays a list of all available locale settings on the system.

18
Q

How do you view a list of all available encodings on the system?

A

The locale -m command displays a list of all available encodings on the system.

19
Q

What does the locale -m command do?

A

The locale -m command displays a list of all available encodings on the system.

20
Q

How can you convert from one encoding to another?

A

The iconv command converts from one encoding to another.

21
Q

What does the command iconv -f ISO8859-1 -t UTF-8 infile.txt do?

A

Converts the file infile.txt from ISO8859-1 encoding to UTF-8 and writes the result to standar output. (You can write the result to a new file using redirection or with the -o file_name option.)

22
Q

What does the LANG locale variable do?

A

The LANG variable defines all locale settings at once, while allowing further individual customization via the LC_* settings.

23
Q

What does setting the locale variable LANG=C accomplish?

A

When LANG=C, programs display output without passing it through locale translations. This is helpful when the output is being corrupted by the locale, and will help avoid some types of problems, such as when using pipelines and scripts that pass on a program’s data to another program in binary form.

24
Q

Whose responsibility is localization support?

A

Localization support is the responsibility of the program’s author. Many programs only support one language or a small subset of languages.

25
Q

What does the LC_CTYPE locale variable do?

A

The LC_CTYPE variable defines the character handling properties for the computer. This determines whether characters are recognized as alphabetical, numeric and so on. This also determines the character set used, if applicable.

26
Q

What does the LC_MESSAGES locale variable do?

A

The LC_MESSAGES variable specifies localizations for applications that use a message-based localization scheme.

27
Q

What does the LC_COLLATE locale variable do?

A

The LC_COLLATE variable defines the alphabetical ordering of strings, such as the output of sorted directory listings.

28
Q

What does the LC_NUMERIC locale variable do?

A

The LC_NUMERIC variable defines formatting for numeric values that are not monetary. It affects things such as the thousands separator and the decimal separator.

29
Q

What does the LC_MONETARY locale variable do?

A

The LC_MONETARY variable defines currency units and formatting of currency type and numeric values.

30
Q

What does the LC_TIME locale variable do?

A

The LC_TIME variable defines formatting for dates and times.

31
Q

What does the LC_PAPER locale variable do?

A

The LC_PAPER variable defines the default paper size.

32
Q

What does the LC_NAME locale variable do?

A

The LC_NAME variable specifies personal name format. This includes things like whether the surname comes first or last.

33
Q

What does the LC_ADDRESS locale variable do?

A

The LC_ADDRESS variable is used for address formatting.

34
Q

What does the LC_TELEPHONE locale variable do?

A

The LC_TELEPHONE variable defines telephone number format.

35
Q

What does the LC_MEASUREMENT locale variable do?

A

The LC_MEASUREMENT variable determines what measurement units are used.

36
Q

What does the LANGUAGE locale variable do?

A

The LANGUAGE variable is used as an override for LC_MESSAGES.

37
Q

What does the LC_ALL locale variable do?

A

The LC_ALL variable is a special variable for overriding all other settings. It sets all locales to the same setting.

38
Q

Which directory contains the locale configuration files on a Linux distribution?

A

The /usr/share/locale directory contains the locale configuration files on a Linux distribution.