Closed Bug 393202 Opened 17 years ago Closed 17 years ago

[Proto] Event dialog: Categories hardcoded

Categories

(Calendar :: General, defect)

defect
Not set
normal

Tracking

(Not tracked)

RESOLVED FIXED

People

(Reporter: milupo, Assigned: mschroeder)

Details

(Keywords: l12y)

Attachments

(1 file)

User-Agent:       Mozilla/5.0 (Windows; U; Win 9x 4.90; hsb-DE; rv:1.8.1.6) Gecko/20070802 SeaMonkey/1.1.4
Build Identifier: 2007082106

Categories of Lightning 0.7pre aren#t localizable. The are hardcoded in file sun-calendar-event-dialog lines 338-342

Reproducible: Always

Steps to Reproduce:
1. Choose any calendar view
2. Right click
3. Click on New event
4. Select the select field next to the Category label in the event window
Actual Results:  
Categories are in English

Expected Results:  
Categories should be in the language of the concerning locale

Maybe the same issue is in Sunbird
What file? http://lxr.mozilla.org/mozilla1.8/find?string=sun-calendar-event-dialog finds 16 files starting with sun-calendar-event-dialog.
Also note that we currently can't ship localized preferences with Lightning. Therefore the category list is empty until the user creates a category. See Bug 382967. 
This means in a fresh Lightning installation there should be no category at all. <http://bonsai.mozilla.org/cvsblame.cgi?file=mozilla/calendar/lightning/content/lightning.js&rev=1.2.2.16&mark=92-95#91>
To Comment #1: Sorry, I forgot the extension, unfortunately in the other bug I opened 393104 as well. It mubs be "sun-calendar-event-dialog.js" in the calendar.jar.

To comment #2: No, in the new event dialog is a list of English categories. I think what you mean is the categories list in the Preferences tab. There the pane is empty, that's right. Or should I enter there the localized categorie so that they will appear in the new event dialog localized?
Status: UNCONFIRMED → NEW
Ever confirmed: true
Keywords: l12y
OS: Windows ME → All
Hardware: PC → All
Flags: blocking-calendar0.7?
Component: Lightning Only → General
QA Contact: lightning → general
Summary: Categories hardcoded → [Proto] Event dialog: Categories hardcoded
Going to mark this as blocking.  We'd like this bug to be the vessel for the described changes here from Simon: http://groups.google.com/group/mozilla.dev.apps.calendar/browse_thread/thread/7c4da6f0fc2db366/c95326b1a489f9ac
Flags: blocking-calendar0.7? → blocking-calendar0.7+
To comments #2 and #3:
I stated that if I add a category in the preferences the list of categories in the new event dialog is cleared and there will be the none entry and the added categoris only. It is so possible to localize the categories list in the new event dialog by adding the localized equivalents in the preferences tab pane. Is this intended? I would prefer to have the localized categories in the new event dialog after switching lightning to the new locale. I remeber anyhow that the old Calendar extension had a similar issue but there was a file categories.properties where the categories were listed.
I've just read that it is intention that there are no localizable categories. I found this text in the file lightning.js:

// categories settings
// XXX One day we might want to move this to a locale specific file
//     and include a list of locale specific default categories
pref("calendar.categories.names", "");

So it seems that it isn't a bug at this moment.
(In reply to comment #6)
This is Bug 382967 as written in comment #2.
Assignee: nobody → ctalbert
Attached patch Patch v1 — — Splinter Review
I also fixed a problem when there are no categories at all and the preferences listbox and the dialog menulist show a ghost item (result from use of split()).
Assignee: ctalbert → mschroeder
Status: NEW → ASSIGNED
Attachment #280574 - Flags: review?(michael.buettner)
Comment on attachment 280574 [details] [diff] [review]
Patch v1

>+        if (gCategoryList.length == 1 && gCategoryList[0] == "")
Instead of comparing with an empty string I would suggest to compare for zero length, this can be written as:
>+        if (gCategoryList.length == 1 && !gCategoryList[0].length)
This has the benefit that no empty string object needs to be constructed. Admittedly, this doesn't make any difference in that case.

Apart from that, the patch looks fine. Thanks, Martin. I'm going to change the above mentioned comparison before checking it in. r=mickey.
Attachment #280574 - Flags: review?(michael.buettner) → review+
patch checked in on trunk and MOZILLA_1_8_BRANCH

-> FIXED
Status: ASSIGNED → RESOLVED
Closed: 17 years ago
Resolution: --- → FIXED
Target Milestone: --- → 0.7
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: