Opened 10 years ago

Closed 8 years ago

#2944 closed defect (fixed)

Clock always uses American format

Reported by: dsd Owned by: garycmartin
Priority: Unspecified by Maintainer Milestone: Unspecified
Component: Clock Version: Unspecified
Severity: Unspecified Keywords: patch
Cc: cjl, sridhar, humitos, manuq Distribution/OS: Unspecified
Bug Status: Unconfirmed

Description

As reported here: http://web.archiveorange.com/archive/v/5pGlYzwzWztp7ezqqiLf (untested by me): Clock is in American format (month before date) regardless of country settings - tried English Australia

Clock version 6.

Attachments (1)

0001-Fix-date-shown-at-the-bottom-SL-2944.patch (2.2 KB) - added by humitos 9 years ago.

Download all attachments as: .zip

Change History (15)

comment:1 Changed 10 years ago by cjl

  • Cc cjl added

comment:2 Changed 10 years ago by sridhar

  • Cc sridhar added

Downstream report for Australia: https://dev.laptop.org.au/issues/871

comment:3 Changed 10 years ago by RafaelOrtiz

Maybe this has to do with the pango markup set as lang=en and not e.g lang=en-GB

comment:4 Changed 10 years ago by RafaelOrtiz

As for some testing by Sebastian Silva, testing under en_GB locale shows same bug.Change in Pango Markup doesn't fix it.



comment:5 follow-up: Changed 9 years ago by juanmanuel

I tried Spanish languages and the date it shows correctly (dd/mm/yyyy) and en-US language shows me mm/dd/yyyy format. Bug fixed?

comment:6 in reply to: ↑ 5 ; follow-up: Changed 9 years ago by humitos

  • Cc humitos added

Replying to juanmanuel:

I tried Spanish languages and the date it shows correctly (dd/mm/yyyy) and en-US language shows me mm/dd/yyyy format. Bug fixed?

I've just tested it on XO 1.75 os8 with Spanish (Argentina) and I see:

viernes, 05/04/2012

and it should show:

Viernes, 04/05/2012

I have the same behavior in jhbuild with the latest git version of this activity.

comment:7 Changed 9 years ago by humitos

  • Keywords patch added

OK.

I'm going to attach a patch that solves this problem, but I don't know how to do it in a better way. I mean, I'm attaching this patch as example but I think this is the "incorrect" way to do it.

The point is, we should remove the old Write Date translation string and uncomment the correct one.

I need a bit of help about how to do this in the correct way. I'm not good at translations.

comment:8 in reply to: ↑ 6 Changed 9 years ago by cjl

Replying to humitos:

I've just tested it on XO 1.75 os8 with Spanish (Argentina) and I see:

viernes, 05/04/2012

and it should show:

Viernes, 04/05/2012

I think the es_AR glibc locale needs to be investigated as a possible source of this error type (assuming we are using it's data).

Specifically, the lower case v for "viernes" is defined in the es_AR glibc locale (line 97).

http://sourceware.org/git/?p=glibc.git;a=blob;f=localedata/locales/es_AR;h=c757638f7f127933431067409ab18214431a1938;hb=refs/heads/release/2.14/master#l97

97 "<U0076><U0069><U0065><U0072><U006E><U0065><U0073>";/

To change this to an uppercased "Viernes", a bug (and patch) will need to be filed on the es_AR locale against product "glibc" and component "localedata" at http://sourceware.org/bugzilla/

changing the initial <U0076> 'v" to "<U0056> "V" as well as correcting all other day names in the LC_TIME day section similarly.

comment:9 Changed 9 years ago by dsd

I'm not so sure if changing that in glibc is the right approach.

In English, days of the week are always capitalised, which is why glibc would say "Monday" instead of "monday".

But in Spanish, you do not capitalise them. They would only be capitalised if they were at the start of a sentence. And I'm not even sure if you would ever start a sentence with one (if you wanted to say "Friday is a good day" you would use "El viernes es un buen día" or similar, I think). Maybe humitos can clarify.

So I imagine thats why they are not capitalised in glibc.

comment:10 Changed 9 years ago by cjl

dsd, I agree it is not necessarily the right approach for the day name in Spanish. I was just trying to provide a very specific and illustrative example of my more general reply on the sugar-devel list

http://lists.sugarlabs.org/archive/sugar-devel/2012-May/037181.html

maybe not the best example. Although you have all-too-extensive experience with tracing bugs upstream and fixing them there, I just wanted to emphasize that possible challenge for humitos.

comment:11 Changed 9 years ago by humitos

There isn't a bug in glibc, I'm almost sure about that. It's glibc :)

So, about the "Viernes" (capitalized version). I would write "Viernes" instead of "viernes" because it's the beginning of the sentence. I says: "Viernes, 05/04/12". That's my point.

In Spanish, the fifth day of the week (Friday, in English - with uppercase in the "F") is "viernes" in lowercase:

comment:12 Changed 9 years ago by humitos

Another problem is the way that are the numbers shown. How do we do to fix that? How can I translate my patch in the correct way?

comment:13 follow-up: Changed 9 years ago by cjl

Are you unsure of the syntax for gettext-ing the markup? If so, look at typingturtle or gogo as examples.

comment:14 in reply to: ↑ 13 Changed 8 years ago by humitos

  • Cc manuq added
  • Resolution set to fixed
  • Status changed from new to closed

Replying to cjl:

Are you unsure of the syntax for gettext-ing the markup? If so, look at typingturtle or gogo as examples.

I think this is an issue that should be solved by the translation team, in http://translate.sugarlabs.org

The problematic line in clock is clock.py:139. Actually, it has a TRANS: comment there. For the Spanish translation we should use:

'<markup>\
<span lang="en" font_desc="Sans 20">\
<span foreground="#B20008">%A</span>, \
<span foreground="#5E008C">%d</span>/\
<span foreground="#B20008">%m</span>/\
<span foreground="#9A5200">%Y</span></span></markup>'

In fact, it's already done[1] and works properly in XO-4 13.1.0 build 30.

[1] http://translate.sugarlabs.org/es/honey/clock.po?item=4&view_mode=translate

For the uppercase issue, I thought we could use .title() method but that is not possible because the %A is between specific markup. We should have a way to ask glibc for the name of the weekdays in uppercase because they are needed if the sentence starts with a weekday name. I would leave this as it is. If you consider this should be changed, please open a new bug to track this issue.

Note: See TracTickets for help on using tickets.