nerdexam
CompTIA

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.

Shells, Scripting and Data Management

Question

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).

Options

  • Aexport LANGUAGE="pt"
  • Bexport MESSAGE="pt"
  • Cexport LANG="pt"
  • Dexport LC_MESSAGES="pt"
  • Eexport ALL_MESSAGES="pt"

How the community answered

(21 responses)
  • A
    5% (1)
  • C
    86% (18)
  • E
    10% (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`.

Aexport LANGUAGE="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.

Bexport MESSAGE="pt"

`MESSAGE` is not a standard environment variable used for locale or language configuration in Linux.

Cexport LANG="pt"Correct

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.

Dexport LC_MESSAGES="pt"Correct

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.

Eexport ALL_MESSAGES="pt"

`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

#localization#internationalization#environment variables#LANG

Community Discussion

No community discussion yet for this question.

Full LX0-104 Practice