LFCS · Question #236
Which of the following commands should be added to /etc/bash_profile to change the language of messages from an internationalised program to Portuguese (pt)? (Select TWO).
The correct answer is C. export LANG="pt" D. export LC_MESSAGES="pt". The language for messages from internationalized programs is primarily controlled by the LANG and LC_MESSAGES environment variables.
Question
Options
- Aexport LANGUAGE="pt"
- Bexport MESSAGE="pt"
- Cexport LANG="pt"
- Dexport LC_MESSAGES="pt"
- Eexport ALL_MESSAGES="pt"
How the community answered
(20 responses)- B5% (1)
- C90% (18)
- E5% (1)
Why each option
The language for messages from internationalized programs is primarily controlled by the `LANG` and `LC_MESSAGES` environment variables.
`LANGUAGE` is a GNU extension that specifies a priority list of languages for message translation, but `LANG` and `LC_MESSAGES` are the more fundamental POSIX variables for setting the current locale and message language directly.
`MESSAGE` is not a standard environment variable used for controlling language settings in internationalized programs.
The `LANG` environment variable sets the overall locale, which includes the default language for all `LC_*` categories if they are not explicitly set, instructing internationalized programs to use Portuguese for messages.
The `LC_MESSAGES` environment variable specifically controls the language used for program messages, such as prompts, error messages, and status output, ensuring these are displayed in Portuguese.
`ALL_MESSAGES` is not a standard environment variable used for controlling language settings in internationalized programs.
Concept tested: Linux locale and language configuration
Source: https://man7.org/linux/man-pages/man7/locale.7.html
Topics
Community Discussion
No community discussion yet for this question.