Skip to content

Commit 90ed863

Browse files
committed
Bug 1982434 - Migrate the main calendar context menu(s) to fluent. r=aleca,coreycb
Differential Revision: https://phabricator.services.mozilla.com/D260738 --HG-- extra : amend_source : 159c6d322072f6cffff6e2eb7d70f6ab74566a28
1 parent 6ee3084 commit 90ed863

6 files changed

Lines changed: 130 additions & 72 deletions

File tree

calendar/base/content/calendar-context-menus-and-tooltips.inc.xhtml

Lines changed: 21 additions & 42 deletions
Original file line numberDiff line numberDiff line change
@@ -17,8 +17,7 @@
1717

1818
<menupopup id="agenda-menupopup"
1919
class="no-icon-menupopup">
20-
<menuitem label="&calendar.context.modifyorviewitem.label;"
21-
accesskey="&calendar.context.modifyorviewitem.accesskey;"
20+
<menuitem data-l10n-id="calendar-context-open-event"
2221
command="agenda_edit_event_command"/>
2322
<menu id="agenda-context-menu-convert-menu"
2423
class="no-icon-menupopup"
@@ -38,8 +37,7 @@
3837
</menupopup>
3938
</menu>
4039
<menuseparator id="calendar-today-pane-menuseparator-before-delete"/>
41-
<menuitem label="&calendar.context.deleteevent.label;"
42-
accesskey="&calendar.context.deleteevent.accesskey;"
40+
<menuitem data-l10n-id="calendar-context-delete-event"
4341
key="calendar-delete-item-key"
4442
command="agenda_delete_event_command"/>
4543
<menu id="calendar-today-pane-menu-attendance-menu"
@@ -274,37 +272,31 @@
274272
class="no-icon-menupopup"
275273
onpopupshowing="return setupContextItemType(event, currentView().getSelectedItems());">
276274
<menuitem id="calendar-item-context-menu-view-menuitem"
277-
label="&calendar.context.modifyorviewitem.label;"
278-
accesskey="&calendar.context.modifyorviewitem.accesskey;"
275+
data-l10n-id="calendar-context-open-event"
279276
command="calendar_view_event_command"/>
280277
<menuitem id="calendar-item-context-menu-modify-menuitem"
281278
data-l10n-id="calendar-item-context-menu-modify-menuitem"
282279
command="calendar_modify_event_command"
283280
disabled="true" />
284281
<menuitem id="calendar-item-context-menu-newevent-menutitem"
285-
label="&calendar.context.newevent.label;"
286-
accesskey="&calendar.context.newevent.accesskey;"
282+
data-l10n-id="calendar-context-new-event"
287283
key="calendar-new-event-key"
288284
command="calendar_new_event_context_command"/>
289285
<menuitem id="calendar-item-context-menu-newtodo-menuitem"
290-
label="&calendar.context.newtodo.label;"
291-
accesskey="&calendar.context.newtodo.accesskey;"
286+
data-l10n-id="calendar-context-new-task"
292287
key="calendar-new-todo-key"
293288
command="calendar_new_todo_context_command"/>
294289
<menuseparator id="calendar-item-context-menuseparator-adddeletemodify"/>
295290
<menuitem id="calendar-item-context-menu-cut-menuitem"
296-
label="&calendar.context.cutevent.label;"
297-
accesskey="&calendar.context.cutevent.accesskey;"
291+
data-l10n-id="calendar-context-cut"
298292
key="key_cut"
299293
command="cmd_cut"/>
300294
<menuitem id="calendar-item-context-menu-copy-menuitem"
301-
label="&calendar.context.copyevent.label;"
302-
accesskey="&calendar.context.copyevent.accesskey;"
295+
data-l10n-id="calendar-context-copy"
303296
key="key_copy"
304297
command="cmd_copy"/>
305298
<menuitem id="calendar-item-context-menu-paste-menuitem"
306-
label="&calendar.context.pasteevent.label;"
307-
accesskey="&calendar.context.pasteevent.accesskey;"
299+
data-l10n-id="calendar-context-paste"
308300
key="key_paste"
309301
command="cmd_paste"/>
310302
<menuseparator id="calendar-item-context-separator-cutcopypaste"/>
@@ -509,14 +501,12 @@
509501
<menupopup id="calendar-view-context-menu"
510502
class="no-icon-menupopup">
511503
<menuitem id="calendar-view-context-menu-newevent"
512-
label="&calendar.context.newevent.label;"
504+
data-l10n-id="calendar-context-new-event"
513505
command="calendar_new_event_context_command"
514-
accesskey="&calendar.context.newevent.accesskey;"
515506
key="calendar-new-event-key"/>
516507
<menuitem id="calendar-view-context-menu-newtodo"
517-
label="&calendar.context.newtodo.label;"
508+
data-l10n-id="calendar-context-new-task"
518509
command="calendar_new_todo_context_command"
519-
accesskey="&calendar.context.newtodo.accesskey;"
520510
key="calendar-new-todo-key"/>
521511
<!-- These labels are set dynamically, based on the current view -->
522512
<menuitem id="calendar-view-context-menu-previous"
@@ -527,18 +517,15 @@
527517
<!-- Cut and copy doesn't make sense in the views, but only showing paste
528518
makes it look like something is missing. Disable by default. -->
529519
<menuitem id="calendar-view-context-menu-cut-menuitem"
530-
label="&calendar.context.cutevent.label;"
531-
accesskey="&calendar.context.cutevent.accesskey;"
520+
data-l10n-id="calendar-context-cut"
532521
key="key_cut"
533522
disabled="true"/>
534523
<menuitem id="calendar-view-context-menu-copy-menuitem"
535-
label="&calendar.context.copyevent.label;"
536-
accesskey="&calendar.context.copyevent.accesskey;"
524+
data-l10n-id="calendar-context-copy"
537525
key="key_copy"
538526
disabled="true"/>
539527
<menuitem id="calendar-view-context-menu-paste-menuitem"
540-
label="&calendar.context.pasteevent.label;"
541-
accesskey="&calendar.context.pasteevent.accesskey;"
528+
data-l10n-id="calendar-context-paste"
542529
key="key_paste"
543530
command="cmd_paste"/>
544531
</menupopup>
@@ -549,37 +536,30 @@
549536
onpopupshowing="changeContextMenuForTask(event);"
550537
onpopuphiding="handleTaskContextMenuStateChange(event);">
551538
<menuitem id="task-context-menu-modify"
552-
label="&calendar.context.modifyorviewtask.label;"
553-
accesskey="&calendar.context.modifyorviewtask.accesskey;"
539+
data-l10n-id="calendar-context-open-task"
554540
command="calendar_modify_todo_command"/>
555541
<menuitem id="task-context-menu-modify-todaypane"
556-
label="&calendar.context.modifyorviewtask.label;"
557-
accesskey="&calendar.context.modifyorviewtask.accesskey;"
542+
data-l10n-id="calendar-context-open-task"
558543
command="calendar_modify_todo_todaypane_command"/>
559544
<menuitem id="task-context-menu-new"
560-
label="&calendar.context.newtodo.label;"
561-
accesskey="&calendar.context.newtodo.accesskey;"
545+
data-l10n-id="calendar-context-new-task"
562546
key="calendar-new-todo-key"
563547
command="calendar_new_todo_command"/>
564548
<menuitem id="task-context-menu-new-todaypane"
565-
label="&calendar.context.newtodo.label;"
566-
accesskey="&calendar.context.newtodo.accesskey;"
549+
data-l10n-id="calendar-context-new-task"
567550
key="calendar-new-todo-key"
568551
command="calendar_new_todo_todaypane_command"/>
569552
<menuseparator id="task-context-menuseparator-cutcopypaste"/>
570553
<menuitem id="task-context-menu-cut-menuitem"
571-
label="&calendar.context.cutevent.label;"
572-
accesskey="&calendar.context.cutevent.accesskey;"
554+
data-l10n-id="calendar-context-cut"
573555
key="key_cut"
574556
command="cmd_cut"/>
575557
<menuitem id="task-context-menu-copy-menuitem"
576-
label="&calendar.context.copyevent.label;"
577-
accesskey="&calendar.context.copyevent.accesskey;"
558+
data-l10n-id="calendar-context-copy"
578559
key="key_copy"
579560
command="cmd_copy"/>
580561
<menuitem id="task-context-menu-paste-menuitem"
581-
label="&calendar.context.pasteevent.label;"
582-
accesskey="&calendar.context.pasteevent.accesskey;"
562+
data-l10n-id="calendar-context-paste"
583563
key="key_paste"
584564
command="cmd_paste"/>
585565
<menuseparator id="calendar-menuseparator-beforemarkcompleted"/>
@@ -643,8 +623,7 @@
643623
</menu>
644624
<menuseparator/>
645625
<menuitem id="task-context-menu-delete"
646-
label="&calendar.context.deletetask.label;"
647-
accesskey="&calendar.context.deletetask.accesskey;"
626+
data-l10n-id="calendar-context-delete-task"
648627
command="calendar_delete_todo_command"/>
649628
<menu id="task-context-menu-attendance-menu"
650629
label="&calendar.context.attendance.menu.label;"

