Unify and localize string building for time intervals [start + " - " + end]

RESOLVED FIXED in 0.9

Status

Calendar
General
RESOLVED FIXED
10 years ago
10 years ago

People

(Reporter: martinschroeder, Assigned: Berend Cornelius)

Tracking

({late-l10n})

unspecified
late-l10n
Bug Flags:
wanted-calendar0.9 +

Details

Attachments

(2 attachments)

(Reporter)

Description

10 years ago
Follow up from bug 387863:

We should unify the string building, and probably want to localize the dash in such a line:
> var dateString = startString.value + " - " + endString.value;

There are some languages, like Japanese, that would prefer a different
character for that. For example a character that looks a lot like a dash means
"one". In other localizations, people might prefer to use a word, like the word
"to" in English.

Currently we format the string via [start + " - " + end] in some locations, e.g. in
http://lxr.mozilla.org/mozilla/source/calendar/prototypes/wcap/calendar-invitations-list.xml#169
http://lxr.mozilla.org/mozilla/source/calendar/import-export/calHtmlExport.js#152
http://lxr.mozilla.org/mozilla/source/calendar/resources/content/mouseoverPreviews.js#394
http://lxr.mozilla.org/mozilla/source/calendar/lightning/content/agenda-tree.js#203
http://lxr.mozilla.org/mozilla/source/calendar/lightning/content/agenda-listbox.xml#99
http://lxr.mozilla.org/mozilla/source/calendar/lightning/components/lightningTextCalendarConverter.js#109
http://lxr.mozilla.org/mozilla/source/calendar/base/content/calendar-alarm-widget.xml#114
Summary: Unify and localize string building [start + " - " + end] → Unify and localize string building for time intervals [start + " - " + end]

Comment 1

10 years ago
Bug 421304 would also depend on this, if realized.
(Assignee)

Comment 2

10 years ago
Created attachment 329835 [details] [diff] [review]
patch v. #2

This patch adds the necessary strings to display intervals with included time information.
Assignee: nobody → Berend.Cornelius
Status: NEW → ASSIGNED
Attachment #329835 - Flags: review?(daniel.boelzle)

Comment 3

10 years ago
Comment on attachment 329835 [details] [diff] [review]
patch v. #2

>+datetimeIntervalonSameDay=%1$S %2$S – %3$S
>+datetimeIntervalonSeveralDays=%1$S %2$S – %3$S %4$S
I'd prefer "datetimeIntervalOnSameDay" resp. "datetimeIntervalOnSeveralDays" with capital 'O'.

r=dbo
Attachment #329835 - Flags: review?(daniel.boelzle) → review+
(Assignee)

Comment 4

10 years ago
patch checked in on trunk and MOZILLA_1_8_BRANCH.
-> issue remains open
(Assignee)

Updated

10 years ago
Keywords: late-l10n
(Assignee)

Updated

10 years ago
Flags: wanted-calendar0.9?

Updated

10 years ago
Flags: wanted-calendar0.9? → wanted-calendar0.9+
(Reporter)

Updated

10 years ago
Target Milestone: --- → 0.9
(Assignee)

Comment 5

10 years ago
Created attachment 330331 [details] [diff] [review]
patch v. #3

I finished the implementation of "formatInterval", added a function "formatIntervalByItem" and adapted the mentioned client code.
Attachment #330331 - Flags: review?(daniel.boelzle)

Comment 6

10 years ago
Comment on attachment 330331 [details] [diff] [review]
patch v. #3

nice work, only

>+    AUTF8String formatIntervalByItem(in calIItemBase aItem);
I'd rather call it "formatItemInterval".

r=dbo
Attachment #330331 - Flags: review?(daniel.boelzle) → review+

Comment 7

10 years ago
It appears that month names are defined in five places in each locale:
http://mxr.mozilla.org/l10n-mozilla1.8/search?string=sausi&find=%2Fcalendar%2F&tree=l10n-mozilla1.8

It would be nice to know, where exactly each of those entity groups are used,
so that they could be properly declined and capitalized.

It appears that all date ranges committed by bug #444292 (used in the calendar
header) are using strings from dateFormat.properties, however the Day view uses
something else (global.dtd, I guess). was that intended?
(Assignee)

Comment 8

10 years ago
I renamed the method as proposed by Daniel in comment #6 and checked in patch #3 on trunk and MOZILLA_1_8_BRANCH
(Assignee)

Updated

10 years ago
Status: ASSIGNED → RESOLVED
Last Resolved: 10 years ago
Resolution: --- → FIXED
Looks like this patch incorrectly merged the tasks-aware code from calHtmlExport.js and therefore regressed Bug 457586.
Depends on: 457586
You need to log in before you can comment on or make changes to this bug.