Take the 2-minute tour ×
Unix & Linux Stack Exchange is a question and answer site for users of Linux, FreeBSD and other Un*x-like operating systems.. It's 100% free, no registration required.

OS: Mint13

I have set my preferred language to zh-cn via the language support option.

This has changed the language of a small handful of things (synaptic, dates and times).

However everything else is still in English.

When i set my LANG and MDM_LANG variables to zh-CN.UTF-8 manually in the terminal, and open an application - the correct language is displayed.

However even having placed export LANG="zh-CN.UTF-8" and export LANG="zh-CN.UTF-8" in my .bashrc everything is still in English. (even if run from the terminal which reports the correct LANG etc).

EDIT:

~ $ locale
LANG=en_AU.UTF-8
LANGUAGE=
LC_CTYPE="en_AU.UTF-8"
LC_NUMERIC=zh_CN.UTF-8
LC_TIME=zh_CN.UTF-8
LC_COLLATE="en_AU.UTF-8"
LC_MONETARY=zh_CN.UTF-8
LC_MESSAGES="en_AU.UTF-8"
LC_PAPER=zh_CN.UTF-8
LC_NAME=zh_CN.UTF-8
LC_ADDRESS=zh_CN.UTF-8
LC_TELEPHONE=zh_CN.UTF-8
LC_MEASUREMENT=zh_CN.UTF-8
LC_IDENTIFICATION=zh_CN.UTF-8
LC_ALL=

~ $ cat /etc/environment
LC_NUMERIC="zh_CN.UTF-8"
LC_TIME="zh_CN.UTF-8"
LC_MONETARY="zh_CN.UTF-8"
LC_PAPER="zh_CN.UTF-8"
LC_IDENTIFICATION="zh_CN.UTF-8"
LC_NAME="zh_CN.UTF-8"
LC_ADDRESS="zh_CN.UTF-8"
LC_TELEPHONE="zh_CN.UTF-8"
LC_MEASUREMENT="zh_CN.UTF-8"
LANGUAGE="zh_CN:en_AU:en"
LANG="zh_CN.UTF-8"
share|improve this question
    
Definitely try .utf8 (lower case no dash). I'm on my phone right now so I can't test, but I remember having to use en_US.utf8 just the other day. –  livingstaccato Feb 2 '13 at 20:25
    
I think you can use .UTF-8 and .utf8 interchangeably, at least here both work, and locale -a only shows .utf8. –  njsg Feb 3 '13 at 9:32
add comment

3 Answers 3

I think you're slightly off on the name of your locale. Try export LANG=zh_CN or export LANG=zh_CN.utf8.

To find out list of valid locales look in /usr/share/locales.

share|improve this answer
    
Thanks, fixed now (via a full restart). btw I think that all the zh locales have caps for UTF - I don't know why. –  trideceth12 Feb 2 '13 at 20:31
add comment

Try reconfiguring you locales running

sudo dpkg-reconfigure locales

Exporting LANG on .bashrc will only affect applications started from a terminal.

Alternatively you can edit as root the file /etc/default/locale but make sure the locales you need are present, by running locale -a.

share|improve this answer
    
/etc/default/locale has zh-CN as the first language for all options, as does /etc/environment/ and yet this doesn't filter through to locales. See my edit –  trideceth12 Feb 2 '13 at 20:19
add comment

Changing locales requires a full restart.

share|improve this answer
    
Thanks, worked :| –  trideceth12 Feb 2 '13 at 20:29
1  
Locales or any other kind of change involving environment variables or groups, if you don't start with those set, changing files won't magically make everything inherit the new values. Also, special care should be taken if you use something like a graphical login manager, as I wonder if that won't simply bypass anything like shell initialization files and just start the X process straight away. –  njsg Feb 2 '13 at 20:41
    
@njsg Yeah I thought that a logout / login would be enough - especially as that did actually change the date and time language –  trideceth12 Feb 3 '13 at 1:55
    
That depends on the distro. On Gentoo, you need to regenerate the /etc/profile (more correctly, files sourced by it), and after you do that, any login shell will get the new locale settings. And you can always source /etc/profile on a running shell. Now for, say, getting the new locale on the X process, you need to start X from an environment with the new locales (here I'd have to terminate X, source /etc/profile and run startx again). You can use locale to inspect what are the locale settings in a specific shell you are using. –  njsg Feb 3 '13 at 9:26
    
(In fact, if you're curious, play with it -- you can, given that you have these locales installed (locale -a to get a list of installed locales), run commands with different locales, for example, in GNU bash LC_TIME=pt_PT.utf8 date gives me the portuguese date format. You can also start programs with different UI languages, if they support these and don't choose to ignore the locale settings (I think libreoffice does this for some measurement and currency settings...): LANG=fi_FI.utf8 libreoffice gives me LibreOffice with a Finnish UI.) –  njsg Feb 3 '13 at 9:30
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.