[gvfs/wip/verdre/dialog-titles] Use shorter strings for prompt dialog titles



commit b7c9c83ca284818a687e6b1e48bef679c48210cc
Author: Jonas Dreßler <verdre v0yd nl>
Date:   Fri Feb 14 21:54:21 2020 +0100

    Use shorter strings for prompt dialog titles
    
    The layout of the modal dialogs in gnome-shell changed [1] and the title
    now is larger and uses the style of a headline. Make sure all titles
    remain fully visible and use shorter strings for those.
    
    Also unify the generic "Enter password" strings a bit to make work
    easier for translators and use this string for most cases:
    
    "Authentication required\nEnter password for “%s”"
    
    [1] https://gitlab.gnome.org/GNOME/gnome-shell/issues/1343

 daemon/gvfsafpserver.c              | 13 ++++---------
 daemon/gvfsbackendafc.c             |  4 ++--
 daemon/gvfsbackenddav.c             |  4 ++--
 daemon/gvfsbackendftp.c             |  4 ++--
 daemon/gvfsbackendsftp.c            | 16 +++++++++-------
 daemon/gvfsbackendsmb.c             |  2 +-
 daemon/gvfsbackendsmbbrowse.c       |  2 +-
 daemon/gvfsdaemonutils.c            |  2 +-
 monitor/udisks2/gvfsudisks2volume.c |  9 +++++----
 9 files changed, 27 insertions(+), 29 deletions(-)
