[gnome-software/localize-strings] CR fixes



commit da8cab9d58c9f392eb6c6d16406614a815b685a0
Author: Jordi Mas <jmas softcatala org>
Date:   Sat May 25 17:16:13 2019 +0200

    CR fixes

 src/gs-content-rating.c | 12 ++++++------
 src/gs-details-page.c   |  3 +--
 2 files changed, 7 insertions(+), 8 deletions(-)
---
diff --git a/src/gs-content-rating.c b/src/gs-content-rating.c
index c09156c4..9ce57dab 100644
--- a/src/gs-content-rating.c
+++ b/src/gs-content-rating.c
@@ -8,8 +8,8 @@
 #include "config.h"
 
 #include <glib/gi18n.h>
-#include <string.h>
 #include <glib/gprintf.h>
+#include <string.h>
 #include "gs-content-rating.h"
 
 const gchar *
@@ -361,10 +361,10 @@ gs_content_rating_key_value_to_str (const gchar *id, AsContentRatingValue value)
 static char *
 get_esrb_string (gchar *source, gchar *translate)
 {
-       int equal = g_strcmp0 (source, translate);
-       if (equal == 0)
+       if (g_strcmp0 (source, translate) == 0)
                return g_strdup (source);
-
+       /* TRANSLATORS: This is the formatting of English and localized name
+          of the rating e.g. "Adults Only (solo adultos)" */
        return g_strdup_printf (_("%s (%s)"), source, translate);
 }
 
@@ -499,7 +499,7 @@ gs_utils_content_rating_age_to_str (GsContentRatingSystem system, guint age)
                        return g_strdup ("M18");
                if (age >= 16)
                        return g_strdup ("ADV");
-               return g_strdup ("General");
+               return get_esrb_string ("General", _("General"));
        }
        if (system == GS_CONTENT_RATING_SYSTEM_GRAC) {
                if (age >= 18)
@@ -508,7 +508,7 @@ gs_utils_content_rating_age_to_str (GsContentRatingSystem system, guint age)
                        return g_strdup ("15");
                if (age >= 12)
                        return g_strdup ("12");
-               return g_strdup ("ALL");
+               return get_esrb_string ("ALL", _("ALL"));
        }
        if (system == GS_CONTENT_RATING_SYSTEM_ESRB) {
                if (age >= 18)
diff --git a/src/gs-details-page.c b/src/gs-details-page.c
index 6b18019c..87f00f12 100644
--- a/src/gs-details-page.c
+++ b/src/gs-details-page.c
@@ -1689,7 +1689,7 @@ gs_details_page_refresh_content_rating (GsDetailsPage *self)
        AsContentRating *content_rating;
        GsContentRatingSystem system;
        guint age = 0;
-       const gchar *display = NULL;
+       g_autofree gchar *display = NULL;
        const gchar *locale;
 
        /* get the content rating system from the locale */
@@ -1710,7 +1710,6 @@ gs_details_page_refresh_content_rating (GsDetailsPage *self)
                gtk_widget_set_visible (self->button_details_rating_value, TRUE);
                gtk_widget_set_visible (self->label_details_rating_title, TRUE);
                gs_details_page_content_rating_set_css (self->button_details_rating_value, age);
-        g_free(display);
        } else {
                gtk_widget_set_visible (self->button_details_rating_value, FALSE);
                gtk_widget_set_visible (self->label_details_rating_title, FALSE);


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