While testing XFCE, I noticed, that the date and time format in some desktop applications, such as Thunderbird, no longer was ISO 8601. It had become more like US or metric. I want English with Danish format and UTF-8 encoding.
Configuring language in FreeBSD login class.
According to the FreeBSD handbook, the recommended method for configuring language, format and encoding is in the login class definition. This is, however, not correct. I have not been able to test this to work. I recommend, that the language format in the login class is set to the following POSIX standard and the rest is configured in FreeBSD enviroment variables.
# nano /etc/login.conf
:charset=UTF-8:\
:lang=C.UTF-8:\
:setenv=PATH_LOCALE=/usr/local/share/locale:
# cap_mkdb /etc/login.conf
Configuring language in FreeBSD environment variables.
Configure environment variables. In this example, I will be using the Bourne shells.
# nano /etc/profile
LANG=en_DK.UTF-8
I have tested this to work for system shell as well as XFCE desktop environment and Thunderbird.
Issue: Configuring language in login class not working.
According to the FreeBSD handbook, the recommended method for configuring language, format and encoding is in the login class definition. This requires, that the correct language definition is available. This is known as a locale and is formulated in the following format.
en_DK.UTF-8
The current list of available locales can be listed.
# locale -a | grep en_DK.UTF-8
In this example, mine was not available, but was available as a package to be installed or a port to be built.
# pkg install locale-en_DK
Message from locale-en_DK-0.1.1:
In order to set the en_DK.UTF-8 locale for the login shell of an single
user add the following configuration to ~/.login_conf:
me:\
:charset=UTF-8:\
:lang=en_DK.UTF-8:\
:setenv=PATH_LOCALE=/usr/local/share/locale:
More information about the process of configuring login class methods in
available in the handbook.
More information about the PATH_LOCALE environment variable is available in the
locale(1) manual page.
The default login class can now be configured. However, this did not work. The special Danish characters did not work.