Find the answer to your Linux question:
Results 1 to 7 of 7
Is there a way to change the language the gdm login screen is in? Right now I can select language from a menu for the GNOME session, but not for ...
Enjoy an ad free experience by logging in. Not a member yet? Register.
  1. #1
    Linux Newbie
    Join Date
    Jul 2005
    Location
    Illinois, USA
    Posts
    111

    Changing the language of the gdm login screen


    Is there a way to change the language the gdm login screen is in? Right now I can select language from a menu for the GNOME session, but not for the login screen itself. I'm using the default graphical greeter theme that comes with FC4. Thanks in advance.

  2. #2
    Linux Engineer
    Join Date
    Apr 2005
    Location
    Belgium
    Posts
    1,429
    Yes there is; I don't know which distro you're running though and it could be distro-specific. Open a terminal, become root, and edit the lang.sh and lang.csh files on your system (you only have two of them). The default language in both will be en_US. Change it to the one of your liking. That will change your system language.

    On my Slackware-style system, both files are located in /etc/profile.d/. Maybe you have the same directory...
    ** Registered Linux User # 393717 and proud of it ** Check out www.zenwalk.org
    ** Zenwalk 2.8 - Xfce 4.4 beta 2- 2.6.17.6 kernel = Slack on steroids! **

  3. #3
    Linux Newbie
    Join Date
    Jul 2005
    Location
    Illinois, USA
    Posts
    111
    Will this affect a whole lot of other stuff?

    And also which part should I edit? I see some zh_CN, but the login screen is still in english.
    Code:
    # /etc/profile.d/lang.sh - set i18n stuff
    
    sourced=0
    for langfile in /etc/sysconfig/i18n $HOME/.i18n ; do
        [ -f $langfile ] && . $langfile && sourced=1
    done
    
    if [ -n "$GDM_LANG" ]; then
        sourced=1
        LANG="$GDM_LANG"
        unset LANGUAGE
        if [ "$GDM_LANG" = "zh_CN.GB18030" ]; then
          export LANGUAGE="zh_CN.GB18030:zh_CN.GB2312:zh_CN"
        fi
    fi
    
    if [ "$sourced" = 1 ]; then
        [ -n "$LANG" ] && export LANG || unset LANG
        [ -n "$LC_ADDRESS" ] && export LC_ADDRESS || unset LC_ADDRESS
        [ -n "$LC_CTYPE" ] && export LC_CTYPE || unset LC_CTYPE
        [ -n "$LC_COLLATE" ] && export LC_COLLATE || unset LC_COLLATE
        [ -n "$LC_IDENTIFICATION" ] && export LC_IDENTIFICATION || unset LC_IDENTIFICATION
        [ -n "$LC_MEASUREMENT" ] && export LC_MEASUREMENT || unset LC_MEASUREMENT
        [ -n "$LC_MESSAGES" ] && export LC_MESSAGES || unset LC_MESSAGES
        [ -n "$LC_MONETARY" ] && export LC_MONETARY || unset LC_MONETARY
        [ -n "$LC_NAME" ] && export LC_NAME || unset LC_NAME
        [ -n "$LC_NUMERIC" ] && export LC_NUMERIC || unset LC_NUMERIC
        [ -n "$LC_PAPER" ] && export LC_PAPER || unset LC_PAPER
        [ -n "$LC_TELEPHONE" ] && export LC_TELEPHONE || unset LC_TELEPHONE
        [ -n "$LC_TIME" ] && export LC_TIME || unset LC_TIME
        if [ -n "$LC_ALL" ]; then
           if [ "$LC_ALL" != "$LANG" ]; then
             export LC_ALL
           else
             unset LC_ALL
           fi
        else
           unset LC_ALL
        fi
        [ -n "$LANGUAGE" ] && export LANGUAGE || unset LANGUAGE
        [ -n "$LINGUAS" ] && export LINGUAS || unset LINGUAS
        [ -n "$_XKB_CHARSET" ] && export _XKB_CHARSET || unset _XKB_CHARSET
    
        if [ -n "$CHARSET" ]; then
            case $CHARSET in
                8859-1|8859-2|8859-5|8859-15|koi*)
                    if [ "$TERM" = "linux" -a "`/sbin/consoletype`" = "vt" ]; then
                           echo -n -e '\033(K' 2>/dev/null > /proc/$$/fd/0
                    fi
                    ;;
            esac
        elif [ -n "$SYSFONTACM" ]; then
            case $SYSFONTACM in
                iso01*|iso02*|iso05*|iso15*|koi*|latin2-ucw*)
                    if [ "$TERM" = "linux" -a "`/sbin/consoletype`" = "vt" ]; then
                            echo -n -e '\033(K' 2>/dev/null > /proc/$$/fd/0
                    fi
                    ;;
            esac
        fi
        if [ -n "$LANG" ]; then
          case $LANG in
            *.utf8*|*.UTF-8*)
            if [ "$TERM" = "linux" -a "`/sbin/consoletype`" = "vt" ]; then
                    [ -x /bin/unicode_start ] && /sbin/consoletype fg && unicode_start $SYSFONT $SYSFONTACM
            fi
            ;;
          esac
        fi
    
        unset SYSFONTACM SYSFONT
    fi
    unset sourced
    unset langfile
    And here's the /etc/sysconfig/i18n file:
    Code:
    LANG="en_US.UTF-8"
    SYSFONT="latarcyrheb-sun16"
    SUPPORTED="en_US.UTF-8:en_US:en"

  4. #4
    Linux Engineer
    Join Date
    Apr 2005
    Location
    Belgium
    Posts
    1,429
    What's your default language now? As for my lang.sh file, it's far more simple...

    Here's mine (I do NOT recommend you replace it, I'll have a look at yours, this is just for comparison):
    Code:
    #!/bin/sh
    # Set the system locale.  (no, we don't have a menu for this ;-)
    # For a list of locales which are supported by this machine, type:
    #   locale -a
    
    # en_US is the Slackware default locale:
    export LANG=nl_BE
    
    # 'C' is the old Slackware (and UNIX) default, which is 127-bit
    # ASCII with a charmap setting of ANSI_X3.4-1968.  These days,
    # it's better to use en_US or another modern $LANG setting to
    # support extended character sets.
    #export LANG=C
    
    # There is also support for UTF-8 locales, but be aware that
    # some programs are not yet able to handle UTF-8 and will fail to
    # run properly.  In those cases, you can set LANG=C before
    # starting them.  Still, I'd avoid UTF unless you actually need it.
    #export LANG=en_US.UTF-8
    
    # Another option for en_US:
    #export LANG=en_US.ISO8859-1
    
    # One side effect of the newer locales is that the sort order
    # is no longer according to ASCII values, so the sort order will
    # change in many places.  Since this isn't usually expected and
    # can break scripts, we'll stick with traditional ASCII sorting.
    # If you'd prefer the sort algorithm that goes with your $LANG
    # setting, comment this out.
    export LC_COLLATE=C
    
    # End of /etc/profile.d/lang.sh
    Edit: I suggest you check the first two files mentioned in the file - the /etc/sysconfig/i18n and $HOME/.i18n (mind the '.' - it means it's a hidden file). Maybe you can find some clarifications in there. Because this looks like a rather complicated script to me.
    ** Registered Linux User # 393717 and proud of it ** Check out www.zenwalk.org
    ** Zenwalk 2.8 - Xfce 4.4 beta 2- 2.6.17.6 kernel = Slack on steroids! **

  5. #5
    Linux Newbie
    Join Date
    Jul 2005
    Location
    Illinois, USA
    Posts
    111
    Maybe I should just edit the /etc/sysconfig/i18n file, though I don't know what the "SUPPORTED=" line means.

  6. #6
    Linux Engineer
    Join Date
    Apr 2005
    Location
    Belgium
    Posts
    1,429
    Can you post the contents of that file also? I think supported= means the locales available on your system. Not sure though.

    You should try this as root:
    Code:
    dpkg-reconfigure locales
    You should be able to select your desired language there. Then restart, and it should be ok.
    ** Registered Linux User # 393717 and proud of it ** Check out www.zenwalk.org
    ** Zenwalk 2.8 - Xfce 4.4 beta 2- 2.6.17.6 kernel = Slack on steroids! **

  7. #7
    Linux Newbie
    Join Date
    Jul 2005
    Location
    Illinois, USA
    Posts
    111
    I'm using Fedora Core 4 so I don't think dpkg is an available option. I edited the i18n file into an earlier post, sorry I forgot to tell you . Here it is again:
    Code:
    LANG="en_US.UTF-8"
    SYSFONT="latarcyrheb-sun16"
    SUPPORTED="en_US.UTF-8:en_US:en"
    I ran system-config-language(distro specific I think) and it popped up a list of languages to choose from and the only option available was "English (USA)

    `locale -a` gives me a ton of different languages, is it okay if I changed "LANG=" to one of those?

Posting Permissions

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