# FreeBSD Localization



## vadimkolchev (Sep 24, 2012)

Hi all,

This is my first post here as a FreeBSD user. I'm new to FreeBSD and did a fresh install on my machine. I'm Russian and wanted to localize it fully, I properly followed the Handbook and edited /etc/login.conf and ~./login_conf as it advised me to do. After that I installed Xfce DE and opened Xfce terminal to find out that as a regular user I can't type russian characters in it. If I go root and try to type in terminal - everything is ok. Does anyone have any idea on why it is so? I will appreciate any advice.

Thank you in advance.


----------



## Erratus (Sep 24, 2012)

Check your locale settings in xorg


----------



## vadimkolchev (Sep 24, 2012)

What locale settings in xorg do you mean? As I stated earlier under root everything works ok, the problems are under regular user.


----------



## vadimkolchev (Oct 1, 2012)

The thread is still open and the issue still bothers me. However, there is an update: if I use bash for regular user, instead of sh, I can type russian letters in it. Any ideas?


----------



## atmosx (Oct 1, 2012)

Yes, bash reads the conf rc files but sh doesnt... Nothing new actually, use bash is more sane anyway.


----------



## vadimkolchev (Oct 2, 2012)

I don't object to using bash, but there is one thing that drives me crazy - I can't find out why I can input russian characters under root in the same terminal in sh, and cannot under regular user.


----------



## AlexJ (Oct 2, 2012)

IMHO it is a smart idea - not to use bash(especially for regular users). It is powerful but very dangerous tools.

What kind of shell did you choose for a regular user that cant type Russian characters?
root by default using *csh* and locale settings is in /root/.cshrc
If your regular user using default shell for them which is /bin/sh then only thing that you need to correct it is 
/home/YourUser/.login_conf
place there

```
me:\
:charset=UTF-8:\
:lang=en_US.UTF-8:
```
then relogin and try again.

BTW, I strongly advise you to use UTF-8 instead of KOI-8 because all modern programs (windows share/samba, ftp servers ,http's html and php and so on) use UTF-8, so to be able to see filenames and its content it would much more convenient to use UTF-8.
You would be able to see any languages, not only Russian correctly without switching between different charsets.

Try to login over SSH to user account. Set in SSH client xterm-256color, UTF-8 and most important - the correct font.(Not all fonts contain all languages.) Try DejVU Sans Mono, it support most languages. If you get correct symbols under SSH try digging Xorg's fonts. Use only True type fonts that is by its nature is unicode. 

I think it is either mistyping somewhere in configuration files or most likely - font that doesn't support particular charset.


----------



## vadimkolchev (Oct 2, 2012)

AlexJ said:
			
		

> me:\
> :charset=UTF-8:\
> :lang=en_US.UTF-8:
> [/CODE]
> ...


----------



## AlexJ (Oct 2, 2012)

vadimkolchev said:
			
		

> I did exactly the same, except for setting ru_RU instead of en_US and use sh and not bash. However, as a regular user, I can't type in russian characters, and as root I can. That's what amazes me.



root's settings lives in /root/.cshrc which have completely different syntax to compare with bash/sh

there should something like


```
setenv LANG en_US.UTF-8
setenv MM_CHARSET UTF-8
```
take a look on these settings there


----------



## vadimkolchev (Oct 2, 2012)

There are no localization settings for root there. None at all. I remember modifying /etc/login.conf  though.


----------



## AlexJ (Oct 3, 2012)

Did you run cap_mkdb(1) after editing ?


----------



## vadimkolchev (Oct 3, 2012)

Yes, but as root. Should I run it as user as well? Maybe this is my mistake. I'll try it today when I come back home after work and get to my FreeBSD machine. I'll update you with the results, but it seems that this is what I have forgotten.


----------



## vadimkolchev (Oct 3, 2012)

Unfortunately this didn't work (sorry about double posting)


----------



## AlexJ (Oct 6, 2012)

No cap_mkdb should be run under the root.

Well, I afraid we need to start again.
Did you try to connect to your box over SSH and try the same things under a terminal?
We need to spot wrong place first either it's X fault or core settings.

(Sorry for a late reply, was busy)


----------



## vadimkolchev (Oct 7, 2012)

No, I didn't try. What I did initially was modifying /etc/login.conf for "global" localization, and then run cap_mkdb as root. After that when I su in terminal I can enter russian letters. This however does not work under regular user. To achieve results I created ~/.login_conf and edited it to match my needs. It didn't work. I ran cap_mkdb as regular user, and still it doesn't work. That is exactly what I did up to this point and I'm not aware of what I done wrong unfortunately.


----------

