Locales are not found if selected, and LANG states non-default (subcategory) name

Bug #563285 reported by Jens Beyer
20
This bug affects 3 people
Affects Status Importance Assigned to Milestone
widelands
Fix Released
Medium
Unassigned
widelands (Debian)
Fix Released
Unknown
widelands (Ubuntu)
Fix Released
Low
Unassigned

Bug Description

On Linux:

$ locale
LANG=de_DE@euro
LC_CTYPE="de_DE@euro"
LC_NUMERIC="de_DE@euro"
LC_TIME="de_DE@euro"
LC_COLLATE=C
LC_MONETARY="de_DE@euro"
LC_MESSAGES="de_DE@euro"
LC_PAPER="de_DE@euro"
LC_NAME="de_DE@euro"
LC_ADDRESS="de_DE@euro"
LC_TELEPHONE="de_DE@euro"
LC_MEASUREMENT="de_DE@euro"
LC_IDENTIFICATION="de_DE@euro"
LC_ALL=

$ locale -a
C
POSIX
de_DE
de_DE.iso88591
de_DE.iso885915@euro
de_DE@euro
deutsch
en_US
en_US.iso88591
en_US.utf8
german

If I select "Deutsch" in widelands menu, it doesn't work. Setting language="de_DE@euro" or language="de_DE" in ¨/.widelands/config it works.

This happened a couple of times now for people on IRC.
I guess we need to try a few text domains for languages with different countries (e.g. for de we should try at least de, de_DE, de_CH and de_AT).

I don't know where that bug ultimately is caused, maybe someone can enlighten me here. I just know how to fix it for me, and everyone else who had the problem could fix it the same way.

Related branches

Revision history for this message
SirVer (sirver) wrote :

I heard from this bug before, could someone take the time, hunt it down and finally kill it?

Changed in widelands:
status: New → Confirmed
importance: Undecided → Medium
Revision history for this message
Timowi (timo-wingender) wrote :

I know where the problem is but not how to fix this easily.

We use gettext to translate widelands. The gettext library (we use it through glibc) is actually about localisation and not only translation. And this depends on the system. Not every system have every possible locale

On every system are sets of definitions, charmaps and everything which is needed to compile locale definition files. Now these locale definition files are compiled with localedef. The name of the locale definition can be choosen more or less freely. You can name a locale simply de or de_DE, de_DE.UTF8, de_DE.UTF-8, de_DE.utf-8, de_DE.iso8859-15, ... Some system have almost every locale defined by default and some systems enable only one or two needed locales during installation...

And exactly there is our problem. We do not know which locales (system, not widelands) are installed and we do not know how the installed locales are named. So if I for example want to test widelands in Esperanto but have no locale definition for it it is impossible to switch the language.

I see two possibilities to get this working:
1. Use the current way (localisation from libc) and find a way to map the installed locales to languages. It has the disadvantage that only languages are selectable for which a locale is installed.

2. Find a tool that does translation without needing the locale information. I do not know an alternative to gettext which is compatible to the current language catalogues. This way has the advantage that the translations work independent of the system setup.

Changed in widelands (Ubuntu):
status: New → Triaged
importance: Undecided → Low
Revision history for this message
Jens Beyer (qcumber-some) wrote :

I made it working on my current system setup:

$ locale
LANG=de_DE.UTF-8@euro
LC_CTYPE="de_DE.UTF-8@euro"
LC_NUMERIC="de_DE.UTF-8@euro"
LC_TIME="de_DE.UTF-8@euro"
LC_COLLATE=C
LC_MONETARY="de_DE.UTF-8@euro"
LC_MESSAGES="de_DE.UTF-8@euro"
LC_PAPER="de_DE.UTF-8@euro"
LC_NAME="de_DE.UTF-8@euro"
LC_ADDRESS="de_DE.UTF-8@euro"
LC_TELEPHONE="de_DE.UTF-8@euro"
LC_MEASUREMENT="de_DE.UTF-8@euro"
LC_IDENTIFICATION="de_DE.UTF-8@euro"
LC_ALL=

$ locale -a
C
POSIX
de_DE.utf8
de_DE.utf8@euro
en_US
en_US.iso88591
en_US.utf8

See the patch attached. It's basically just one line...

tags: added: patch
SirVer (sirver)
Changed in widelands:
milestone: none → build16-rc1
tags: added: patch-forwarded-upstream
removed: patch
Changed in widelands (Debian):
status: Unknown → New
Nasenbaer (nasenbaer)
Changed in widelands:
status: Confirmed → Fix Committed
Revision history for this message
SirVer (sirver) wrote :

Released in build16-rc1

Changed in widelands:
status: Fix Committed → Fix Released
Changed in widelands (Ubuntu):
status: Triaged → Fix Released
Changed in widelands (Debian):
status: New → Fix Released
Changed in widelands (Debian):
status: Fix Released → New
Changed in widelands (Debian):
status: New → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Duplicates of this bug

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.