! Please note that this is a snapshot of our old Bugzilla server, which is read only since May 29, 2020. Please go to gitlab.xfce.org for our new server !
Event dialogue does not use local date format for start and end dates
Status:
CLOSED: INVALID

Comments

Description Oliver Story 2007-04-10 02:19:28 CEST
When adding a new event, I noticed that the 'Start' and 'End' dates were using the wrong date format for my system locale - ie showing 'mm/dd/yyyy' instead of 'dd/mm/yyyy'

My system is set up with LANG=en_AU.UTF-8 in /etc/environment and /etc/default/locale

Orage clock (on the panel) shows the date in the correct format.

Orage version is 4.3.99.1 shipped with xubuntu
Comment 1 juha editbugs 2007-04-10 17:14:22 CEST
I think the issue is how your system is setup. Orage uses language files to
define how the dates look like in those buttons. This means that LANG is not
enough, but you need LANGUAGE also.

command 
locale
shows this setting also. 
It works for me when I set
LANGUAGE=en_AU:en:en_GB:en

Comment 2 Oliver Story 2007-04-11 03:10:50 CEST
Created attachment 1089 
Screenshot - initial setup

Shows locale environment variables and different date formats for different Orage components, as system was set up
Comment 3 Oliver Story 2007-04-11 03:12:44 CEST
Created attachment 1090 
Screenshot - with LANGUAGE set

Shows locale variables with LANGUAGE set, and no change to Orage button format
Comment 4 Oliver Story 2007-04-11 03:46:58 CEST
You could be right, it could be the way my system is set up. However, setting 'LANGUAGE' didn't work for me (at least I can't make it work). I did not have LANGUAGE set before at all. I've tried a few different LANGUAGE settings, including:

LANGUAGE=en_AU:en:en_GB:en (the one you used)
LANGUAGE=en_AU.UTF-8:en_GB.UTF-8:en (one that corresponds to the UTF_8 encodings on my system - do the encodings matter in this case?)
LANGUAGE=en_AU:en_GB
LANGUAGE=en_AU:en_AU.UTF-8:en_AU.utf8:en_GB:en_GB.UTF-8:en_GB.utf8 (in case I need to write utf8 rather than UTF-8)

I've attached before-and-after screenshots. The clock in the bottom right corner is Orage Clock, with the second line set to %x.

When you say Orage uses language files for those buttons, does that mean that for today's date it would use something like gettext("04/11/2007") rather than strftime(%x) ? Does mean you have to write a gettext translation file for each supported locale with translations for the days of the year? Do you do it this way because of some quirk of the xfce programming library that only allows you to use gettext on button text, and not strftime?

I think this is odd behaviour - from the google-searching and reading I've just done, LANG is supposed to set the default for all LC_ variables, with LC_TIME specifically supposed to define the time/date format. LANGUAGE is an extension to allow specification of a list of fall-back locales for getttext translation, and overides LC_MESSAGES (not LC_TIME). The following page was the most complete explanation I could find; everything else seems to be consistent with this: http://www.suse.de/~mfabian/suse-cjk/locales-env-var.html

If you still think it's a system setup issue, happy to work with ubuntu / xubuntu packagers to work out what the right setup should be. I just don't think getting the date format right should be this hard for the end user.
Comment 5 juha editbugs 2007-04-11 09:23:05 CEST
"When you say Orage uses language files for those buttons, does that mean that
for today's date it would use something like gettext("04/11/2007") rather than
strftime(%x) ?"
>> Yes, Orage uses   date_format = _("%m/%d/%Y");
>> which is exactly what you say...

Does mean you have to write a gettext translation file for each
supported locale with translations for the days of the year? 
>> Yes, that is how it is implemented

Do you do it this way because of some quirk of the xfce programming library that only allows you to use gettext on button text, and not strftime?
>> No. strftime should work equally. The question mainly is which one is
>> more reliable and flexible: Operating system or Xfce translators.
..................
I tried %x as you suggested and it works and I like it, so I probably will
change Orage to use it, but it does not help you now with your current problem.
.......................
Back to the issue:
Yes, I still think it is something in your system. For some reason Orage is not
using the proper gettext translation file. Could you try:
strings /usr/local/xfce/share/locale/en_AU/LC_MESSAGES/orage.mo
(the location of this file may be different in your system)

For me it shows:
 $ strings /usr/local/xfce/share/locale/en_AU/LC_MESSAGES/orage.mo
%m/%d/%Y
Contributor
Manage your time with Xfce4
Select _Today
_Help
Project-Id-Version: orage 4.3.90.2
Report-Msgid-Bugs-To:
POT-Creation-Date: 2007-02-01 21:40+0200
PO-Revision-Date: 2006-10-08 17:20+0900
Last-Translator: Juha Kautto <juha@xfce.org>
Language-Team: Austrilian English <en_gb@li.org>
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Plural-Forms: nplurals=2; plural=(n != 1);
%d/%m/%y
Contributor
Manage your time with Xfce4
Select _Today
_Help


And the "%d/%m/%y" is the translation which may not exist in your system?
Comment 6 Oliver Story 2007-04-12 00:48:18 CEST
Problem solved by upgrading my language pack.

Ubuntu splits the language files into a separate package, and the English language pack on my system was out of date. There was no orage.mo translation file for en_AU at all. After upgrading the package with command "sudo aptitude install language-pack-en", I have an en_AU translation file at /usr/share/locale-langpack/en_AU/LC_MESSAGES/orage.mo 

The LANGUAGE variable does not need to be set for this to work - with LANG=en_AU.UTF-8 the en_AU translation file is used.

I have changed status to Resolved / INVALID as this was a system setup issue - feel free to change back if you're planning on changing date_format to %x and want to use bugzilla as a reminder

Thanks for your help :-)
Comment 7 juha editbugs 2007-04-12 19:07:43 CEST
Thanks a lot for this great idea.

I have now canged orage 4.5 to use operating system's %x setting. This is now
better in sync with the orage-clock panel plugin and is much simpler to code.

I will not do this change in Orage 4.4 since it may change settings to some 
countries and I do not want that to happen in the stable release.

This is not yet in svn since I do several similar changes in other parts of
Orage. This now gives me the possibility to use the same date format in every
place.

I will keep this bug open until I can commit these changes into 4.5 trunc svn.
Comment 8 juha editbugs 2007-04-15 12:22:34 CEST
This is now coded in 4.5.9.3 svn revision 25575.

Thanks once agin for this great idea.

Bug #3120

Reported by:
Oliver Story
Reported on: 2007-04-10
Last modified on: 2007-04-15

People

CC List:
0 users

Version

Version:
unspecified

Attachments

Screenshot - initial setup (146.60 KB, image/png)
2007-04-11 03:10 CEST , Oliver Story
no flags
Screenshot - with LANGUAGE set (164.04 KB, image/png)
2007-04-11 03:12 CEST , Oliver Story
no flags

Additional information