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 737216 - Language displays as a dash
Language displays as a dash
Status: RESOLVED OBSOLETE
Product: gnome-control-center
Classification: Core
Component: User Accounts
3.13.x
Other Linux
: Normal minor
: ---
Assigned To: Control-Center Maintainers
Control-Center Maintainers
Depends on: 737249
Blocks:
 
 
Reported: 2014-09-23 21:25 UTC by Michael Catanzaro
Modified: 2021-06-09 16:28 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
user-accounts: show correct language if it isn't set (1.22 KB, patch)
2014-09-24 10:11 UTC, Ondrej Holy
needs-work Details | Review
user-accounts: show correct language if it isn't set (1.23 KB, patch)
2014-09-24 13:44 UTC, Ondrej Holy
committed Details | Review
remove dead code (1.17 KB, patch)
2014-10-07 09:21 UTC, Ondrej Holy
committed Details | Review

Description Michael Catanzaro 2014-09-23 21:25:11 UTC
With a fresh install of Fedora 21 Alpha Workstation, if I visit the region and language panel my language is displayed as English (United States), which is correct. The user accounts panel claims that my language is —. We should never display that.

I guess if accountsservice doesn't have a language stored for a user, then we should display whatever is shown in the region and language panel, no?

(P.S. This has been broken for a long time; it's nothing new.)
Comment 1 Ondrej Holy 2014-09-24 09:19:09 UTC
We can determine the language only for the one already logged in user if it isn't set in the accountsservice, but we can't determine the language for other accounts. Yes, we can fix it only for the one case, which is reported, but I think the language should be shown correctly for all the users. So the question is, who is responsible for setting the language into the accountsservice?

The gnome-initial-setup should be shown after first login and the language should be set into the accountsservice. But it seems to be broken probably...
Comment 2 Ondrej Holy 2014-09-24 10:11:47 UTC
Created attachment 286963 [details] [review]
user-accounts: show correct language if it isn't set

Determine the language for the logged in user if it isn't set in the acountsservice.
Comment 3 Bastien Nocera 2014-09-24 12:58:56 UTC
Review of attachment 286963 [details] [review]:

::: panels/user-accounts/um-user-panel.c
@@ +706,2 @@
         lang = g_strdup (act_user_get_language (user));
+        if ((!lang || !lang[0]) && act_user_get_uid (user) == getuid ()) {

*lang == '\0'
for the empty string.
Comment 4 Michael Catanzaro 2014-09-24 13:18:04 UTC
(In reply to comment #1)
> The gnome-initial-setup should be shown after first login and the language
> should be set into the accountsservice. But it seems to be broken probably...

It's indeed broken in Fedora 21 Alpha Workstation, but I don't think this ever worked since on my Fedora 20 machine my language is displayed as blank and I definitely went through gnome-initial-setup.

(In reply to comment #1)
> We can determine the language only for the one already logged in user if it
> isn't set in the accountsservice, but we can't determine the language for other
> accounts.

I assumed that if the user's language is not set in accountsservice, then surely it is the "system language" and you can just read it from localed? Is this not the case?
Comment 5 Ondrej Holy 2014-09-24 13:44:12 UTC
Created attachment 286982 [details] [review]
user-accounts: show correct language if it isn't set

The condition statement is fixed.
Comment 6 Ondrej Holy 2014-09-24 14:11:59 UTC
(In reply to comment #4)
> (In reply to comment #1)
> > We can determine the language only for the one already logged in user if it
> > isn't set in the accountsservice, but we can't determine the language for other
> > accounts.
> 
> I assumed that if the user's language is not set in accountsservice, then
> surely it is the "system language" and you can just read it from localed? Is
> this not the case?

We can assume it, but there is another problem that we can't change it without authorization... and if we only show it, the system language could be changed before user's first login.
Comment 7 Bastien Nocera 2014-09-24 15:05:12 UTC
Review of attachment 286982 [details] [review]:

Looks fine to me.
Comment 8 Michael Catanzaro 2014-09-24 17:16:31 UTC
(In reply to comment #6)
> We can assume it, but there is another problem that we can't change it without
> authorization... 

Well of course not! I don't see why that's a problem, though?

> and if we only show it, the system language could be changed
> before user's first login.

Then the user's language would be displayed as the new system language, right? I might be missing something, but I don't see how this is problematic at all.  It certainly seems preferable to displaying the system language only for the currently logged-in user, which only fixes one case of the problem.
Comment 9 Ondrej Holy 2014-09-24 17:16:35 UTC
Comment on attachment 286982 [details] [review]
user-accounts: show correct language if it isn't set

commit 50bed210e54f06155a3eecb9ef6e4479ee1350b6

Thanks for the review!
Comment 10 Ondrej Holy 2014-10-07 09:21:40 UTC
Created attachment 287936 [details] [review]
remove dead code

This lines are dead code, because act_user_get_language() returns empty string if language isn't set. We don't want to fix the condition, because cc_common_language_get_current_language is wrong for other users.
Comment 11 Rui Matos 2014-10-07 09:54:01 UTC
Review of attachment 287936 [details] [review]:

I hate all this papering over corner cases. Anyway, this will show the dash in this case which is fine with me
Comment 12 Ondrej Holy 2014-10-07 10:19:36 UTC
Comment on attachment 287936 [details] [review]
remove dead code

commit 37a54b69d669f688cc9f794fded68af948b3c171
Comment 13 Bastien Nocera 2014-10-17 13:35:09 UTC
Anything else to be done here?
Comment 14 Ondrej Holy 2014-10-17 14:13:56 UTC
Would be good to fix it also for "Other Accounts", but it would be fixed preferably in g-i-s (Bug 737249) and/or in accountsservice instead, because I think it isn't fully correct to show system language here if the language is unknown... However I'm letting this open to know about.
Comment 15 Michael Catanzaro 2016-01-11 23:22:25 UTC
I think we should display the system language if nothing is configured in accountsservice.
Comment 16 André Klapper 2021-06-09 16:28:27 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.