From: Alexander Mikhaylenko <alexander.mikhaylenko@puri.sm>
Date: Thu, 22 Apr 2021 22:17:58 +0500
Subject: summary: Say Librem 5 instead of PureOS for handsets

Long term we should use hardware model from hostnamed for this, but we
don't have new enough systemd in PureOS, so just hardcode Librem 5 for now.
---
 .../pages/summary/gis-summary-page.c               | 51 ++++++++++++++--------
 1 file changed, 32 insertions(+), 19 deletions(-)

diff --git a/gnome-initial-setup/pages/summary/gis-summary-page.c b/gnome-initial-setup/pages/summary/gis-summary-page.c
index 00d2e3d..7af233f 100644
--- a/gnome-initial-setup/pages/summary/gis-summary-page.c
+++ b/gnome-initial-setup/pages/summary/gis-summary-page.c
@@ -207,25 +207,38 @@ static void
 update_distro_name (GisSummaryPage *page)
 {
   GisSummaryPagePrivate *priv = gis_summary_page_get_instance_private (page);
-  g_autofree char *name = g_get_os_info (G_OS_INFO_KEY_NAME);
-  char *text;
-
-  if (!name)
-    name = g_strdup ("GNOME 3");
-
-  /* Translators: the parameter here is the name of a distribution,
-   * like "Fedora" or "Ubuntu". It falls back to "GNOME 3" if we can't
-   * detect any distribution. */
-  text = g_strdup_printf (_("_Start Using %s"), name);
-  gtk_label_set_label (GTK_LABEL (priv->start_button_label), text);
-  g_free (text);
-
-  /* Translators: the parameter here is the name of a distribution,
-   * like "Fedora" or "Ubuntu". It falls back to "GNOME 3" if we can't
-   * detect any distribution. */
-  text = g_strdup_printf (_("%s is ready to be used. We hope that you love it!"), name);
-  gtk_label_set_label (GTK_LABEL (priv->tagline), text);
-  g_free (text);
+  g_autofree char *name = NULL;
+  g_autofree char *start_text = NULL;
+  g_autofree char *tagline_text = NULL;
+
+  if (gis_get_is_librem_5 ()) {
+    name = g_strdup ("Librem 5");
+
+    /* Translators: the parameter here is the name of a device model,
+     * like "Librem 5". */
+    start_text = g_strdup_printf (_("_Start Using Your %s"), name);
+
+    /* Translators: the parameter here is the name of a device model,
+     * like "Librem 5". */
+    tagline_text = g_strdup_printf (_("Your %s is ready to be used. We hope that you love it!"), name);
+  } else {
+    name = g_get_os_info (G_OS_INFO_KEY_NAME);
+    if (!name)
+      name = g_strdup ("GNOME 3");
+
+    /* Translators: the parameter here is the name of a distribution,
+     * like "Fedora" or "Ubuntu". It falls back to "GNOME 3" if we can't
+     * detect any distribution. */
+    start_text = g_strdup_printf (_("_Start Using %s"), name);
+
+    /* Translators: the parameter here is the name of a distribution,
+     * like "Fedora" or "Ubuntu". It falls back to "GNOME 3" if we can't
+     * detect any distribution. */
+    tagline_text = g_strdup_printf (_("%s is ready to be used. We hope that you love it!"), name);
+  }
+
+  gtk_label_set_label (GTK_LABEL (priv->start_button_label), start_text);
+  gtk_label_set_label (GTK_LABEL (priv->tagline), tagline_text);
 }
 
 static void
