Results 1 to 3 of 3

Thread: LANG Environment Variable Is Blank

  1. #1
    Join Date
    Dec 2009
    Beans
    2

    LANG Environment Variable Is Blank

    Hello All,

    I have a program that is expecting a certain format in the LANG env. var. provided by the system and as the title says this env. var. is blank. Output from the locale command:

    Code:
    [PROMPT]:~$ locale
    LANG=
    LANGUAGE=
    LC_CTYPE="POSIX"
    LC_NUMERIC="POSIX"
    LC_TIME="POSIX"
    LC_COLLATE="POSIX"
    LC_MONETARY="POSIX"
    LC_MESSAGES="POSIX"
    LC_PAPER="POSIX"
    LC_NAME="POSIX"
    LC_ADDRESS="POSIX"
    LC_TELEPHONE="POSIX"
    LC_MEASUREMENT="POSIX"
    LC_IDENTIFICATION="POSIX"
    LC_ALL=
    I have tried looking online but no where has any help. Currently I don't have a ~/.pam_environment file so the info for that was useless. Both of the files /etc/default/locale and /etc/environment have the following set.

    Code:
    PATH="/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games"
    LANGUAGE="en_US:en"
    LANG="en_US.UTF-8"
    LC_NUMERIC="en_US.UTF-8"
    LC_TIME="en_US.UTF-8"
    LC_MONETARY="en_US.UTF-8"
    LC_PAPER="en_US.UTF-8"
    LC_IDENTIFICATION="en_US.UTF-8"
    LC_NAME="en_US.UTF-8"
    LC_ADDRESS="en_US.UTF-8"
    LC_TELEPHONE="en_US.UTF-8"
    LC_MEASUREMENT="en_US.UTF-8"
    Any help would be greatly appriciated.

    Thanks!

    EDIT: I also noticed that something is obviously overriting the values from the files /etc/default/locale and /etc/environment but I have no idea where that is....
    Last edited by boot3r; March 21st, 2014 at 12:51 AM.

  2. #2
    Join Date
    Aug 2012
    Location
    Queensland, Australia
    Beans
    Hidden!
    Distro
    Ubuntu 12.04 Precise Pangolin

    Re: LANG Environment Variable Is Blank

    Quote Originally Posted by boot3r View Post
    Hello All,

    I have a program that is expecting a certain format in the LANG env. var. provided by the system and as the title says this env. var. is blank. Output from the locale command:

    Code:
    [PROMPT]:~$ locale
    LANG=
    LANGUAGE=
    LC_CTYPE="POSIX"
    LC_NUMERIC="POSIX"
    LC_TIME="POSIX"
    LC_COLLATE="POSIX"
    LC_MONETARY="POSIX"
    LC_MESSAGES="POSIX"
    LC_PAPER="POSIX"
    LC_NAME="POSIX"
    LC_ADDRESS="POSIX"
    LC_TELEPHONE="POSIX"
    LC_MEASUREMENT="POSIX"
    LC_IDENTIFICATION="POSIX"
    LC_ALL=
    I have tried looking online but no where has any help. Currently I don't have a ~/.pam_environment file so the info for that was useless. Both of the files /etc/default/locale and /etc/environment have the following set.

    Code:
    PATH="/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games"
    LANGUAGE="en_US:en"
    LANG="en_US.UTF-8"
    LC_NUMERIC="en_US.UTF-8"
    LC_TIME="en_US.UTF-8"
    LC_MONETARY="en_US.UTF-8"
    LC_PAPER="en_US.UTF-8"
    LC_IDENTIFICATION="en_US.UTF-8"
    LC_NAME="en_US.UTF-8"
    LC_ADDRESS="en_US.UTF-8"
    LC_TELEPHONE="en_US.UTF-8"
    LC_MEASUREMENT="en_US.UTF-8"
    Any help would be greatly appriciated.

    Thanks!

    EDIT: I also noticed that something is obviously overriting the values from the files /etc/default/locale and /etc/environment but I have no idea where that is....
    Try adding the 2 lines below to the end of your ~/.profile file, save the file, log out then log back in again and the variables will be set for your user profile,

    Code:
    export LANG=en_US.UTF-8
    export LANGUAGE=en_US.UTF-8
    To check open a terminal and issue the code
    Code:
    echo $LANG && echo $LANGUAGE
    both should return "en_US.UTF-8" with the 2 export commands in place and active. Or alternatively run the "locale" command again and check the difference. Cheers.
    Last edited by coldcritter64; March 21st, 2014 at 07:39 AM. Reason: correct typo

  3. #3
    Join Date
    Dec 2009
    Beans
    2

    Re: LANG Environment Variable Is Blank

    Thanks coldcritter64! This worked like a charm!

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •