Bug 206439

Summary: [indic] [cal] Abbreviated day names are in english for month view, while they appear in indic lang chars when seen in print-preview/actual-print.
Product: [Fedora] Fedora Reporter: A S Alam <aalam>
Component: evolutionAssignee: Matthew Barnes <mbarnes>
Status: CLOSED UPSTREAM QA Contact:
Severity: medium Docs Contact:
Priority: high    
Version: 8CC: eng-i18n-bugs, majain, mcrha, mshao
Target Milestone: ---Keywords: i18n, Reopened
Target Release: ---   
Hardware: All   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2007-12-04 12:06:13 EST Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---
Bug Depends On:    
Bug Blocks: 221244, 235704    
Attachments:
Description Flags
month view
none
print preview
none
Screenshot - basis for reopening the bug.
none
Print-preview screenshot with correct indic translations from the locale.
none
Buggy Screenshot
none
Patch to solve the problem
none
Screenshot with modified code.
none
Fixes the weekday-picker.c file also none

Description A S Alam 2006-09-14 09:36:37 EDT
Description of problem:
during printing from Cal's Month View (Indic Interface), Calendar is showing
Day's Name in English, but during Printing it shows Day's name in Local language
(like Hindi Punjabi etc)

Version-Release number of selected component (if applicable):
evolution-2.8.0-1.fc6

How reproducible:
Everytime during printing

Steps to Reproduce:
1. Open Evoluton with pa_IN.UTF-8 evolution
2. Goto Calender-Month View
3. Print
  
Actual results:
Month's View Cal's Day in Local Lang

Expected results:
Month's View Cal's Day in should be in Lang in Print or Window should show in
Locale Lang

Additional info:
Comment 1 Akira TAGOH 2006-09-25 06:24:37 EDT
Well, numeral characters should uses the native one?
Comment 2 Mayank Jain 2006-09-26 04:52:46 EDT
Created attachment 137119 [details]
month view
Comment 3 Mayank Jain 2006-09-26 04:54:39 EDT
Created attachment 137120 [details]
print preview

Everything seems working fine here...
Comment 7 Matthew Barnes 2007-01-02 12:17:51 EST
Closing as NOTABUG since neither Mayank nor I could reproduce the problem.  Feel
free to re-open this if you still encounter the problem in Fedora Core 6 or later.
Comment 8 Mayank Jain 2007-01-03 01:55:48 EST
Created attachment 144686 [details]
Screenshot - basis for reopening the bug.
Comment 9 Mayank Jain 2007-01-03 02:06:32 EST
Matthew, the original bug report was misleading. I just discussed this bug with
Aalam. 

The bug is... while print-preview for a month view shows days (top right
calendar in print-view) shows chars in the locale with which evo was run, the
month view shows day names (abbreviations) in english (check screenshot).

Another interesting fact is that is that this bug is not for eastern locales
(ja, chinese) but for indic locales (I tested with pa_IN, hi_IN, gu_IN -
languages with highest translations).

Hence, reopening the bug.
Comment 10 Mayank Jain 2007-01-03 02:20:59 EST
Created attachment 144688 [details]
Print-preview screenshot with correct indic translations from the locale.
Comment 11 Mayank Jain 2007-01-03 02:25:10 EST
Changing the bug summary to be more apt.
Comment 12 Mayank Jain 2007-01-05 02:01:45 EST
The date navigator in question is an ECalendar and is initiated via e-calendar.[ch]

ECalendarItem is the actual navigatable widget in ECalendar.

And this bug originates from this code in e_calendar_item_init in e-calendar-item.c

---------------------
	/* Translators: These are the first characters of each day of the
	   week, 'M' for 'Monday', 'T' for Tuesday etc. */
	calitem->days = _("MTWTFSS");
---------------------


The _("MTWTFSS") is set in the UI using 

-------
for (day = 0; day < 7; day++) {
		layout_set_day_text (calitem, layout, day_index);
-------

and layout_set_day_text simply picks up one char at the day_index value & add it
to pango layout.

One possible fix is that the code can be modified to pick up values of
abbriviated day names from glibc.

I would not recommend translating  _("MTWTFSS") as in almost all indic langs,
day's 1st char would make no sense. Moreover, if this string is picked up from
locale data, it would be always correct... as compared to be depending upon
translator's translation.
Comment 13 Mayank Jain 2007-01-05 02:34:49 EST
Comment #5 From A S Alam (aalam@redhat.com)  	 on 2007-01-05 01:45 EST  
[reply]  	 Private

1-Ok not translate, then in Printout there should be only English, as for most
(not all)
3 characters are used to represent the Day's name (In print), where there is
space is only for 2 character, so those are interMixed

2- otherwise in GUI, only first character should translate (most Indic
translation, they use English so that is TOTALLY Translation issue).

Comment 14 Mayank Jain 2007-01-05 04:35:03 EST
Created attachment 144893 [details]
Buggy Screenshot

The screenshot clealy shows that the current code is not suitable to handle a
utf-8 translation for _("MTWTFSS") string.
Comment 15 Mayank Jain 2007-01-05 04:36:05 EST
Following translation was used in Comment 14's screenshot.

#. Translators: These are the first characters of each day of the
#. week, 'M' for 'Monday', 'T' for Tuesday etc.
#: ../widgets/misc/e-calendar-item.c:416
msgid "MTWTFSS"
msgstr "सोमंबुगुशुशर"
Comment 16 Mayank Jain 2007-01-05 08:22:19 EST
Following a different strategy to use different strings for day names.
Comment 17 Mayank Jain 2007-01-05 09:35:48 EST
Created attachment 144904 [details]
Patch to solve the problem
Comment 18 Mayank Jain 2007-01-05 09:37:18 EST
Created attachment 144905 [details]
Screenshot with modified code.
Comment 19 Mayank Jain 2007-01-05 09:39:02 EST
Matthew, please dont build the patch yet as I can see that there's another
string marked as 

#. The first letter of each day of the week starting with Sunday
#: ../calendar/gui/weekday-picker.c:319
msgid "SMTWTFS"
msgstr "SMTWTFS"

So even this might need some work. Also, letme see if I can fix the printing
issue as well.

Thanks,
Mayank
Comment 20 Mayank Jain 2007-01-05 09:40:11 EST
If you happen to know how can I activate the weekday-picker in UI... please do
share.

:)
Mayank
Comment 21 Mayank Jain 2007-01-05 10:08:03 EST
Created attachment 144907 [details]
Fixes the weekday-picker.c file also

This patch fixes another string translation issue mentioned in previous
comment, marking them in such a way that they use the same translation as in
e-calendar-item.c file.
Comment 22 Mayank Jain 2007-02-23 05:00:24 EST
Matthew, can you please have a look at the patch in Comment 21?

Thanks,
Mayank
Comment 23 Christopher Aillon 2007-04-17 15:33:02 EDT
Since there's a patch, we can try to get this for FC7....
Comment 24 Matthew Barnes 2007-10-04 12:25:53 EDT
Moving to F8Target
Comment 25 Matthias Clasen 2007-10-04 22:01:30 EDT
The patch in comment #21 looks reasonable to me, apart from one typo 
("abbriviated" should be "abbreviated"), but it is of course a string change,
and should be accompanied by a script to convert po files, as far as possible.
Comment 26 Milan Crha 2007-10-19 09:59:31 EDT
I added changed patch to upstream bug.
Comment 27 Hu Zheng 2007-11-19 03:57:56 EST
I have created a new patch which get weekday name from glibc.
See: https://bugzilla.redhat.com/show_bug.cgi?id=221244

Milan Crha, can you send this patch to the upstream bug which created by you?
Comment 28 Milan Crha 2007-11-19 04:21:54 EST
I added other patch to upstream bugzilla (see bugzilla reference below) a month
ago, but it wasn't reviewed yet. Also the bug there wasn't created by me, it's
there for more than 10 months. My patch fixes some issues in a11y as well. You
can see that patch and say what can be improved, if you wish, but I'm sorry, I
don't think we will use your patch. (Maybe neither my, it depends on upstream.)
Comment 29 Matthew Barnes 2007-12-04 12:06:13 EST
This has been fixed upstream so closing as UPSTREAM.

It missed the 2.21.3 release by a hair, but should trickle down to Fedora in
subsequent releases.