LX0-104 · 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". To change the language of messages for internationalized programs to Portuguese, both the LANG and LC_MESSAGES environment variables should be exported with the value pt.
Question
Options
- Aexport LANGUAGE="pt"
- Bexport MESSAGE="pt"
- Cexport LANG="pt"
- Dexport LC_MESSAGES="pt"
- Eexport ALL_MESSAGES="pt"
How the community answered
(21 responses)- A5% (1)
- C86% (18)
- E10% (2)
Why each option
To change the language of messages for internationalized programs to Portuguese, both the `LANG` and `LC_MESSAGES` environment variables should be exported with the value `pt`.
The `LANGUAGE` environment variable is a GNU extension for specifying a search path for message catalogs, but `LANG` and `LC_MESSAGES` are the primary POSIX variables for setting the locale and message language.
`MESSAGE` is not a standard environment variable used for locale or language configuration in Linux.
The `LANG` environment variable sets the primary locale for the system, which includes the language. Exporting `LANG="pt"` sets Portuguese as the default language for all locale categories.
The `LC_MESSAGES` environment variable specifically controls the language used for program messages, error outputs, and menus, allowing for fine-grained control over message localization by overriding the general `LANG` setting for this category.
`ALL_MESSAGES` is not a standard environment variable used for locale or language configuration in Linux.
Concept tested: Linux locale and internationalization environment variables
Source: https://man7.org/linux/man-pages/man7/locale.7.html
Topics
Community Discussion
No community discussion yet for this question.