Bug 1157041 - Change tab queue notification text (r=mcomella)
authorMartyn Haigh <martyn.haigh@gmail.com>
Wed, 22 Apr 2015 15:59:50 -0700
changeset 240639 1e8c1b79132f321bef7e5b7622a3fc766a2f44a8
parent 240638 8d3db3f40c6bb9919e483a3ffcd71818222e7ab7
child 240640 b86d1ff7338131c387db19ad1184a1c6a002b1a9
push id28639
push usercbook@mozilla.com
push dateThu, 23 Apr 2015 13:34:21 +0000
treeherdermozilla-central@3574449bd314 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersmcomella
bugs1157041
milestone40.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 1157041 - Change tab queue notification text (r=mcomella)
mobile/android/base/locales/en-US/android_strings.dtd
mobile/android/base/strings.xml.in
mobile/android/base/tabqueue/TabQueueHelper.java
--- a/mobile/android/base/locales/en-US/android_strings.dtd
+++ b/mobile/android/base/locales/en-US/android_strings.dtd
@@ -193,30 +193,25 @@
 
 <!ENTITY tab_queue_toast_message2 "Tab queued in &brandShortName;">
 <!ENTITY tab_queue_toast_action "Open now">
 <!ENTITY tab_queue_prompt_title "Opening multiple links?">
 <!ENTITY tab_queue_prompt_text2 "Open them without switching to &brandShortName; each time.">
 <!ENTITY tab_queue_prompt_tip_text "you can change this later in Settings">
 <!ENTITY tab_queue_prompt_positive_action_button "Enable">
 <!ENTITY tab_queue_prompt_negative_action_button "Not now">
-<!-- Localization note (tab_queue_notification_text_plural) : The
+<!ENTITY tab_queue_notification_title "&brandShortName;">
+<!-- Localization note (tab_queue_notification_text_plural2) : The
      formatD is replaced with the number of tabs queued.  The
      number of tabs queued is always more than one.  We can't use
      Android plural forms, sadly. See Bug #753859. -->
-<!ENTITY tab_queue_notification_text_plural "&formatD; tabs queued">
-<!-- Localization note (tab_queue_notification_title_plural) : This is the
-     title of a notification; we expect more than one tab queued. -->
-<!ENTITY tab_queue_notification_title_plural "Tabs Queued">
-<!-- Localization note (tab_queue_notification_title_singular) : This is the
-     title of a notification; we expect only one tab queued. -->
-<!ENTITY tab_queue_notification_title_singular "Tab Queued">
-<!-- Localization note (tab_queue_notification_text_singular) : This is the
+<!ENTITY tab_queue_notification_text_plural2 "&formatD; tabs waiting">
+<!-- Localization note (tab_queue_notification_text_singular2) : This is the
      text of a notification; we expect only one tab queued. -->
-<!ENTITY tab_queue_notification_text_singular "1 tab queued">
+<!ENTITY tab_queue_notification_text_singular2 "1 tab waiting">
 
 <!ENTITY pref_char_encoding "Character encoding">
 <!ENTITY pref_char_encoding_on "Show menu">
 <!ENTITY pref_char_encoding_off "Don\'t show menu">
 <!ENTITY pref_clear_private_data2 "Clear now">
 <!ENTITY pref_clear_private_data_category "Clear private data">
 <!ENTITY pref_clear_on_exit_title2 "Clear on exit">
 <!ENTITY pref_clear_on_exit_summary2 "&brandShortName; will automatically clear your data whenever you select \u0022Quit\u0022 from the main menu">
--- a/mobile/android/base/strings.xml.in
+++ b/mobile/android/base/strings.xml.in
@@ -242,20 +242,19 @@
   <string name="pref_tab_queue_summary">&pref_tab_queue_summary2;</string>
   <string name="tab_queue_prompt_title">&tab_queue_prompt_title;</string>
   <string name="tab_queue_prompt_text">&tab_queue_prompt_text2;</string>
   <string name="tab_queue_prompt_tip_text">&tab_queue_prompt_tip_text;</string>
   <string name="tab_queue_prompt_positive_action_button">&tab_queue_prompt_positive_action_button;</string>
   <string name="tab_queue_prompt_negative_action_button">&tab_queue_prompt_negative_action_button;</string>
   <string name="tab_queue_toast_message">&tab_queue_toast_message2;</string>
   <string name="tab_queue_toast_action">&tab_queue_toast_action;</string>
-  <string name="tab_queue_notification_text_singular">&tab_queue_notification_text_singular;</string>
-  <string name="tab_queue_notification_text_plural">&tab_queue_notification_text_plural;</string>
-  <string name="tab_queue_notification_title_singular">&tab_queue_notification_title_singular;</string>
-  <string name="tab_queue_notification_title_plural">&tab_queue_notification_title_plural;</string>
+  <string name="tab_queue_notification_text_singular">&tab_queue_notification_text_singular2;</string>
+  <string name="tab_queue_notification_text_plural">&tab_queue_notification_text_plural2;</string>
+  <string name="tab_queue_notification_title">&tab_queue_notification_title;</string>
 
   <string name="pref_about_firefox">&pref_about_firefox;</string>
   <string name="pref_vendor_faqs">&pref_vendor_faqs;</string>
   <string name="pref_vendor_feedback">&pref_vendor_feedback;</string>
 
   <string name="pref_dialog_set_default">&pref_dialog_set_default;</string>
   <string name="pref_default">&pref_dialog_default;</string>
   <string name="pref_dialog_remove">&pref_dialog_remove;</string>
--- a/mobile/android/base/tabqueue/TabQueueHelper.java
+++ b/mobile/android/base/tabqueue/TabQueueHelper.java
@@ -114,29 +114,27 @@ public class TabQueueHelper {
     public static void showNotification(final Context context, final int tabsQueued) {
         ThreadUtils.assertNotOnUiThread();
 
         Intent resultIntent = new Intent(context, BrowserApp.class);
         resultIntent.setAction(TabQueueHelper.LOAD_URLS_ACTION);
 
         PendingIntent pendingIntent = PendingIntent.getActivity(context, 0, resultIntent, PendingIntent.FLAG_CANCEL_CURRENT);
 
-        String title, text;
+        final String text;
         final Resources resources = context.getResources();
         if (tabsQueued == 1) {
-            title = resources.getString(R.string.tab_queue_notification_title_singular);
             text = resources.getString(R.string.tab_queue_notification_text_singular);
         } else {
-            title = resources.getString(R.string.tab_queue_notification_title_plural);
             text = resources.getString(R.string.tab_queue_notification_text_plural, tabsQueued);
         }
 
         NotificationCompat.Builder builder = new NotificationCompat.Builder(context)
                                                      .setSmallIcon(R.drawable.ic_status_logo)
-                                                     .setContentTitle(title)
+                                                     .setContentTitle(resources.getString(R.string.tab_queue_notification_title))
                                                      .setContentText(text)
                                                      .setContentIntent(pendingIntent);
 
         NotificationManager notificationManager = (NotificationManager) context.getSystemService(Context.NOTIFICATION_SERVICE);
         notificationManager.notify(TabQueueHelper.TAB_QUEUE_NOTIFICATION_ID, builder.build());
     }
 
     public static boolean shouldOpenTabQueueUrls(final Context context) {