Live Chat & Podcast at 1:00PM Eastern on Sunday!
There's no such thing as a stupid question, but they're the easiest to answer.
JoinTour
Login
Search
Linux and Unix
Tag Cloud
access acer asus bios bsod computer crash desktop driver drivers error ethernet excel freeze gaming hard drive hardware hdmi internet laptop malware memory modem monitor motherboard network printer problem ram registry router security slow software sound toshiba trojan ubuntu 11.10 uninstall usb video virus vista wifi windows windows 7 windows 7 32 bit windows 7 64 bit windows xp wireless
Search
Search for:
Tech Support Guy Forums > Operating Systems > Linux and Unix >
How to change languageto swedish/latin on CentOS?

Reply  
Thread Tools
oskare100's Avatar
Junior Member with 11 posts.
 
Join Date: Sep 2007
16-Oct-2007, 05:00 AM #1
How to change languageto swedish/latin on CentOS?
Hello,
I've worked a lot to get my server working but now I discovered that I choose wrong language support when I installed CentOS 5. It works in HTTPD to set the default charset to UFT-8 but when I try to use PHP functions as ucwords() and when I try to phrase XML it doesn't work as it should so I need to set the locale? or language? to the default one for Swedish so I can use the Swedish ĺ,ä and ö letters.

I've tried with:
localedef -i sv_SE -f ISO-8859-1 sv_SE
export LC_ALL=sv_SE
export LANG=sv
and similar but it doesn't work.

So please, I'm greatful for anything that could help me solve this.

Thanks,
Oskar
lotuseclat79's Avatar
Distinguished Member with 21,345 posts.
 
Join Date: Sep 2003
Location: -71.45091, 42.27841
16-Oct-2007, 06:32 AM #2
Just a thought, in your post, the LANG=sv did not match sv_SE.

Also, issue the $ locale command with no parameters to see the full list of output.

In my output LANG="en_US.UTF-8" and I'm wondering whether yours should be something like: LANG="sv_SE.UTF-8"

-- Tom
__________________
The independence created by philosophical insight is - in my opinion - the mark of distinction
between a mere artisan or specialist and a real seeker after truth. - Einstein 1944
Imagination is more important than knowledge. - Einstein
oskare100's Avatar
Junior Member with 11 posts.
 
Join Date: Sep 2007
16-Oct-2007, 08:13 AM #3
Hello,
My output is:
[root@localhost ~]# locale
LANG=en_US.UTF-8
LC_CTYPE="en_US.UTF-8"
LC_NUMERIC="en_US.UTF-8"
LC_TIME="en_US.UTF-8"
LC_COLLATE="en_US.UTF-8"
LC_MONETARY="en_US.UTF-8"
LC_MESSAGES="en_US.UTF-8"
LC_PAPER="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"
LC_IDENTIFICATION="en_US.UTF-8"
LC_ALL=

And I believe that that is the problem, thanks.

/Oskar
oskare100's Avatar
Junior Member with 11 posts.
 
Join Date: Sep 2007
16-Oct-2007, 08:18 AM #4
Hello again,
Here is what happends:
[root@localhost ~]# localedef -i sv_SE -f ISO-8859-1 sv_SE.UTF-8
[root@localhost ~]# export LC_ALL=sv_SE.UTF-8
[root@localhost ~]# export LANG=sv_SE.UTF-8
[root@localhost ~]# locale
LANG=sv_SE.UTF-8
LC_CTYPE="sv_SE.UTF-8"
LC_NUMERIC="sv_SE.UTF-8"
LC_TIME="sv_SE.UTF-8"
LC_COLLATE="sv_SE.UTF-8"
LC_MONETARY="sv_SE.UTF-8"
LC_MESSAGES="sv_SE.UTF-8"
LC_PAPER="sv_SE.UTF-8"
LC_NAME="sv_SE.UTF-8"
LC_ADDRESS="sv_SE.UTF-8"
LC_TELEPHONE="sv_SE.UTF-8"
LC_MEASUREMENT="sv_SE.UTF-8"
LC_IDENTIFICATION="sv_SE.UTF-8"
LC_ALL=sv_SE.UTF-8
[root@localhost ~]# shutdown -r now

Broadcast message from root (pts/0) (Tue Oct 16 13:15:29 2007):

