After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 660725 - Language pane doesn't detect all available languages
Language pane doesn't detect all available languages
Status: RESOLVED FIXED
Product: gnome-control-center
Classification: Core
Component: Region & Language
unspecified
Other All
: Normal enhancement
: ---
Assigned To: Control-Center Maintainers
Depends on:
Blocks:
 
 
Reported: 2011-10-02 22:44 UTC by Allison Karlitskaya (desrt)
Modified: 2011-10-07 14:23 UTC
See Also:
GNOME target: ---
GNOME version: ---



Description Allison Karlitskaya (desrt) 2011-10-02 22:44:19 UTC
The regional settings panel looks like it plucked some code from gdm to determine the list of all available languages.  Contained within it does this:

  if (!collect_locales_from_archive ()) {
    ...
    collect_locales_from_directory ();
  }


ie: the locales directory is only consulted if the locale archive was non-existent or invalid.

This isn't how the libc works.  It first consults the locales archive, but then looks at the contents of the directory as a fallback if the named locale isn't contained in the archive.

I suspect the correct fix is to collect_locales_from_directory() always.
Comment 1 Allison Karlitskaya (desrt) 2011-10-06 14:26:12 UTC
In fact, I'd say that there is an argument for promoting those languages that appear specifically in the directory to the default list of languages (since it is clear that the user took some effort to directly install them in this case).
Comment 2 Bastien Nocera 2011-10-07 14:18:58 UTC
(In reply to comment #0)
> The regional settings panel looks like it plucked some code from gdm to
> determine the list of all available languages.  Contained within it does this:
> 
>   if (!collect_locales_from_archive ()) {
>     ...
>     collect_locales_from_directory ();
>   }
> 
> 
> ie: the locales directory is only consulted if the locale archive was
> non-existent or invalid.
> 
> This isn't how the libc works.  It first consults the locales archive, but then
> looks at the contents of the directory as a fallback if the named locale isn't
> contained in the archive.

In the future, please include links to the code that does that, so I don't need to go second guess you.

http://repo.or.cz/w/glibc.git/blob/HEAD:/locale/findlocale.c#l62

> I suspect the correct fix is to collect_locales_from_directory() always.

Yup.

(In reply to comment #1)
> In fact, I'd say that there is an argument for promoting those languages that
> appear specifically in the directory to the default list of languages (since it
> is clear that the user took some effort to directly install them in this case).

In the case of a distribution where the locales are pick'n'choose, which is weird to begin with.
Comment 3 Bastien Nocera 2011-10-07 14:23:31 UTC
mmit 760430c55c851fe45ade2a0fe6a9f4f32c553ac4
Author: Bastien Nocera <hadess@hadess.net>
Date:   Fri Oct 7 15:19:38 2011 +0100

    common: Always collect locales from the directory
    
    Even if those locales do not exist in the locale-archive file,
    their definition could be in the locale directories. The glibc
    will look in directories as well when the locale-archive doesn't
    contain it, so both behaviours match.
    
    See also:
    http://repo.or.cz/w/glibc.git/blob/HEAD:/locale/findlocale.c#l62
    
    https://bugzilla.gnome.org/show_bug.cgi?id=660725