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




commit f50d701fd0cc892675f1e72cd9c8064b72a4b0c7
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              | 15 +++++----------
 daemon/gvfsbackendafc.c             |  4 ++--
 daemon/gvfsbackenddav.c             |  5 +++--
 daemon/gvfsbackendftp.c             |  6 +++---
 daemon/gvfsbackendsftp.c            | 18 +++++++++++-------
 daemon/gvfsbackendsmb.c             | 16 +++++++++++++---
 daemon/gvfsbackendsmbbrowse.c       | 16 +++++++++++++---
 daemon/gvfsdaemonutils.c            |  4 +++-
 monitor/udisks2/gvfsudisks2volume.c |  9 +++++----
 9 files changed, 58 insertions(+), 35 deletions(-)
---
diff --git a/daemon/gvfsafpserver.c b/daemon/gvfsafpserver.c
index a8eeb824..a3ab24ca 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);
+      /* Translators: %s here is the hostname */
+      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..88817703 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 d5c6516d..ab680daf 100644
--- a/daemon/gvfsbackenddav.c
+++ b/daemon/gvfsbackenddav.c
@@ -1587,10 +1587,11 @@ soup_authenticate_interactive (SoupSession *session,
       if (realm == NULL)
         realm = _("WebDAV share");
 
-      prompt = g_strdup_printf (_("Enter password for %s"), realm);
+      /* Translators: %s is the name of the WebDAV share */
+      prompt = g_strdup_printf (_("Authentication Required\nEnter password for “%s”:"), realm);
     }
   else
-    prompt = g_strdup (_("Please enter proxy password"));
+    prompt = g_strdup (_("Authentication Required\nEnter 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 16716e04..71dae102 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);
+            /* Translators: %s here is the hostname */
+            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 b86b7ebb..530a4237 100644
--- a/daemon/gvfsbackendsftp.c
+++ b/daemon/gvfsbackendsftp.c
@@ -1161,17 +1161,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 user and password for “%s”:"), 
hostname ? hostname : op_backend->host);
 
               if (!g_mount_source_ask_password (mount_source,
                                                 prompt,
@@ -1325,8 +1325,10 @@ 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"
+          /* Translators: the first %s is the hostname, the second the key fingerprint */
+         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."),
@@ -1352,7 +1354,9 @@ 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"
+          /* Translators: the first %s is the hostname, the second is an ip address */
+          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 b8319c60..1bd4baab 100644
--- a/daemon/gvfsbackendsmb.c
+++ b/daemon/gvfsbackendsmb.c
@@ -264,9 +264,19 @@ 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"),
-                                    share_name, server_name);
+          if (backend->user)
+            {
+              /* Translators: First %s is a share name, second is a server name */
+              message = g_strdup_printf (_("Authentication Required\nEnter password for share “%s” on 
“%s”:"),
+                                         share_name, server_name);
+            }
+          else
+            {
+              /* Translators: First %s is a share name, second is a server name */
+              message = g_strdup_printf (_("Authentication Required\nEnter user and password for share “%s” 
on “%s”:"),
+                                         share_name, server_name);
+            }
+
          handled = g_mount_source_ask_password (backend->mount_source,
                                                 message,
                                                 username_out,
diff --git a/daemon/gvfsbackendsmbbrowse.c b/daemon/gvfsbackendsmbbrowse.c
index 3b11883e..0bbbe6a9 100644
--- a/daemon/gvfsbackendsmbbrowse.c
+++ b/daemon/gvfsbackendsmbbrowse.c
@@ -367,9 +367,19 @@ 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"),
-                                    server_name);
+          if (backend->user)
+            {
+              /* Translators: %s is a server name */
+              message = g_strdup_printf (_("Authentication Required\nEnter password for “%s”:"),
+                                         server_name);
+            }
+          else
+            {
+              /* Translators: %s is a server name */
+              message = g_strdup_printf (_("Authentication Required\nEnter user and password for “%s”:"),
+                                         server_name);
+            }
+
          handled = g_mount_source_ask_password (backend->mount_source,
                                                 message,
                                                 username_out,
diff --git a/daemon/gvfsdaemonutils.c b/daemon/gvfsdaemonutils.c
index 3337d22a..f793129a 100644
--- a/daemon/gvfsdaemonutils.c
+++ b/daemon/gvfsdaemonutils.c
@@ -332,7 +332,9 @@ 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:"
+
+  /* Translators: The first %s is the reason why verification failed, the second a certificate */
+  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..30078846 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]