FreeBSD Configure Chinese Environment

In the past, I thought I should set locale through /etc/profile or /etc/csh.cshrc. However, recently I found it is not necessary and it is not a correct way.

According to FreeBSD’s handbook, we should modify /etc/login.conf. For examples, if I want to set Simplified Chinese environment, then I should append:

1
2
3
4
chinese|Simplified Chinese Users Account:\
:charset=UTF-8:\
:lang=zh_CN.UTF-8:\
:tc=default:

Then I should rebuild the account database:

1
cap_mkdb /etc/login.conf

At last, I only need to add my user into the account:

1
pw user mod YOUR_USER -L chinese

That’s all!