[gnome-software] gs-content-rating: Add missing description for no tobacco references



commit 617f0de4f109efe319de36cbc42076e667578eda
Author: Philip Withnall <withnall endlessm com>
Date:   Tue Nov 12 12:29:54 2019 +0000

    gs-content-rating: Add missing description for no tobacco references
    
    The description for (`drugs-tobacco`, AS_CONTENT_RATING_VALUE_NONE) was
    missing. Add it; this adds a new translatable string.
    
    Signed-off-by: Philip Withnall <withnall endlessm com>

 src/gs-content-rating.c | 8 +++++++-
 1 file changed, 7 insertions(+), 1 deletion(-)
---
diff --git a/src/gs-content-rating.c b/src/gs-content-rating.c
index b5b77261..d9fc8ca9 100644
--- a/src/gs-content-rating.c
+++ b/src/gs-content-rating.c
@@ -128,7 +128,8 @@ static const struct {
        },
        {
                "drugs-tobacco",
-               NULL,
+               /* TRANSLATORS: content rating description */
+               N_("No references to tobacco products"),
                /* TRANSLATORS: content rating description */
                N_("References to tobacco products"),
                /* TRANSLATORS: content rating description */
@@ -374,6 +375,11 @@ gs_content_rating_key_value_to_str (const gchar *id, AsContentRatingValue value)
                        return _(oars_descriptions[i].desc_none);
                g_assert_not_reached ();
        }
+
+       /* This means the requested @id is missing from @oars_descriptions, so
+        * presumably the OARS spec has been updated but gnome-software hasn’t. */
+       g_warn_if_reached ();
+
        return NULL;
 }
 


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