---
diff --git a/daemon/gvfsafpserver.c b/daemon/gvfsafpserver.c
index a8eeb824..a9d7e55e 100644
--- a/daemon/gvfsafpserver.c
+++ b/daemon/gvfsafpserver.c
@@ -1053,22 +1053,17 @@ g_vfs_afp_server_login (GVfsAfpServer *server,
     gboolean aborted;
 
     g_free (prompt);
+    g_clear_error (&err);
 
     str = g_string_new (NULL);
 
-    if (err)
-    {
-      g_string_append_printf (str, "%s\n", err->message);
-      g_clear_error (&err);
-    }
-    
     /* create prompt */
     if (initial_user)
-      /* translators: %s here is the hostname */
-      g_string_append_printf (str, _("Enter your password for the server “%s”."), server_name);
+      /* Translators: the first %s is the username, the second the host name */
+      g_string_append_printf (str, _("Authentication required\nEnter password for “%s” on “%s”"), 
initial_user, server_name);
     else
       /* translators: %s here is the hostname */
-      g_string_append_printf (str, _("Enter your name and password for the server “%s”."), server_name);
+      g_string_append_printf (str, _("Authentication required\nEnter user and password for “%s”"), 
server_name);
 
     prompt = g_string_free (str, FALSE);
 
diff --git a/daemon/gvfsbackendafc.c b/daemon/gvfsbackendafc.c
index b34e16ec..17031b8d 100644
--- a/daemon/gvfsbackendafc.c
+++ b/daemon/gvfsbackendafc.c
@@ -574,7 +574,7 @@ g_vfs_backend_afc_mount (GVfsBackend *backend,
         /* translators:
          * %s is the device name. 'Try again' is the caption of the button
          * shown in the dialog which is defined above. */
-        message = g_strdup_printf (_("The device “%s” is locked. Enter the passcode on the device and click 
“Try again”."), display_name);
+        message = g_strdup_printf (_("Device locked\nThe device “%s” is locked.\n\nEnter the passcode on the 
device and click “Try again”."), display_name);
       }
     else if (lerr == LOCKDOWN_E_PAIRING_DIALOG_RESPONSE_PENDING)
       {
@@ -582,7 +582,7 @@ g_vfs_backend_afc_mount (GVfsBackend *backend,
          * %s is the device name. 'Try again' is the caption of the button
          * shown in the dialog which is defined above. 'Trust' is the caption
          * of the button shown in the device. */
-        message = g_strdup_printf (_("The device “%s” is not trusted yet. Select “Trust” on the device and 
click “Try again”."), display_name);
+        message = g_strdup_printf (_("Untrusted device\nThe device “%s” is not trusted yet.\n\nSelect 
“Trust” on the device and click “Try again”."), display_name);
       }
     else
       g_assert_not_reached ();
diff --git a/daemon/gvfsbackenddav.c b/daemon/gvfsbackenddav.c
index d4d4ac9b..4c5b449d 100644
--- a/daemon/gvfsbackenddav.c
+++ b/daemon/gvfsbackenddav.c
@@ -1588,10 +1588,10 @@ soup_authenticate_interactive (SoupSession *session,
       if (realm == NULL)
         realm = _("WebDAV share");
 
-      prompt = g_strdup_printf (_("Enter password for %s"), realm);
+      prompt = g_strdup_printf (_("Authentication required\nEnter password for “%s”"), realm);
     }
   else
-    prompt = g_strdup (_("Please enter proxy password"));
+    prompt = g_strdup (_("Authentication required\nPlease enter proxy password"));
 
   if (info->username == NULL)
     pw_ask_flags |= G_ASK_PASSWORD_NEED_USERNAME;
diff --git a/daemon/gvfsbackendftp.c b/daemon/gvfsbackendftp.c
index 1d9de93a..37754f46 100644
--- a/daemon/gvfsbackendftp.c
+++ b/daemon/gvfsbackendftp.c
@@ -527,10 +527,10 @@ restart:
         {
           if (ftp->has_initial_user)
             /* Translators: the first %s is the username, the second the host name */
-            prompt = g_strdup_printf (_("Enter password for %s on %s"), ftp->user, ftp->host_display_name);
+            prompt = g_strdup_printf (_("Authentication required\nEnter password for “%s” on “%s”"), 
ftp->user, ftp->host_display_name);
           else
             /* translators: %s here is the hostname */
-            prompt = g_strdup_printf (_("Enter password for %s"), ftp->host_display_name);
+            prompt = g_strdup_printf (_("Authentication required\nEnter user and password for “%s”"), 
ftp->host_display_name);
         }
          
       flags = G_ASK_PASSWORD_NEED_PASSWORD;
diff --git a/daemon/gvfsbackendsftp.c b/daemon/gvfsbackendsftp.c
index cde9cd85..ebeb5cd3 100644
--- a/daemon/gvfsbackendsftp.c
+++ b/daemon/gvfsbackendsftp.c
@@ -1160,17 +1160,17 @@ handle_login (GVfsBackend *backend,
               if (op_backend->user_specified)
                 if (strcmp (authtype, "publickey") == 0)
                   /* Translators: the first %s is the username, the second the host name */
-                  prompt = g_strdup_printf (_("Enter passphrase for secure key for %s on %s"), 
op_backend->user, op_backend->host);
+                  prompt = g_strdup_printf (_("Authentication required\nEnter passphrase for secure key for 
“%s” on “%s”"), op_backend->user, op_backend->host);
                 else
                   /* Translators: the first %s is the username, the second the host name */
-                  prompt = g_strdup_printf (_("Enter password for %s on %s"), op_backend->user, hostname ? 
hostname : op_backend->host);
+                  prompt = g_strdup_printf (_("Authentication required\nEnter password for “%s” on “%s”"), 
op_backend->user, hostname ? hostname : op_backend->host);
               else
                 if (strcmp (authtype, "publickey") == 0)
                   /* Translators: %s is the hostname */
-                  prompt = g_strdup_printf (_("Enter passphrase for secure key for %s"), op_backend->host);
+                  prompt = g_strdup_printf (_("Authentication required\nEnter passphrase for secure key for 
“%s”"), op_backend->host);
                 else
                   /* Translators: %s is the hostname */
-                  prompt = g_strdup_printf (_("Enter password for %s"), hostname ? hostname : 
op_backend->host);
+                  prompt = g_strdup_printf (_("Authentication required\nEnter password for “%s”"), hostname 
? hostname : op_backend->host);
 
               if (!g_mount_source_ask_password (mount_source,
                                                 prompt,
@@ -1275,8 +1275,9 @@ handle_login (GVfsBackend *backend,
 
          get_hostname_and_fingerprint_from_line (buffer, &hostname, &fingerprint);
 
-         message = g_strdup_printf (_("Can’t verify the identity of “%s”.\n"
-                                      "This happens when you log in to a computer the first time.\n\n"
+         message = g_strdup_printf (_("Identity verification failed\n"
+                                      "Verifying the identity of “%s” failed, this happens when "
+                                      "you log in to a computer the first time.\n\n"
                                       "The identity sent by the remote computer is “%s”. "
                                       "If you want to be absolutely sure it is safe to continue, "
                                       "contact the system administrator."),
@@ -1302,7 +1303,8 @@ handle_login (GVfsBackend *backend,
 
           get_hostname_and_ip_address (buffer, &hostname, &ip_address);
 
-          message = g_strdup_printf (_("The host key for “%s” differs from the key for the IP address “%s”\n"
+          message = g_strdup_printf (_("Identity verification failed\n"
+                                       "The host key for “%s” differs from the key for the IP address “%s”\n"
                                        "If you want to be absolutely sure it is safe to continue, "
                                        "contact the system administrator."),
                                      hostname ? hostname : op_backend->host,
diff --git a/daemon/gvfsbackendsmb.c b/daemon/gvfsbackendsmb.c
index 01b1de79..1142306b 100644
--- a/daemon/gvfsbackendsmb.c
+++ b/daemon/gvfsbackendsmb.c
@@ -264,7 +264,7 @@ auth_callback (SMBCCTX *context,
           g_debug ("auth_callback - asking for password...\n");
 
          /* translators: First %s is a share name, second is a server name */
-         message = g_strdup_printf (_("Password required for share %s on %s"),
+         message = g_strdup_printf (_("Authentication required\nEnter password for share “%s” on “%s”"),
                                     share_name, server_name);
          handled = g_mount_source_ask_password (backend->mount_source,
                                                 message,
diff --git a/daemon/gvfsbackendsmbbrowse.c b/daemon/gvfsbackendsmbbrowse.c
index 3b11883e..5136c10d 100644
--- a/daemon/gvfsbackendsmbbrowse.c
+++ b/daemon/gvfsbackendsmbbrowse.c
@@ -368,7 +368,7 @@ auth_callback (SMBCCTX *context,
           g_debug ("auth_callback - asking for password...\n");
 
          /* translators: %s is a server name */
-         message = g_strdup_printf (_("Password required for %s"),
+         message = g_strdup_printf (_("Authentication required\nEnter password for “%s”"),
                                     server_name);
          handled = g_mount_source_ask_password (backend->mount_source,
                                                 message,
diff --git a/daemon/gvfsdaemonutils.c b/daemon/gvfsdaemonutils.c
index 5292ba4a..28fe84c0 100644
--- a/daemon/gvfsdaemonutils.c
+++ b/daemon/gvfsdaemonutils.c
@@ -332,7 +332,7 @@ gvfs_accept_certificate (GMountSource *mount_source,
 
   certificate_str = certificate_to_string (certificate);
   reason = certificate_flags_to_string (errors);
-  message = g_strdup_printf (_("The site’s identity can’t be verified:"
+  message = g_strdup_printf (_("Identity verification failed\n"
                                "%s\n\n"
                                "%s\n\n"
                                "Are you really sure you would like to continue?"),
diff --git a/monitor/udisks2/gvfsudisks2volume.c b/monitor/udisks2/gvfsudisks2volume.c
index 8c0794d7..f7c2abf9 100644
--- a/monitor/udisks2/gvfsudisks2volume.c
+++ b/monitor/udisks2/gvfsudisks2volume.c
@@ -1496,13 +1496,14 @@ do_unlock (GTask *task)
                                                                        task);
           if (g_strcmp0 (type, "crypto_unknown") == 0)
             /* Translators: %s is the description of the volume that is being unlocked */
-            message = g_strdup_printf (_("Enter a passphrase to unlock the volume\n"
-                                         "The volume %s might be a VeraCrypt volume as it contains random 
data."),
+            message = g_strdup_printf (_("Authentication required\n"
+                                         "A passphrase is needed to access encrypted data on “%s”.\n"
+                                         "The volume might be a VeraCrypt volume as it contains random 
data."),
                                        data->desc_of_encrypted_to_unlock);
           else
             /* Translators: %s is the description of the volume that is being unlocked */
-            message = g_strdup_printf (_("Enter a passphrase to unlock the volume\n"
-                                         "The passphrase is needed to access encrypted data on %s."),
+            message = g_strdup_printf (_("Authentication required\n"
+                                         "A passphrase is needed to access encrypted data on “%s”."),
                                        data->desc_of_encrypted_to_unlock);
 
           pw_ask_flags = G_ASK_PASSWORD_NEED_PASSWORD | G_ASK_PASSWORD_SAVING_SUPPORTED;


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