# Localization FreeBSD



## Petr (May 24, 2012)

Hi all,

*I* have *a* problem with localization. I want to set the location of the Czech language. In /etc/login.conf *I* have this text:


```
czech|Czech Users Accounts:\                                                    
:charset=UTF-8:\                                                                
:lang=cs_CZ.UTF-8:\                                                             
:tc=default: cs_CZ.UTF-8:\                                                      
:LC_ALL=cs_CZ.UTF-8:\
```

Finally I entered the command [cmd=]# cap_mkdb /etc/login.conf[/cmd]

But if I entered the command [cmd=]locale[/cmd] I receive incorrect output.


```
LANG=
LC_CTYPE="C"
LC_COLLATE="C"
LC_TIME="C"
LC_NUMERIC="C"
LC_MONETARY="C"
LC_MESSAGES="C"
LC_ALL=
```

Where is m*y* mistake?

Thanks,

Petr


----------



## Bunyan (May 24, 2012)

Try this command:
[cmd=]pw usermod -n $username -L utf8[/cmd]


----------



## tyson (May 24, 2012)

Hi.
You need to check if user that you are logging in got 'login class' set to 'czech'.
This can be set by:`# pw usermod your_user -L czech`
Well, if you want to change locale settings for only one user (for example on your desktop pc), the best way is to set them in ~/.login_conf.

```
me:\
        :charset=utf-8:\
        :lang=cs_CZ.UTF-8:
```
ofc after updating .login_conf you run
`# cap_mkdb ~/.login_conf`


----------



## sw2wolf (Jun 21, 2012)

```
>ls -l ~/.login*
-rw-r--r--  1 sw2wolf  wheel    634  6 20 10:41 .login_conf
-rw-r--r--  1 sw2wolf  wheel  16384  6 21 11:01 .login_conf.db

>sudo grep ^sw2wolf /etc/master.passwd 
sw2wolf:$1$nT.3fDYR$QICkAncat8yttt3Ldr0Qf.:1001:1001:[color="DarkRed"]default[/color]:0:0:User &:/home/sw2wolf:/bin/csh

>cat ~/.login_conf
me:\
    :lang=zh_CN.UTF-8:\
    :charset=UTF-8:\
    :setenv=LC_ALL=zh_CN.UTF-8:\
    :setenv=LC_CTYPE=zh_CN.UTF-8:\
    :setenv=LC_COLLATE=zh_CN.UTF-8:\
    :setenv=LC_TIME=zh_CN.UTF-8:\
    :setenv=LC_NUMERIC=zh_CN.UTF-8:\
    :setenv=LC_MONETARY=zh_CN.UTF-8:\
    :setenv=LC_MESSAGES=zh_CN.UTF-8:\
    :xmodifiers="@im=fcitx":
```

However, after logging in my locale is not UTF-8 but "C".


----------



## SirDice (Jun 21, 2012)

Make sure there aren't any LC_* variables set in your login scripts. They may overrule what has been set in ~/.login_conf.


----------



## sw2wolf (Jun 26, 2012)

SirDice said:
			
		

> Make sure there aren't any LC_* variables set in your login scripts. They may overrule what has been set in ~/.login_conf.


The reason is that slim does not respect the login.conf. *T*hanks!


----------



## SirDice (Jun 26, 2012)

Ah, I didn't know that. That's good to know.


----------

