Closed Bug 372617 Opened 13 years ago Closed 13 years ago

Timezone in the preferences pane doesn't match "likelyTimezone"

Categories

(Calendar :: Preferences, defect)

defect
Not set

Tracking

(Not tracked)

VERIFIED FIXED
Sunbird 0.5

People

(Reporter: p.franc, Assigned: ssitter)

Details

Attachments

(1 file)

If no preference is set, the function guessSystemTimezone() tries to guess the timezone using the likelyTimezone property from the calendar.properties file. To get this property it uses the stringbundle in gCalendarBundle variable. However this variable is not defined (there is no stringbundle in the prefpane) for the preference/option dialog. 

I would suggest to use something similar to the following code in the calUtils.js

if(typeof(gCalendarBundle) != 'undefined') {
    var stringBundleTZ = gCalendarBundle.getString("likelyTimezone");
} else {
    var strBundleService = Cc["@mozilla.org/intl/stringbundle;1"].getService(Ci.nsIStringBundleService);
    var calendarBundle = strBundleService.createBundle("chrome://calendar/locale/calendar.properties");      
    var stringBundleTZ = calendarBundle.GetStringFromName("likelyTimezone");
}
Please specify if you are using Sunbird or Lightning and what version.

If you are using a recent nightly build this is most probably caused by Bug 370670.
(In reply to comment #1)
> Please specify if you are using Sunbird or Lightning and what version.
Sunbird pre0.5 cs (confirmed in sk too)

> If you are using a recent nightly build this is most probably caused by Bug
> 370670.
IMHO this is unrelated. Bug #370670 is just about updating the timezone string (used for l10n teams that didn't put the full string there). This bug is about not getting this string into the calUtils.js. 

http://lxr.mozilla.org/mozilla/source/calendar/base/src/calUtils.js#203

The gCalendarBundle is null (there is no related stringbundle) while this is called from preference dialog.
(In reply to comment #2)
> Sunbird pre0.5 cs (confirmed in sk too)

Please can you specify what build are you using? (Help>About...)
Mozilla/5.0 (Windows; U; Windows NT 5.1; cs; rv:1.8.1.3pre) Gecko/20070304 Calendar/0.5pre
Mozilla/5.0 (Windows; U; Windows NT 5.1; sk; rv:1.8.1.3pre) Gecko/20070304 Calendar/0.5pre
For sk locale: likelyTimezone is incorrect, short name must be in English

For cs locale: likelyTimezone is incorrect, long name must match a timezone in mozilla/calendar/base/src/tzdata.c

See localization note in http://lxr.mozilla.org/mozilla1.8/source/calendar/locales/en-US/chrome/calendar/calendar.properties#182

Please fix your locale and test again. I'm think I saw this working before.
For sk locale:

no, we have tried English short string, Slovak short string, long name as in mozilla/calendar/base/src/tzdata.c (string '/mozilla.org/20070129_1/Europe/Bratislava' - is this correct?) and nothing worked.

Yes, you are right, it was working when we used non-localized timezones strings.
(In reply to comment #7)

Bug 370670 was just fixed today. Without that patch Sunbird/Lightning tried to match likelyTimezone against a non existent timezone - that would fail in every case. Please retest with next nightly build.
Assignee: nobody → ssitter
Status: NEW → ASSIGNED
Attachment #257412 - Flags: second-review?(mvl)
Attachment #257412 - Flags: first-review?(ctalbert.moz)
OS: Windows XP → All
Hardware: PC → All
Target Milestone: --- → Sunbird 0.5
It still does not work in sk locale.

likelyTimezone is set to /mozilla.org/20070129_1/Europe/Bratislava 

Tested on todays build (with new profile): Mozilla/5.0 (Windows; U; Windows NT 6.0; sk; rv:1.8.1.3pre) Gecko/20070306 Calendar/0.5pre
Comment on attachment 257412 [details] [diff] [review]
rev0 - use calGetString() to read likelyTimezone

r2=mvl
Attachment #257412 - Flags: second-review?(mvl) → second-review+
Comment on attachment 257412 [details] [diff] [review]
rev0 - use calGetString() to read likelyTimezone

r1=lilmatt
Attachment #257412 - Flags: first-review?(ctalbert.moz) → first-review+
Patch checked in on MOZILLA_1_8_BRANCH and trunk.

-> FIXED
Status: ASSIGNED → RESOLVED
Closed: 13 years ago
Resolution: --- → FIXED
Verified using Mozilla/5.0 (Windows; U; Windows NT 5.0; de; rv:1.8.1.3pre) Gecko/20070309 Calendar/0.5pre

Reporters, can you verify using your cs or sk build after the changes from Comment #6?
Verified using Mozilla/5.0 (Windows; U; Windows NT 6.0; sk; rv:1.8.1.3pre) Gecko/20070309 Calendar/0.5pre
Verified per comment#14 and comment#15.
Status: RESOLVED → VERIFIED
Component: Internal Components → Preferences
QA Contact: base → preferences
You need to log in before you can comment on or make changes to this bug.