Bug 1496086 - Add a separate string for the attendees tab runtime replacement in the event dialog. r=philipp
authorMakeMyDay <makemyday@gmx-topmail.de>
Thu, 18 Oct 2018 12:49:33 +0200
changeset 33412 84694c6debe3ef1ecf3f7660326244acc960e762
parent 33411 b2ec0ac175e5b9ba9d8378aa95514fea3f76bf02
child 33413 9d0f37068236caf4bed8a0773b0f70b35a58da12
push id387
push userclokep@gmail.com
push dateMon, 10 Dec 2018 21:30:47 +0000
reviewersphilipp
bugs1496086
Bug 1496086 - Add a separate string for the attendees tab runtime replacement in the event dialog. r=philipp
calendar/lightning/content/lightning-item-iframe.js
calendar/locales/en-US/chrome/calendar/calendar-event-dialog.properties
--- a/calendar/lightning/content/lightning-item-iframe.js
+++ b/calendar/lightning/content/lightning-item-iframe.js
@@ -3613,23 +3613,21 @@ function updateAttachment() {
         setElementValue("cmd_attach_url", !hasAttachments && "true", "disabled");
     }
 
     // update the attachment tab label to make the number of (uri) attachments visible
     // even if another tab is displayed
     let attachments = Object.values(gAttachMap).filter(aAtt => aAtt.uri);
     let attachmentTab = document.getElementById("event-grid-tab-attachments");
     if (attachments.length) {
-        let trailingColon = "";
-        let newLabel = window.attachmentTabLabel;
-        if (newLabel.endsWith(":")) {
-            trailingColon = ":";
-            newLabel = newLabel.substring(0, newLabel.length - 1);
-        }
-        attachmentTab.label = newLabel + " (" + attachments.length + ")" + trailingColon;
+        attachmentTab.label = cal.l10n.getString(
+            "calendar-event-dialog",
+            "attachmentsTabLabel",
+            [attachments.length]
+        );
     } else {
         attachmentTab.label = window.attachmentTabLabel;
     }
 
     sendMessage({
         command: "updateConfigState",
         argument: { attachUrlCommand: hasAttachments }
     });
@@ -3743,23 +3741,21 @@ function updateAttendees() {
         } else {
             setBooleanAttribute("item-organizer-row", "collapsed", true);
         }
         setupAttendees();
 
         // update the attendee tab label to make the number of attendees
         // visible even if another tab is displayed
         if (window.attendees.length) {
-            let trailingColon = "";
-            let newLabel = window.attendeeTabLabel;
-            if (newLabel.endsWith(":")) {
-                trailingColon = ":";
-                newLabel = newLabel.substring(0, newLabel.length - 1);
-            }
-            attendeeTab.label = newLabel + " (" + window.attendees.length + ")" + trailingColon;
+            attendeeTab.label = cal.l10n.getString(
+                "calendar-event-dialog",
+                "attendeesTabLabel",
+                [window.attendees.length]
+            );
         } else {
             attendeeTab.label = window.attendeeTabLabel;
         }
     } else {
         attendeeTab.setAttribute("collapsed", "true");
         attendeePanel.setAttribute("collapsed", "true");
     }
     updateParentSaveControls();
--- a/calendar/locales/en-US/chrome/calendar/calendar-event-dialog.properties
+++ b/calendar/locales/en-US/chrome/calendar/calendar-event-dialog.properties
@@ -522,8 +522,20 @@ saveandsendButtonTooltip=Save and notify
 # event.menu.item.save.label in the event dialog/tab toolbar if attendees
 # will be notified on saving
 saveandsendMenuLabel=Save and Send
 
 # LOCALIZATION NOTE (sendandcloseMenuLabel) - this is a runtime replacement for
 # event.menu.item.saveandclose.label in the event dialog/tab toolbar if attendees
 # will be notified on saving
 sendandcloseMenuLabel=Send and Close
+
+# LOCALIZATION NOTE (attendeesTabLabel) - this is a runtime replacement for
+# event.attendees.label defined in calendar-event-dialog.dtd and used in the
+# event dialog/tab as attendee tab label if an event has at least one attendee
+# %1$S - the number of attendee (1-n)
+attendeesTabLabel=Attendees (%1$S):
+
+# LOCALIZATION NOTE (attachmentsTabLabel) - this is a runtime replacement for
+# event.attachments.label defined in calendar-event-dialog.dtd and used in the
+# event dialog/tab as attendee tab label if an event has at least one attachment
+# %1$S - the number of attachments (1-n)
+attachmentsTabLabel=Attachments (%1$S):