Go Back   Technology Forums > Computer Forums > Linux Forum

Forums discussing various aspects of running a LAMP based platform.


How to change languageto swedish/latin on CentOS?


Reply
 
LinkBack Thread Tools Search this Thread
  #1 (permalink)  
Old 10-16-2007, 01:58 AM
Junior Member
 
Join Date: Oct 2007
Posts: 4
oskare100 is on a distinguished road
Default 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
Reply With Quote
  #2 (permalink)  
Old 10-16-2007, 05:21 AM
Junior Member
 
Join Date: Oct 2007
Posts: 4
oskare100 is on a distinguished road
Default

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
Reply With Quote
  #3 (permalink)  
Old 10-17-2007, 12:25 AM
Administrator
 
Join Date: Dec 2006
Posts: 304
shri has disabled reputation
Default

cd /etc/sysconfig

backup the file i18n

LANG="sv_SE..UTF-8"
SYSFONT="latarcyrheb-sun16"
SUPPORTED="sv_SE.UTF-8:en_US:en"



Reboot and see if that changes things for you.

For PHP look at the mbstrings settings.
Reply With Quote
  #4 (permalink)  
Old 10-17-2007, 02:15 AM
Junior Member
 
Join Date: Oct 2007
Posts: 4
oskare100 is on a distinguished road
Default

Hello,
It didn't change anything, what do you mean with mbstring? Where can I find the settings for mbstring?

Thanks,
/Oskar
Reply With Quote
  #5 (permalink)  
Old 10-17-2007, 08:23 AM
Administrator
 
Join Date: Dec 2006
Posts: 304
shri has disabled reputation
Default

http://hk.php.net/mbstring

Does not apply if you're not using multibyte though.

Also, you want to ensure that the default charset is setup correctly in PHP.INI

http://hk.php.net/ini.core

Look for default_charset and make sure its correctly set.

Finally, try the setlocale call in PHP to see if it works.

http://hk.php.net/manual/en/function.setlocale.php
Reply With Quote
  #6 (permalink)  
Old 10-17-2007, 08:31 AM
Administrator
 
Join Date: Dec 2006
Posts: 304
shri has disabled reputation
Default

also, at the shell prompt, "locale -e" will show what location support is intalled.
Reply With Quote
Reply





Thread Tools Search this Thread
Search this Thread:

Advanced Search

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

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On



Advanced Search

All times are GMT -6. The time now is 06:15 PM.

Powered by vBulletin® Version 3.6.8
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO 3.1.0 ©2007, Crawlability, Inc.