[gnome-shell] end-session-dialog: Use correct plural forms for timeouts



commit a4eb3c17eb487822e0d1fd478061baea2648f6b0
Author: Florian MÃllner <fmuellner gnome org>
Date:   Wed Sep 7 13:34:48 2011 +0200

    end-session-dialog: Use correct plural forms for timeouts
    
    All end-session dialogs need to use ngettext for their timeout
    strings, fix this.
    
    https://bugzilla.gnome.org/show_bug.cgi?id=639987

 js/ui/endSessionDialog.js |   30 +++++++++++++++++++++++-------
 1 files changed, 23 insertions(+), 7 deletions(-)
---
diff --git a/js/ui/endSessionDialog.js b/js/ui/endSessionDialog.js
index 3403d69..c68a867 100644
--- a/js/ui/endSessionDialog.js
+++ b/js/ui/endSessionDialog.js
@@ -60,8 +60,16 @@ const logoutDialogContent = {
     subjectWithUser: _("Log Out %s"),
     subject: _("Log Out"),
     inhibitedDescription: _("Click Log Out to quit these applications and log out of the system."),
-    uninhibitedDescriptionWithUser: _("%s will be logged out automatically in %d seconds."),
-    uninhibitedDescription: _("You will be logged out automatically in %d seconds."),
+    uninhibitedDescriptionWithUser: function(user, seconds) {
+        return ngettext("%s will be logged out automatically in %d second.",
+                        "%s will be logged out automatically in %d seconds.",
+                        seconds).format(user, seconds);
+    },
+    uninhibitedDescription: function(seconds) {
+        return ngettext("You will be logged out automatically in %d second.",
+                        "You will be logged out automatically in %d seconds.",
+                        seconds).format(seconds);
+    },
     endDescription: _("Logging out of the system."),
     confirmButtons: [{ signal: 'ConfirmedLogout',
                        label:  _("Log Out") }],
@@ -71,7 +79,11 @@ const logoutDialogContent = {
 const shutdownDialogContent = {
     subject: _("Power Off"),
     inhibitedDescription: _("Click Power Off to quit these applications and power off the system."),
-    uninhibitedDescription: _("The system will power off automatically in %d seconds."),
+    uninhibitedDescription: function(seconds) {
+        return ngettext("The system will power off automatically in %d second.",
+                        "The system will power off automatically in %d seconds.",
+                        seconds).format(seconds);
+    },
     endDescription: _("Powering off the system."),
     confirmButtons: [{ signal: 'ConfirmedReboot',
                        label:  _("Restart") },
@@ -84,7 +96,11 @@ const shutdownDialogContent = {
 const restartDialogContent = {
     subject: _("Restart"),
     inhibitedDescription: _("Click Restart to quit these applications and restart the system."),
-    uninhibitedDescription: _("The system will restart automatically in %d seconds."),
+    uninhibitedDescription: function(seconds) {
+        return ngettext("The system will restart automatically in %d second.",
+                        "The system will restart automatically in %d seconds.",
+                        seconds).format(seconds);
+    },
     endDescription: _("Restarting the system."),
     confirmButtons: [{ signal: 'ConfirmedReboot',
                        label:  _("Restart") }],
@@ -388,14 +404,14 @@ EndSessionDialog.prototype = {
                         subject = dialogContent.subjectWithUser.format(realName);
 
                     if (dialogContent.uninhibitedDescriptionWithUser)
-                        description = dialogContent.uninhibitedDescriptionWithUser.format(realName, displayTime);
+                        description = dialogContent.uninhibitedDescriptionWithUser(realName, displayTime);
                     else
-                        description = dialogContent.uninhibitedDescription.format(displayTime);
+                        description = dialogContent.uninhibitedDescription(displayTime);
                 }
             }
 
             if (!description)
-                description = dialogContent.uninhibitedDescription.format(displayTime);
+                description = dialogContent.uninhibitedDescription(displayTime);
         } else {
             description = dialogContent.endDescription;
         }



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]