Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 16 Jun 2014 02:35:20 +0200
From:      Polytropon <freebsd@edvax.de>
To:        ddddd dddd <sin_jen@hotmail.com>
Cc:        "freebsd-questions@freebsd.org" <freebsd-questions@freebsd.org>
Subject:   Re: Language in FreeBSD
Message-ID:  <20140616023520.203973fc.freebsd@edvax.de>
In-Reply-To: <SNT147-W915FFBB6335269217953EA85160@phx.gbl>
References:  <SNT147-W915FFBB6335269217953EA85160@phx.gbl>

next in thread | previous in thread | raw e-mail | index | archive | help
On Mon, 16 Jun 2014 02:09:26 +0200, ddddd dddd wrote:
> Hello. I am trying to change FreeBSD to Norwegian. Setting :lang
> in ~/.login_conf didn't work.

How exactly did you do that?

Programs usually support the LC_* variables (LC_MESSAGES for
example, LC_ALL to override) as well as LANG. You can try to
set those in your ~/.login if the C shell is your login shell,
or in ~/.login_conf, for example like this:

	me:\
		:charset=3Diso-8859-1:\
		:lang=3Dde_DE.ISO8859-1:

Note that you probably will use UTF-8 instead of ISO-8859-1
if you want to be "future-proof". :-)



> Also, I don't know how much of FreeBSD is actually translated,
> if any.

The system messages and manpages are usually provided in English,
but the documentation (Handbook and FAQ) offer many language
variants. There basically is no real need for localized system
messages because those who "use" them will have no problem with
the fact that they are in English, and it also makes them more
"portable", especially within communication such as mailing lists
or web forums. Still especially many X programs obey language
settings and in case their authors have implemented localization
support, text elements will be shown in the language requested.



> So if I can't get that to work, getting Norwegian letters
> working will be enough.

For the console, you need to set those in /etc/rc.conf (but in
your case for Norwegian - I'm just providing the text from my
working German setup):

	keymap=3D"german.iso"
	keyrate=3D"fast"
	font8x14=3D"iso-8x14"
	font8x16=3D"iso-8x16"
	font8x8=3D"iso-8x8"

For X, you need to either have /etc/X11/xorg.conf with the
required settings, like this:

	Section "InputDevice"
		Identifier	"Keyboard0"
		Driver		"kbd"
		Option		"XkbModel"	"pc105"
		Option		"XkbLayout"	"de"
		Option		"XkbOptions"	"terminate:ctrl_alt_bksp"
	EndSection

Or you have to fiddle with XML files scattered across the /usr/local
subtree in case you're using HAL, as explained here (Handbook 6.2.4):

https://www.freebsd.org/doc/handbook/x-config.html

It could look like this:

	<?xml version=3D"1.0" encoding=3D"ISO-8859-1"?>
	<deviceinfo version=3D"0.2">
	  <device>
	    <match key=3D"info.capabilities" contains=3D"input.keyboard">
	      <merge key=3D"input.x11_driver" type=3D"string">kbd</merge>
	      <merge key=3D"input.xkb.layout" type=3D"string">de</merge>
	      <merge key=3D"input.xkb.variant" type=3D"string">nodeadkeys</merge>
	    </match>
	  </device>
	</deviceinfo>

Here's some more information:

https://www.freebsd.org/doc/handbook/using-localization.html

https://www.freebsd.org/doc/handbook/lang-setup.html



> When I installed, I selected Norwegian ISO keyboard map, Norwegian
> with code page 850 weren't available.

Try not to use a CP setting, check if you can use UTF-8 or the
ISO-8859 version corresponding to your location. If it's western
europe, try ISO-8859-1 or ISO-8859-15.



> However the extra Norwegian letters aren't working in csh, sh or
> vi, they show up as "\330" or something similar, at least in
> csh (I could give all details of how each program handle the
> keys if that will help).

You probably did not load a _font_ which supports displaying those
characters.



> -I can't use combining accents, when I write "=B4" , it is shown
> immediately and I can't combine it with letters.

I think this is typical for the console, but should work in X
("dead keys").



> Neither of these two problems are there when running ee in xterm,
> but xterm still has the identical problem with csh, sh and vi not
> accepting the extra letters. Also, the Euro sign is not working
> in ttyv or xterm. I have none problem at all in Firefox, both the
> letters and Euro sign is working.

Maybe you can add some C shell specific environmental settings.
Here are some examples:

	# german input, english messages
	setenv	LC_ALL		en_US.ISO8859-1
	setenv	LC_MESSAGES	en_US.ISO8859-1
	setenv	LC_COLLATE	de_DE.ISO8859-1
	setenv	LC_CTYPE	de_DE.ISO8859-1
	setenv	LC_MONETARY	de_DE.ISO8859-1
	setenv	LC_NUMERIC	de_DE.ISO8859-1
	setenv	LC_TIME		de_DE.ISO8859-1
	unsetenv LANG

	# german with Euro sign
	setenv	LC_ALL		de_DE.ISO8859-15
	setenv	LC_COLLATE	de_DE.ISO8859-15
	setenv	LC_CTYPE	de_DE.ISO8859-15
	setenv	LC_MESSAGES	de_DE.ISO8859-15
	setenv	LC_MONETARY	de_DE.ISO8859-15
	setenv	LC_NUMERIC	de_DE.ISO8859-15
	setenv	LC_TIME		de_DE.ISO8859-15

	# german with UTF-8 ("more international")
	setenv	LC_ALL		en_US.UTF-8
	setenv	LC_MESSAGES	en_US.UTF-8
	setenv	LC_COLLATE	de_DE.UTF-8
	setenv	LC_CTYPE	de_DE.UTF-8
	setenv	LC_MONETARY	de_DE.UTF-8
	setenv	LC_NUMERIC	de_DE.UTF-8
	setenv	LC_TIME		de_DE.UTF-8
	setenv	LANG		de_DE.UTF-8

Maybe this this can help with testing and inspiration. :-)




--=20
Polytropon
Magdeburg, Germany
Happy FreeBSD user since 4.0
Andra moi ennepe, Mousa, ...



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20140616023520.203973fc.freebsd>