Scheduled Maintenance: We are aware of an issue with Google, AOL, and Yahoo services as email providers which are blocking new registrations. We are trying to fix the issue and we have several internal and external support tickets in process to resolve the issue. Please see: viewtopic.php?t=158230

 

 

 

Howto arbitrary localisation/language combination

Ask for help with issues regarding the Installations of the Debian O/S.
Post Reply
Message
Author
User avatar
Onsemeliot
Posts: 333
Joined: 2010-12-15 14:43
Has thanked: 20 times
Been thanked: 5 times

Howto arbitrary localisation/language combination

#1 Post by Onsemeliot »

Sorry for posting rather similar treads after another but I think this could be helpful to more people than just me. I have installed Stretch now four or five times already.

I have been working with Debian using German (AT) localization (Euro signs, German time formats, German number formats, time settings, etc.) but with English (GB) language for years now. In my experience this way I can follow English guides without taking care of odd translations and I can actually use the system properly in Austria. (It is easy to install the German spelling correction in Libre Office even if I use an English system with the proper Austrian localization.)

In the past I never had problems with setting up Debian in this customized way. With Stretch I found out that only the normal installation image and netinstall do support a proper expert installation where I can actually choose the language independently from the localization or if I need a print server or a web server. Such options aren't available in the live or minimal image. But despite that even there I need to use German during installation in order to get the proper system time.

I struggle with the localization. If I choose English (GB) as language during the installation process I do not get the Austrian localization as an option and I can not set the proper local time. But if I choose German (AT), then I am stuck with German as system language and even the home folders get German names - even with special German chars for the public folder aka "Öffentlich". I don't want that. Of course I can adjust some things like the system language after installation afterwards in principle. But so far I was not able to get a consistent English system with Austrian localization. Isn't there a clean way to do this without having to mess around with single variables that in essence lead to an unpredictable system? (I already ended up with English time formats and language but German week days or with German folder names and English time formats etc.)

cfb
Posts: 52
Joined: 2017-01-08 16:39
Been thanked: 5 times

Re: Howto arbitrary localisation/language combination

#2 Post by cfb »

This is how I understand it:

As you know, the basic way of setting a locale is via LANG and LC_xxx environment variables. What you can set here is determined by which locales have been generated. Check this out with command

Code: Select all

$ locale -a
You can generate locales using command

Code: Select all

# dpkg-reconfigure locales
The list of locales which can be generated is found in file

Code: Select all

/usr/share/i18n/SUPPORTED
This is actually a list of available locale definitions, from which locale files can be generated. As you can see, locale "en_AT" is not among them. So, a suitable "en_AT" definition will have to be created before a locale can be generated. The definition input files are found in directory

Code: Select all

/usr/share/i18n/locales
You will have to create a "en_AT" file, then use command "localedef" to build the definition, for example "en_AT.UTF-8". You could probably use file "en_DK" as a starting point. Then, finally, you will be able to generate a "en_AT.UTF-8" locale and use it.

Now, be aware that a desktop environment such as GNOME, KDE or Cinnamon may provide its own way of dealing with locales and may not use the locale set with LANG. I am unfortunately not familiar with the various DE. I use Xfce.

You say that you have used language English and country Austria previously. That was probably only in the DE and not in a terminal.

User avatar
Onsemeliot
Posts: 333
Joined: 2010-12-15 14:43
Has thanked: 20 times
Been thanked: 5 times

Re: Howto arbitrary localisation/language combination

#3 Post by Onsemeliot »

cfb wrote:You will have to create a "en_AT" file, then use command "localedef" to build the definition, for example "en_AT.UTF-8". You could probably use file "en_DK" as a starting point. Then, finally, you will be able to generate a "en_AT.UTF-8" locale and use it.
Thank you cfb for the detailed guide.
cfb wrote:You say that you have used language English and country Austria previously. That was probably only in the DE and not in a terminal.
I suspect so. Only the system time is dependent on the locale, but this did work well always. And I am a bit confused since I didn't have such issues in the past. It seemed to be a totally normal thing to have English language in a system setup with Austrian localisation. I will attempt to set it up properly with the next installation.

cfb
Posts: 52
Joined: 2017-01-08 16:39
Been thanked: 5 times

Re: Howto arbitrary localisation/language combination

#4 Post by cfb »

Provided that locales "en_US.UTF-8", "de_AT.UTF-8" and "en_DK.UTF-8" have been generated, you could try this for your user:
Set
  • LANG=en_US.UTF-8
    LC_MESSAGES=en_US.UTF-8
    LC_TIME=en_DK.UTF-8
Then set all other relevant LC_xxx variables to "de_AT.UTF-8".
I guess the time and date formats are the same for Austria and Denmark, so this might work.
It is certainly a bit of a mess, but it is easy to try and might save you from creating a new locale.

User avatar
Onsemeliot
Posts: 333
Joined: 2010-12-15 14:43
Has thanked: 20 times
Been thanked: 5 times

Re: Howto arbitrary localisation/language combination

#5 Post by Onsemeliot »

Now I have installed Stretch with GNOME again (after trying out LXDE and XFCE). I might have to tweak the driver situation but from the desktop environment and the standard tools I clearly prefer GNOME. XFCE is not bad but I didn't like the fact that the panels did only get invisible instead of going out of the way when hidden. This way I wasn't able to press any buttons or links which happened to sit where the hidden panel was. GNOME starts definitely slower than XFCE but after that it seems to work well enough.

It obviously is important to not install from the live image. I wish I would have known that from the start. Now I didn't end up with the broken superuser login, could set up German locale with English language without issues and include the web server right away during installation.

Does the expert installer really not allow to choose in more detail what software to include (beside the one list where the desktop environments are listed as options)? Or do I need to deselect the last point in the list to get more choice as a possibly following optional next step? I know I can uninstall everything not needed afterwards (like the included games) but this seems to be an unnecessary hassle if I know already what I want to use.

Post Reply