From 8a43761341f2a3e676f7e2d479705e5fe180d1d3 Mon Sep 17 00:00:00 2001 From: alexey Date: Tue, 5 Dec 2023 17:29:48 +0300 Subject: [PATCH] Added description of standart repos --- po/ru.po | 45 +++++++++++++++++++++++++++++++ src/gs-repo-row.c | 67 +++++++++++++++++++++++++++++++++++++++++------ 2 files changed, 104 insertions(+), 8 deletions(-) diff --git a/po/ru.po b/po/ru.po index a80f80e..3c34e5a 100644 --- a/po/ru.po +++ b/po/ru.po @@ -3134,6 +3134,51 @@ msgctxt "repo-row" msgid "%s • %s" msgstr "%s • %s" +#. TRANSLATORS: additional repo description 1; +#: src/gs-repo-row.c:249 +msgid "General-purpose applications set" +msgstr "Приложения общего назначения" + +#. TRANSLATORS: additional repo description 2; +#: src/gs-repo-row.c:252 +msgid "Core set of the operating system packages" +msgstr "Базовый набор пакетов операционной системы" + +#. TRANSLATORS: additional repo description 3; +#: src/gs-repo-row.c:255 +msgid "Additional packages for use by developers" +msgstr "Дополнительные пакеты для разработчиков" + +#. TRANSLATORS: additional repo description 4; +#: src/gs-repo-row.c:258 +msgid "Extra applications set" +msgstr "Набор дополнительных приложений" + +#. TRANSLATORS: additional repo description 5; +#: src/gs-repo-row.c:261 +msgid "Packages for making high availability clusters" +msgstr "Пакеты для создания кластеров высокой доступности" + +#. TRANSLATORS: additional repo description 6; +#: src/gs-repo-row.c:264 +msgid "Network functions virtualization components" +msgstr "Компоненты для виртуализации сетевых служб" + +#. TRANSLATORS: additional repo description 7; +#: src/gs-repo-row.c:267 +msgid "Packages for making clustered storages" +msgstr "Пакеты для создания кластерных хранилищ" + +#. TRANSLATORS: additional repo description 8; +#: src/gs-repo-row.c:270 +msgid "Real-time system packages set" +msgstr "Набор пакетов для системы реального времени" + +#. TRANSLATORS: additional repo description 9; +#: src/gs-repo-row.c:273 +msgid "Additional packages for use by OS maintainers" +msgstr "Дополнительные пакеты для сопровождающих ОС" + #. TRANSLATORS: lighthearted star rating description; #. * A really bad application #: src/gs-review-dialog.c:82 diff --git a/src/gs-repo-row.c b/src/gs-repo-row.c index 4bdf07b..30ca16c 100644 --- a/src/gs-repo-row.c +++ b/src/gs-repo-row.c @@ -189,12 +189,15 @@ get_repo_installed_text (GsApp *repo) apps_text, addons_text); } +gchar *get_msvsphere_description(const gchar *repo_name); + static void gs_repo_row_set_repo (GsRepoRow *self, GsApp *repo) { GsRepoRowPrivate *priv = gs_repo_row_get_instance_private (self); GsPlugin *plugin; g_autofree gchar *comment = NULL; + g_autofree gchar *msvdescr = NULL; const gchar *tmp; g_assert (priv->repo == NULL); @@ -214,14 +217,20 @@ gs_repo_row_set_repo (GsRepoRow *self, GsApp *repo) gtk_widget_set_visible (priv->hostname_label, FALSE); - tmp = gs_app_get_url (repo, AS_URL_KIND_HOMEPAGE); - if (tmp != NULL && *tmp != '\0') { - g_autoptr(SoupURI) uri = NULL; - - uri = soup_uri_new (tmp); - if (uri && soup_uri_get_host (uri) != NULL && *soup_uri_get_host (uri) != '\0') { - gtk_label_set_label (GTK_LABEL (priv->hostname_label), soup_uri_get_host (uri)); - gtk_widget_set_visible (priv->hostname_label, TRUE); + msvdescr = get_msvsphere_description(gs_app_get_name (repo)); + if (msvdescr){ + gtk_label_set_label (GTK_LABEL (priv->hostname_label), msvdescr); + gtk_widget_set_visible (priv->hostname_label, TRUE); + } else { + tmp = gs_app_get_url (repo, AS_URL_KIND_HOMEPAGE); + if (tmp != NULL && *tmp != '\0') { + g_autoptr(SoupURI) uri = NULL; + + uri = soup_uri_new (tmp); + if (uri && soup_uri_get_host (uri) != NULL && *soup_uri_get_host (uri) != '\0') { + gtk_label_set_label (GTK_LABEL (priv->hostname_label), soup_uri_get_host (uri)); + gtk_widget_set_visible (priv->hostname_label, TRUE); + } } } @@ -242,6 +251,48 @@ gs_repo_row_set_repo (GsRepoRow *self, GsApp *repo) refresh_ui (self); } +gchar *get_msvsphere_description(const gchar *repo_name){ + if (g_strstr_len(repo_name, 9, "MSVSphere") != NULL) { + if (g_strstr_len(repo_name, 32, "AppStream")) { + /* TRANSLATORS: additional repo description 1 */ + return g_strdup(_("General-purpose applications set")); + } + if (g_strstr_len(repo_name, 32, "BaseOS") != NULL) { + /* TRANSLATORS: additional repo description 2 */ + return g_strdup(_("Core set of the operating system packages")); + } + if (g_strstr_len(repo_name, 32, "CRB") != NULL) { + /* TRANSLATORS: additional repo description 3 */ + return g_strdup(_("Additional packages for use by developers")); + } + if (g_strstr_len(repo_name, 32, "Extras") != NULL) { + /* TRANSLATORS: additional repo description 4 */ + return g_strdup(_("Extra applications set")); + } + if (g_strstr_len(repo_name, 32, "HighAvailability") != NULL) { + /* TRANSLATORS: additional repo description 5 */ + return g_strdup(_("Packages for making high availability clusters")); + } + if (g_strstr_len(repo_name, 32, "NFV") != NULL) { + /* TRANSLATORS: additional repo description 6 */ + return g_strdup(_("Network functions virtualization components")); + } + if (g_strstr_len(repo_name, 32, "ResilientStorage") != NULL) { + /* TRANSLATORS: additional repo description 7 */ + return g_strdup(_("Packages for making clustered storages")); + } + if (g_strstr_len(repo_name, 32, "RT") != NULL) { + /* TRANSLATORS: additional repo description 8 */ + return g_strdup(_("Real-time system packages set")); + } + if (g_strstr_len(repo_name, 32, "Devel") != NULL) { + /* TRANSLATORS: additional repo description 9 */ + return g_strdup(_("Additional packages for use by OS maintainers")); + } + } + return NULL; +} + GsApp * gs_repo_row_get_repo (GsRepoRow *self) { -- 2.39.3