Solved Unable to set locale

Followed the guid: https://www.freebsd.org/doc/en_US.ISO8859-1/books/handbook/using-localization.html
Using "Login Classes Method"

Edit /etc/login.conf
#
# English Users Accounts. Setup proper environment variables.
#
english|English Users Accounts:\
:charset=UTF-8:\
:lang=en_US.UTF-8:\
:tc=default:

cap_mkdb /etc/login.conf

vipw add "english" for user

But locale doesn't change
$ locale
LANG=
LC_CTYPE="C"
LC_COLLATE="C"
LC_TIME="C"
LC_NUMERIC="C"
LC_MONETARY="C"
LC_MESSAGES="C"
LC_ALL=
 
Check your .cshrc or .profile or whatever similar shell configuration file you use. In mine, I override everything locale-related.
 
Check your .cshrc or .profile or whatever similar shell configuration file you use. In mine, I override everything locale-related.
checked

/etc/*login*
/etc/*csh*
/etc/*profile*
~/*login*
~/*csh*
~/*profile*

no overriding found
 
Sorry, in that case I don't know. I've always left login.conf at the default setting, and fixed it to my liking in my shell's login scripts. My only suggestion is to check the syntax of login.conf, read the man page, find some working examples on the web.
 
In /etc/login.conf you only define classes. Those must be referenced by user config. Think if everything in it would just apply to any user including root. Not good.
On a home system, per user settings are more desirable IMO. You avoid making changes to a system file and apply your locale per shell (e.g. ~/.login or ~/.tcshrc for tcsh) or shell independent through ~/.login_conf (which is the user equivalent to /etc/login.conf).
I‘d read environ(7), login.conf(5) and the „Startup and Shutdown“ section of your prefered shell, for example tcsh(1) to understand how things fit together.
 
Back
Top