The system is going down for reboot NOW!
login as: root
root@xxx.xxx.xxx.xx's password:
Last login: Tue Oct 16 13:11:38 2007 from xxx.xxx.xxx.xx
[root@localhost ~]# locale
LANG=en_US.UTF-8
LC_CTYPE="en_US.UTF-8"
LC_NUMERIC="en_US.UTF-8"
LC_TIME="en_US.UTF-8"
LC_COLLATE="en_US.UTF-8"
LC_MONETARY="en_US.UTF-8"
LC_MESSAGES="en_US.UTF-8"
LC_PAPER="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"
LC_IDENTIFICATION="en_US.UTF-8"
LC_ALL=
[root@localhost ~]#

In other words, after restart it gets back to what it was before...

/Oskar
lotuseclat79's Avatar
Distinguished Member with 21,345 posts.
 
Join Date: Sep 2003
Location: -71.45091, 42.27841
16-Oct-2007, 11:17 AM #5
Hi Oskar,

Even though you are running CentOS, check out the section on "How to add locales to Ubuntu the command line way" in the Ubuntu (7.04) Fiesty Fawn Starter Guide.

You can probably throw the same commands (slightly revised for SE) to get what you need as there is not too much difference from Linux to Linux variants.

-- Tom
__________________
The independence created by philosophical insight is - in my opinion - the mark of distinction
between a mere artisan or specialist and a real seeker after truth. - Einstein 1944
Imagination is more important than knowledge. - Einstein
oskare100's Avatar
Junior Member with 11 posts.
 
Join Date: Sep 2007
16-Oct-2007, 01:03 PM #6
Hello,
OK, the problem is that I need to change the default for the whole system and not just root...

/Oskar
lotuseclat79's Avatar
Distinguished Member with 21,345 posts.
 
Join Date: Sep 2003
Location: -71.45091, 42.27841
16-Oct-2007, 03:20 PM #7
Hi Oskar,

I am guessing here that there is a permission problem if the changes only applied to root.

Check the permissions on the files installed. One way to do this if the dpkg mechanism was used is to find the locales.list file in /var/lib/dpkg/info directory.

First, I would copy that file into your Desktop using the root account. Then edit out all of the directories - it should be easy to identify these by the pathnames.
Once you have only a list of files and no directories, issue the following command and output everything to a file:

$ ls -ldt `cat locales.list` > ls-ldt.txt

Then peruse the list for files that only have root access and issue the command:
$ sudo chmod +r filename
for each of them (a script should make short work of this).

-- Tom
__________________
The independence created by philosophical insight is - in my opinion - the mark of distinction
between a mere artisan or specialist and a real seeker after truth. - Einstein 1944
Imagination is more important than knowledge. - Einstein
lotuseclat79's Avatar
Distinguished Member with 21,345 posts.
 
Join Date: Sep 2003
Location: -71.45091, 42.27841
17-Oct-2007, 06:44 AM #8
One further thought, if the task of editing out the directorys from the locales.list is too daunting, then just leave them in and the command:
$ ls -ldt `cat locales.list` > ls-ldt.txt
will work without listing the directory contents and just give more output, but include the directory permissions as well.

-- Tom
__________________
The independence created by philosophical insight is - in my opinion - the mark of distinction
between a mere artisan or specialist and a real seeker after truth. - Einstein 1944
Imagination is more important than knowledge. - Einstein
Reply

THIS THREAD HAS EXPIRED.
Are you having the same problem? We have volunteers ready to answer your question, but first you'll have to join for free. Need help getting started? Check out our Welcome Guide.

Search Tech Support Guy

Find the solution to your
computer problem!




Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
WELCOME TO TECH SUPPORT GUY! Are you looking for the solution to your computer problem? Join our site today to ask your question -- for free! Our site is run completely by volunteers who want to help you solve your computer problems. See our Welcome Guide to get started.
Thread Tools



Facebook Facebook Twitter Twitter TechGuy.tv TechGuy.tv Mobile TSG Mobile
You Are Using:
Server ID
Advertisements do not imply our endorsement of that product or service.
All times are GMT -4. The time now is 11:33 PM.
Copyright © 1996 - 2011 TechGuy, Inc. All rights reserved.

Powered by Cermak Technologies, Inc.