How can I change the language preference in .bashrc file

8,167
gedit .bashrc

then put these lines in your ~/.bashrc

export LC_ALL=en_US.UTF-8
export LANG=en_US.UTF-8
export LANGUAGE=en_US.UTF-8

To make these changes active in the current shell, source the .bashrc:

source ~/.bashrc
Share:
8,167

Related videos on Youtube

deepblue_86
Author by

deepblue_86

Updated on September 18, 2022

Comments

  • deepblue_86
    deepblue_86 almost 2 years

    How can I set LANG=en_US.UTF-8 in .bashrc? When I looked into .bashrc, I can't find any LANG settings.

    • Gunnar Hjalmarsson
      Gunnar Hjalmarsson about 9 years
      Do you have a desktop or a server?
    • Maythux
      Maythux about 9 years
      Does the answer solve you problem?!
  • Gunnar Hjalmarsson
    Gunnar Hjalmarsson about 9 years
    The value you assign to LANGUAGE is plain wrong. LANGUAGE expects a list of colon separated language codes without the '.UTF-8' part. Also, why do you suggest that both LC_ALL and LANG are set?
  • Maythux
    Maythux about 9 years
    In case of LANGUAGE i believe it works as though also. linuxquestions.org/questions/red-hat-31/… wangpidong.blogspot.com/2010/01/…
  • Maythux
    Maythux about 9 years
    LC_ALL used to override any LC_* such as LC_MESSAGES, LC_PAPER, LC_NAME, LC_ADDRESS, LC_TELEPHONE....
  • Gunnar Hjalmarsson
    Gunnar Hjalmarsson about 9 years
    Hmm.. I stand corrected as regards LANGUAGE values. When testing I found that it seems to recognize "language codes" which consist of locale names including '.UTF-8'. That's indeed useful to know. Thanks! LC_ALL overrides LANG as well. Typically it's used within programs rather than in the session environment. On a desktop, setting these variables in .bashrc screws up the GUIs for handling languages and locales. That's why I asked the OP if he has a desktop or a server.