LFCS practice question 1 of 35

Which of the following commands should be added to /etc/bash_profile in order to change the language of messages for an internationalized program to Portuguese (pt)?

Full set: 260 questions
Answer options
A: export LANGUAGE="pt"
B: export MESSAGE="pt"
C: export UI_MESSAGES="pt"
D: export LC_MESSAGES="pt" Correct answer
E: export ALL_MESSAGES="pt"
Correct Answer:
D. export LC_MESSAGES="pt"
Explanation

In Linux, locale settings are controlled by a set of environment variables, typically prefixed with LC. The LCMESSAGES variable specifically governs the language and encoding used for displaying informational messages, error messages, and interactive prompts. By setting export LCMESSAGES="pt", you instruct internationalized programs to use their Portuguese message catalogs, if available. This command is placed in a profile script like /etc/bashprofile to apply the setting for users upon login.

Why Incorrect

A. LANGUAGE is a GNU extension that specifies a priority list of languages, used as a fallback if LCALL or LCMESSAGES is unset.
B. MESSAGE is not a standard environment variable for controlling locale message settings in Linux.
C. UIMESSAGES is not a standard environment variable for controlling locale message settings in Linux.
E. ALLMESSAGES is not a standard environment variable for controlling locale message settings in Linux.

References

1. locale(7) Linux manual page. The "ENVIRONMENT" section lists and describes the LC variables, stating that LCMESSAGES "determines the locale to be used for messages."

2. The GNU C Library (glibc) Manual, "1.4 Locale Categories." This section details the purpose of each LC category, defining LCMESSAGES for "messages which are printed by library functions or programs to the user."

3. Ubuntu Server Guide, "Localization." The section on "The LANG and LANGUAGE variables" explains the hierarchy and function of locale environment variables, including LCMESSAGES.

Scroll to Top