LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software
User Name
Password
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.

Notices


Reply
  Search this Thread
Old 10-16-2007, 03:00 AM   #1
Oskare100
LQ Newbie
 
Registered: Jun 2005
Posts: 15

Rep: Reputation: 0
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
 
Old 10-16-2007, 06:21 AM   #2
Oskare100
LQ Newbie
 
Registered: Jun 2005
Posts: 15

Original Poster
Rep: Reputation: 0
Hello again,
Here is what happens when I try to change in the way I mentioned in my first post:
[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 and before restart it doesn't have any affect on the system...

/Oskar

Last edited by Oskare100; 10-16-2007 at 06:25 AM.
 
Old 10-16-2007, 07:10 AM   #3
bathory
LQ Guru
 
Registered: Jun 2004
Location: Piraeus
Distribution: Slackware
Posts: 13,163
Blog Entries: 1

Rep: Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032
I think setting LANG is enough for what you want to do. Now to save LANG after reboots you need to put the "export LANG=sv_SE.UTF-8" into ~/.profile or ~/.bash_profile or ~/.bashrc, whatever your distro uses. Also there is no need to reboot. You can just logout and login again.
 
Old 10-16-2007, 10:03 AM   #4
Oskare100
LQ Newbie
 
Registered: Jun 2005
Posts: 15

Original Poster
Rep: Reputation: 0
Hello,
OK, The problem is that apache, mysqld and so on runs on different users and as I understood it that only changes the startup for the root user? I have tried what you suggested and it didn't work...

/Oskar
 
Old 10-17-2007, 01:50 AM   #5
bathory
LQ Guru
 
Registered: Jun 2004
Location: Piraeus
Distribution: Slackware
Posts: 13,163
Blog Entries: 1

Rep: Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032
If you want to set LANG globally, add the "export ..." command in /etc/profile, so it will be used for all users.

BR
 
Old 10-17-2007, 03:09 AM   #6
Oskare100
LQ Newbie
 
Registered: Jun 2005
Posts: 15

Original Poster
Rep: Reputation: 0
Hello,
I added LANG=sv_SE.ISO8859-1 to ~/.bash_profile first and then also ~/.bashrc but it didn't work as I hoped it would. However, sv_SE.ISO8859-1 is showing up if I write in locale but the XML functions and the PHP function ucwords() still can't display swedish words correctly. What can I do more to solve this?

Thanks in advance,
/Oskar
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Hi! from Latin America gas(tuc) LinuxQuestions.org Member Intro 2 05-15-2007 08:09 PM
FOSS translation tools? English to Spanish, Spanish to Latin, Latin to Icelandic, etc brynjarh Linux - Software 0 06-19-2006 12:34 AM
Non-latin languages on Linspire? agari Linspire/Freespire 1 05-30-2005 01:02 AM
Keyboard mapping to be-latin stuf *BSD 2 01-29-2005 05:53 AM
xchat2 and latin-2 eviltux Linux - Software 1 05-19-2004 02:45 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Software

All times are GMT -5. The time now is 10:33 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration