From 31b639413a37f2fd1759c39b75760163a91fb6c0 Mon Sep 17 00:00:00 2001 From: Alexey Berezhok Date: Tue, 5 Dec 2023 17:29:48 +0300 Subject: [PATCH] Added description of standart repos --- po/ru.po | 41 ++++++++++++++++++++++++++++++ src/gs-repo-row.c | 63 +++++++++++++++++++++++++++++++++++++++++------ 2 files changed, 96 insertions(+), 8 deletions(-) diff --git a/po/ru.po b/po/ru.po index a80f80e..3df5754 100644 --- a/po/ru.po +++ b/po/ru.po @@ -3134,6 +3134,47 @@ msgctxt "repo-row" msgid "%s • %s" msgstr "%s • %s" +#. TRANSLATORS: additional repo description 1; +#: src/gs-repo-row.c:249 +msgid "AppStream repo" +msgstr "Репозиторий стандартных приложений" + +#. TRANSLATORS: additional repo description 2; +#: src/gs-repo-row.c:252 +msgid "BaseOS repo" +msgstr "Базовый репозиторий" + +#. TRANSLATORS: additional repo description 3; +#: src/gs-repo-row.c:255 +msgid "CRB repo" +msgstr "Репозиторий для разработчиков" + +#. TRANSLATORS: additional repo description 4; +#: src/gs-repo-row.c:258 +msgid "Extras repo" +msgstr "Репозиторий с дополнительными приложениями" + +#. TRANSLATORS: additional repo description 5; +#: src/gs-repo-row.c:261 +msgid "HighAvailability repo" +msgstr "Репозиторий со служюами высокой доступности" + +#. TRANSLATORS: additional repo description 6; +#: src/gs-repo-row.c:264 +msgid "NFV repo" +msgstr "Репозиторий с пакетами для концепции NFV" + +#. TRANSLATORS: additional repo description 7; +#: src/gs-repo-row.c:267 +msgid "ResilientStorage repo" +msgstr "Репозиторий для кластерных хранилищ" + +#. TRANSLATORS: additional repo description 8; +#: src/gs-repo-row.c:270 +msgid "RT repo" +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..4775db3 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,44 @@ 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(_("AppStream repo")); + } + if (g_strstr_len(repo_name, 32, "BaseOS") != NULL) { + /* TRANSLATORS: additional repo description 2 */ + return g_strdup(_("BaseOS repo")); + } + if (g_strstr_len(repo_name, 32, "CRB") != NULL) { + /* TRANSLATORS: additional repo description 3 */ + return g_strdup(_("CRB repo")); + } + if (g_strstr_len(repo_name, 32, "Extras") != NULL) { + /* TRANSLATORS: additional repo description 4 */ + return g_strdup(_("Extras repo")); + } + if (g_strstr_len(repo_name, 32, "HighAvailability") != NULL) { + /* TRANSLATORS: additional repo description 5 */ + return g_strdup(_("HighAvailability repo")); + } + if (g_strstr_len(repo_name, 32, "NFV") != NULL) { + /* TRANSLATORS: additional repo description 6 */ + return g_strdup(_("NFV repo")); + } + if (g_strstr_len(repo_name, 32, "ResilientStorage") != NULL) { + /* TRANSLATORS: additional repo description 7 */ + return g_strdup(_("ResilientStorage repo")); + } + if (g_strstr_len(repo_name, 32, "RT") != NULL) { + /* TRANSLATORS: additional repo description 8 */ + return g_strdup(_("RT repo")); + } + } + return NULL; +} + GsApp * gs_repo_row_get_repo (GsRepoRow *self) { -- 2.39.3