calendar/base/content/calendar-tab-panels.inc.xhtml

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -435,8 +435,7 @@
435435
</toolbarbutton>
436436
<toolbarbutton id="calendar-delete-task-button"
437437
class="toolbarbutton-1 message-header-view-button"
438-
label="&calendar.taskview.delete.label;"
439-
tooltiptext="&calendar.context.deletetask.label;"
438+
data-l10n-id="calendar-taskview-delete"
440439
command="calendar_delete_todo_command"/>
441440
</hbox>
442441
</vbox>

calendar/base/content/calendar-view-menu.inc.xhtml

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,7 @@
66
class="hide-when-calendar-deactivated"/>
77
<menu id="calTodayPaneMenu"
88
class="hide-when-calendar-deactivated"
9-
label="&calendar.context.button.label;"
10-
accesskey="&calendar.context.button.accesskey;">
9+
data-l10n-id="calendar-context-today-pane">
1110
<menupopup id="calTodayPaneMenuPopup">
1211
<menuitem id="calShowTodayPane-2"
1312
label="&todaypane.showTodayPane.label;"

calendar/locales/en-US/calendar/calendar.ftl

Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -780,3 +780,48 @@ modify-conflict-prompt-button2 = Discard these changes
780780
# Accessible description of a grid calendar with no selected date
781781
minimonth-no-selected-date =
782782
.aria-label = No date selected
783+
784+
# Used in the main menu and contextual menus.
785+
calendar-context-today-pane =
786+
.label = Today Pane
787+
.accesskey = P
788+
789+
calendar-context-open-event =
790+
.label = Open
791+
.accesskey = O
792+
793+
calendar-context-open-task =
794+
.label = Open Task…
795+
.accesskey = O
796+
797+
calendar-context-new-event =
798+
.label = New Event…
799+
.accesskey = N
800+
801+
calendar-context-new-task =
802+
.label = New Task…
803+
.accesskey = k
804+
805+
calendar-context-delete-task =
806+
.label = Delete Task
807+
.accesskey = l
808+
809+
calendar-context-delete-event =
810+
.label = Delete Event
811+
.accesskey = l
812+
813+
calendar-context-cut =
814+
.label = Cut
815+
.accesskey = t
816+
817+
calendar-context-copy =
818+
.label = Copy
819+
.accesskey = C
820+
821+
calendar-context-paste =
822+
.label = Paste
823+
.accesskey = P
824+
825+
calendar-taskview-delete =
826+
.label = Delete
827+
.tooltiptext = Delete Task

