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 684976 - Having default language list based on location
Having default language list based on location
Status: RESOLVED OBSOLETE
Product: gnome-control-center
Classification: Core
Component: Region & Language
unspecified
Other Linux
: Normal normal
: ---
Assigned To: Control-Center Maintainers
Control-Center Maintainers
Depends on: 684975
Blocks:
 
 
Reported: 2012-09-27 16:01 UTC by Bastien Nocera
Modified: 2021-06-09 16:12 UTC
See Also:
GNOME target: ---
GNOME version: ---



Description Bastien Nocera 2012-09-27 16:01:03 UTC
Rather than based on popularity across the world.

We'd fall back to that list of popular languages if location services weren't available.
Comment 1 Elad Alfassa 2014-08-14 22:33:10 UTC
Now that geoclue works well, we can use it to implement this feature.

The data for which languages are used in which country can be taken from CLDR.

In case you are unfamiliar with CLDR, here it is: http://cldr.unicode.org/index/downloads

specifically http://www.unicode.org/Public/cldr/25/json.zip

Inside this zip file you have many useful json files, for this feature you'll need /supplemental/territoryInfo.json - it includes a list of languages spoken in each country, including percentage of speakers and "official language" status so you can also sort by popularity in the region the user is at.

I'm willing to try and implement this, but I don't know how complicated this will be - I never wrote anything that parses JSON in C, and I never worked with geoclue.
Comment 2 Zeeshan Ali 2014-08-15 11:58:38 UTC
(In reply to comment #1)
> Now that geoclue works well, we can use it to implement this feature.
> 
> The data for which languages are used in which country can be taken from CLDR.
> 
> In case you are unfamiliar with CLDR, here it is:
> http://cldr.unicode.org/index/downloads
> 
> specifically http://www.unicode.org/Public/cldr/25/json.zip
> 
> Inside this zip file you have many useful json files, for this feature you'll
> need /supplemental/territoryInfo.json - it includes a list of languages spoken
> in each country, including percentage of speakers and "official language"
> status so you can also sort by popularity in the region the user is at.

Cool. Thanks for all the needed details for implementation.
 
> I'm willing to try and implement this, but I don't know how complicated this
> will be - I never wrote anything that parses JSON in C, and I never worked with
> geoclue.

neither of those are complicated. json-glib is pretty easy to use and you can find examples in geocode-glib and geoclue. About geoclue, its a dbus service with a rather simple API: http://www.freedesktop.org/software/geoclue/docs/ . You'll want to generate C wrappers to make it even simpler. Check the demo where-am-i (part of geoclue) and/or 'Date&Time' panel code in gnome-settings-deamon.
Comment 3 Elad Alfassa 2014-08-15 12:37:33 UTC
Implementation question before I even begin: How do we get the data? Do we download this zip on runtime and extract the JSON? do we bundle it in the control-center tarballs? Do we expect distributions to install it separately?
Comment 4 Elad Alfassa 2014-08-17 11:12:15 UTC
More questions:

Is geoclue fast enough in most cases to return a result in less than 2 seconds?

Should I display a spinner if finding the location takes more than 2 seconds?

Does geoclue (and geocode-glib) check the network status prior to trying to get a location? I'd want to degrade to the hardcoded default language list as quickly as possible if a location cannot be obtained.

Should the geoclue and geocode-glib dependencies be optional or mandatory? (I'd prefer mandatory, for obvious reasons)

Should there be some sort of indication in the UI that the list is based on the user's current location?
Comment 5 Zeeshan Ali 2014-08-17 12:18:45 UTC
(In reply to comment #4)
> More questions:
> 
> Is geoclue fast enough in most cases to return a result in less than 2 seconds?

Even if it is, you really shouldn't rely on that.

> Should I display a spinner if finding the location takes more than 2 seconds?

You probably should display it anyway.
 
> Does geoclue (and geocode-glib) check the network status prior to trying to get
> a location?

Yes (only geoclue), through glib's network monitor

> I'd want to degrade to the hardcoded default language list as
> quickly as possible if a location cannot be obtained.

Sure, you can have a timeout but typically you'd get a location (geoip or wifi) within a few seconds.
 
> Should the geoclue and geocode-glib dependencies be optional or mandatory? (I'd
> prefer mandatory, for obvious reasons)

gnome-control-center isn't expected to be used outside GNOME and gnome-settings-daemon already have hard dep on both so just add a hard dep I'd say.
 
> Should there be some sort of indication in the UI that the list is based on the
> user's current location?

That would be a question for designers but I think it might be a good idea (though its not mandatory).
Comment 6 Bastien Nocera 2014-08-17 14:00:01 UTC
I actually think we want this information based on Location in gnome-initial-setup. It doesn't make as much as after the fact like here.
Comment 7 Elad Alfassa 2014-08-17 14:04:18 UTC
I think it should be the same in both.
Comment 8 André Klapper 2021-06-09 16:12:06 UTC
GNOME is going to shut down bugzilla.gnome.org in favor of gitlab.gnome.org.
As part of that, we are mass-closing older open tickets in bugzilla.gnome.org
which have not seen updates for a longer time (resources are unfortunately
quite limited so not every ticket can get handled).

If you can still reproduce the situation described in this ticket in a recent
and supported software version, then please follow
  https://wiki.gnome.org/GettingInTouch/BugReportingGuidelines
and create a new bug report at
  https://gitlab.gnome.org/GNOME/gnome-control-center/-/issues/

Thank you for your understanding and your help.