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 745521 - Weekday names are broken
Weekday names are broken
Status: RESOLVED FIXED
Product: gnome-shell
Classification: Core
Component: calendar
3.15.x
Other Linux
: Normal normal
: ---
Assigned To: gnome-shell-maint
gnome-shell-maint
Depends on:
Blocks:
 
 
Reported: 2015-03-03 12:12 UTC by Vadim Rutkovsky
Modified: 2015-03-04 16:13 UTC
See Also:
GNOME target: 3.16
GNOME version: ---


Attachments
Screenshot (593.87 KB, image/png)
2015-03-03 12:12 UTC, Vadim Rutkovsky
  Details
Screenshot (595.85 KB, image/png)
2015-03-03 12:13 UTC, Vadim Rutkovsky
  Details
util: Filter out message context of untranslated strings (1.07 KB, patch)
2015-03-03 14:10 UTC, Florian Müllner
none Details | Review
util: Filter out message context of untranslated strings (1.17 KB, patch)
2015-03-03 16:20 UTC, Florian Müllner
committed Details | Review
Screenshot enUS (673.77 KB, image/png)
2015-03-04 10:16 UTC, Vadim Rutkovsky
  Details
Fix offset calculation for g_dpgettext (798 bytes, patch)
2015-03-04 11:04 UTC, Matthias Clasen
committed Details | Review
Screenshot (650.09 KB, image/png)
2015-03-04 14:05 UTC, Vadim Rutkovsky
  Details
Fix the offset calculation again (792 bytes, patch)
2015-03-04 15:09 UTC, Matthias Clasen
committed Details | Review

Description Vadim Rutkovsky 2015-03-03 12:12:44 UTC
Created attachment 298416 [details]
Screenshot

'grid...' is displayed instead of month names

Continuous 20150303.30
gnome-shell 3.15.90-24-g9c6e6ea3813666bb31ed4f614d93079be8b84e7e
Comment 1 Vadim Rutkovsky 2015-03-03 12:13:47 UTC
Created attachment 298417 [details]
Screenshot

Extra 'calendar heading' is displayed on switching months
Comment 2 Florian Müllner 2015-03-03 14:10:39 UTC
Created attachment 298432 [details] [review]
util: Filter out message context of untranslated strings

Commit 5a47ad837b changed the definition of NC_() to include the
message context, so that gettext can correctly disambiguate strings
like "S". However this does only work when gettext actually returns
a translation from the catalogue; if the string is not found, we
need to strip the context again to not have it show up in the UI.
Comment 3 Rui Matos 2015-03-03 14:35:55 UTC
Review of attachment 298432 [details] [review]:

this is getting ugly, oh well
Comment 4 Florian Müllner 2015-03-03 16:20:12 UTC
Created attachment 298447 [details] [review]
util: Filter out message context of untranslated strings