calendar/locales/en-US/chrome/calendar/calendar.dtd

Lines changed: 0 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -80,27 +80,6 @@
8080
<!ENTITY calendar.task.text-filter.textbox.emptytext.keylabel.mac "&lt;&#x21E7;&#x2318;K&gt;">
8181

8282
<!-- Context Menu -->
83-
<!ENTITY calendar.context.modifyorviewitem.label "Open">
84-
<!ENTITY calendar.context.modifyorviewitem.accesskey "O">
85-
<!ENTITY calendar.context.modifyorviewtask.label "Open Task…">
86-
<!ENTITY calendar.context.modifyorviewtask.accesskey "O">
87-
<!ENTITY calendar.context.newevent.label "New Event…">
88-
<!ENTITY calendar.context.newevent.accesskey "N">
89-
<!ENTITY calendar.context.newtodo.label "New Task…">
90-
<!ENTITY calendar.context.newtodo.accesskey "k">
91-
<!ENTITY calendar.context.deletetask.label "Delete Task">
92-
<!ENTITY calendar.context.deletetask.accesskey "l">
93-
<!ENTITY calendar.context.deleteevent.label "Delete Event">
94-
<!ENTITY calendar.context.deleteevent.accesskey "l">
95-
<!ENTITY calendar.context.cutevent.label "Cut">
96-
<!ENTITY calendar.context.cutevent.accesskey "t">
97-
<!ENTITY calendar.context.copyevent.label "Copy">
98-
<!ENTITY calendar.context.copyevent.accesskey "C">
99-
<!ENTITY calendar.context.pasteevent.label "Paste">
100-
<!ENTITY calendar.context.pasteevent.accesskey "P">
101-
<!ENTITY calendar.context.button.label "Today Pane">
102-
<!ENTITY calendar.context.button.accesskey "P">
103-
10483
<!ENTITY calendar.context.attendance.menu.label "Attendance">
10584
<!ENTITY calendar.context.attendance.menu.accesskey "d">
10685
<!ENTITY calendar.context.attendance.occurrence.label "This Occurrence">
@@ -183,11 +162,6 @@
183162
<!ENTITY calendar.copylink.label "Copy Link Location">
184163
<!ENTITY calendar.copylink.accesskey "C">
185164

186-
<!-- Task View -->
187-
<!-- Note that the above *.context.* strings are currently used for the other
188-
task action buttons -->
189-
<!ENTITY calendar.taskview.delete.label "Delete">
190-
191165
<!-- Server Context Menu -->
192166
<!ENTITY calendar.context.newserver.label "New Calendar…">
193167
<!ENTITY calendar.context.newserver.accesskey "N">
Lines changed: 62 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,62 @@
1+
# Any copyright is dedicated to the Public Domain.
2+
# http://creativecommons.org/publicdomain/zero/1.0/
3+
4+
from fluent.migratetb.helpers import transforms_from
5+
6+
7+
def migrate(ctx):
8+
"""Bug 1982434 - Migrate the calendar context menu(s) to fluent. part {index}"""
9+
source = "calendar/chrome/calendar/calendar.dtd"
10+
11+
ctx.add_transforms(
12+
"calendar/calendar/calendar.ftl",
13+
"calendar/calendar/calendar.ftl",
14+
transforms_from(
15+
"""
16+
calendar-context-open-event =
17+
.label = {COPY(from_path, "calendar.context.modifyorviewitem.label")}
18+
.accesskey = {COPY(from_path, "calendar.context.modifyorviewitem.accesskey")}
19+
20+
calendar-context-open-task =
21+
.label = {COPY(from_path, "calendar.context.modifyorviewtask.label")}
22+
.accesskey = {COPY(from_path, "calendar.context.modifyorviewtask.accesskey")}
23+
24+
calendar-context-new-event =
25+
.label = {COPY(from_path, "calendar.context.newevent.label")}
26+
.accesskey = {COPY(from_path, "calendar.context.newevent.accesskey")}
27+
28+
calendar-context-new-task =
29+
.label = {COPY(from_path, "calendar.context.newtodo.label")}
30+
.accesskey = {COPY(from_path, "calendar.context.newtodo.accesskey")}
31+
32+
calendar-context-delete-task =
33+
.label = {COPY(from_path, "calendar.context.deletetask.label")}
34+
.accesskey = {COPY(from_path, "calendar.context.deletetask.accesskey")}
35+
36+
calendar-context-delete-event =
37+
.label = {COPY(from_path, "calendar.context.deleteevent.label")}
38+
.accesskey = {COPY(from_path, "calendar.context.deleteevent.accesskey")}
39+
40+
calendar-context-cut =
41+
.label = {COPY(from_path, "calendar.context.cutevent.label")}
42+
.accesskey = {COPY(from_path, "calendar.context.cutevent.accesskey")}
43+
44+
calendar-context-copy =
45+
.label = {COPY(from_path, "calendar.context.copyevent.label")}
46+
.accesskey = {COPY(from_path, "calendar.context.copyevent.accesskey")}
47+
48+
calendar-context-paste =
49+
.label = {COPY(from_path, "calendar.context.pasteevent.label")}
50+
.accesskey = {COPY(from_path, "calendar.context.pasteevent.accesskey")}
51+
52+
calendar-context-today-pane =
53+
.label = {COPY(from_path, "calendar.context.button.label")}
54+
.accesskey = {COPY(from_path, "calendar.context.button.accesskey")}
55+
56+
calendar-taskview-delete =
57+
.label = {COPY(from_path, "calendar.taskview.delete.label")}
58+
.tooltiptext = {COPY(from_path, "calendar.context.deletetask.label")}
59+
""",
60+
from_path=source,
61+
),
62+
)

0 commit comments

Comments
 (0)