Updated patch to use glib for the really ugly part ...
Comment 5 Florian Müllner 2015-03-03 16:23:50 UTC
Attachment 298447 [details] pushed as f85d68a - util: Filter out message context of untranslated strings
Comment 6 Vadim Rutkovsky 2015-03-03 17:04:52 UTC
Now the Xorg session crashes:
Mar 03 18:03:38 qemux86-64 gnome-session[621]: (gnome-shell:696): Gjs-WARNING **: JS ERROR: Error: Failed to convert UTF-8 string to JS string: Invalid byte sequence in conversion input
Mar 03 18:03:38 qemux86-64 gnome-session[621]: _getCalendarDayAbbreviation@resource:///org/gnome/shell/ui/calendar.js:125
Mar 03 18:03:38 qemux86-64 gnome-session[621]: Calendar<._buildHeader@resource:///org/gnome/shell/ui/calendar.js:616
Mar 03 18:03:38 qemux86-64 gnome-session[621]: wrapper@resource:///org/gnome/gjs/modules/lang.js:169
Mar 03 18:03:38 qemux86-64 gnome-session[621]: Calendar<._init@resource:///org/gnome/shell/ui/calendar.js:554
Mar 03 18:03:38 qemux86-64 gnome-session[621]: wrapper@resource:///org/gnome/gjs/modules/lang.js:169
Mar 03 18:03:38 qemux86-64 gnome-session[621]: _Base.prototype._construct@resource:///org/gnome/gjs/modules/lang.js:110
Mar 03 18:03:38 qemux86-64 gnome-session[621]: Class.prototype._construct/newClass@resource:///org/gnome/gjs/modules/lang.js:204
Mar 03 18:03:38 qemux86-64 gnome-session[621]: DateMenuButton<._init@resource:///org/gnome/shell/ui/dateMenu.js:356
Mar 03 18:03:38 qemux86-64 gnome-session[621]: wrapper@resource:///org/gnome/gjs/modules/lang.js:169
Mar 03 18:03:38 qemux86-64 gnome-session[621]: _Base.prototype._construct@resource:///org/gnome/gjs/modules/lang.js:110
Mar 03 18:03:38 qemux86-64 gnome-session[621]: Class.prototype._construct/newClass@resource:///org/gnome/gjs/modules/lang.js:204
Mar 03 18:03:38 qemux86-64 gnome-session[621]: Panel<._ensureIndicator@resource:///org/gnome/shell/ui/panel.js:970
Mar 03 18:03:38 qemux86-64 gnome-session[621]: wrapper@resource:///org/gnome/gjs/modules/lang.js:169
Mar 03 18:03:38 qemux86-64 gnome-session[621]: Panel<._updateBox@resource:///org/gnome/shell/ui/panel.js:981
Mar 03 18:03:38 qemux86-64 gnome-session[621]: wrapper@resource:///org/gnome/gjs/modules/lang.js:169
Mar 03 18:03:38 qemux86-64 gnome-session[621]: Panel<._updatePanel@resource:///org/gnome/shell/ui/panel.js:932
Mar 03 18:03:38 qemux86-64 gnome-session[621]: wrapper@resource:///org/gnome/gjs/modules/lang.js:169
Mar 03 18:03:38 qemux86-64 gnome-session[621]: Panel<._init@resource:///org/gnome/shell/ui/panel.js:758
Mar 03 18:03:38 qemux86-64 gnome-session[621]: wrapper@resource:///org/gnome/gjs/modules/lang.js:169
Mar 03 18:03:38 qemux86-64 gnome-session[621]: _Base.prototype._construct@resource:///org/gnome/gjs/modules/lang.js:110
Mar 03 18:03:38 qemux86-64 gnome-session[621]: Class.prototype._construct/newClass@resource:///org/gnome/gjs/modules/lang.js:204
Mar 03 18:03:38 qemux86-64 gnome-session[621]: _initializeUI@resource:///org/gnome/shell/ui/main.js:163
Mar 03 18:03:38 qemux86-64 gnome-session[621]: start@resource:///org/gnome/shell/ui/main.js:118
Mar 03 18:03:38 qemux86-64 gnome-session[621]: @<main>:1
Comment 7 Florian Müllner 2015-03-03 18:32:23 UTC
(In reply to Vadim Rutkovsky from comment #6)
> Now the Xorg session crashes:
> Mar 03 18:03:38 qemux86-64 gnome-session[621]: (gnome-shell:696):
> Gjs-WARNING **: JS ERROR: Error: Failed to convert UTF-8 string to JS
> string: Invalid byte sequence in conversion input

That's odd, I've tested the patch under en_US.utf8, es_ES.utf8 and C, and the translations are as expected, not to mention that it doesn't crash.
Comment 8 Vadim Rutkovsky 2015-03-04 10:16:36 UTC
Created attachment 298515 [details]
Screenshot enUS

Continuous 20150304.15: switching to Russian/English (UK) works fine now,
but I still get garbled text when I set 'English (United States)' in g-c-c
Comment 9 Matthias Clasen 2015-03-04 11:04:18 UTC
Created attachment 298519 [details] [review]
Fix offset calculation for g_dpgettext

We need to pass a positive number here.
Comment 10 Matthias Clasen 2015-03-04 11:04:43 UTC
Does this help ?
Comment 11 Florian Müllner 2015-03-04 13:14:18 UTC
Review of attachment 298519 [details] [review]:

Ugh, no idea how en_US.utf8 worked for me in testing. This is obviously correct.
Comment 12 Matthias Clasen 2015-03-04 13:38:10 UTC
Attachment 298519 [details] pushed as 3ec764d - Fix offset calculation for g_dpgettext
Comment 13 Vadim Rutkovsky 2015-03-04 14:05:16 UTC
Created attachment 298534 [details]
Screenshot

Still happens here on Continuous 20150304.34 with last patch applied:

The garbled text is gone, but I get an ugly square on weekday name label and empty week day names in the calendar
Comment 14 Vadim Rutkovsky 2015-03-04 14:07:10 UTC
STR: switch Language to US, then to UK and US back - this is where the issue gets triggered
Comment 15 Matthias Clasen 2015-03-04 15:07:21 UTC
Arr, add a +1 I guess to skip the \004 ?
Comment 16 Matthias Clasen 2015-03-04 15:09:27 UTC
Created attachment 298542 [details] [review]
Fix the offset calculation again

We also need to skip over the \004.
Comment 17 Rui Matos 2015-03-04 15:17:31 UTC
Review of attachment 298542 [details] [review]:

right, looks fine
Comment 18 Matthias Clasen 2015-03-04 15:20:15 UTC
Attachment 298542 [details] pushed as 0ebba11 - Fix the offset calculation again
Comment 19 Vadim Rutkovsky 2015-03-04 16:13:53 UTC
Works fine on Continuous 20150304.47, thanks!