[gnome-software] gs-details-page: Drop workarounds for locales with codesets



commit 07e9d679446310f9e15bb9a6d0b9edd8ee0834a8
Author: Philip Withnall <withnall endlessm com>
Date:   Mon Jan 7 21:16:28 2019 +0000

    gs-details-page: Drop workarounds for locales with codesets
    
    gs_utils_content_rating_system_from_locale() correctly parses locales
    now.
    
    Signed-off-by: Philip Withnall <withnall endlessm com>

 src/gs-details-page.c | 11 ++---------
 1 file changed, 2 insertions(+), 9 deletions(-)
---
diff --git a/src/gs-details-page.c b/src/gs-details-page.c
index adb5bb0d..73dba606 100644
--- a/src/gs-details-page.c
+++ b/src/gs-details-page.c
@@ -1662,18 +1662,11 @@ gs_details_page_refresh_content_rating (GsDetailsPage *self)
        AsContentRating *content_rating;
        GsContentRatingSystem system;
        guint age = 0;
-       gchar *str;
        const gchar *display = NULL;
-       g_autofree gchar *locale = NULL;
+       const gchar *locale;
 
        /* get the content rating system from the locale */
-       locale = g_strdup (setlocale (LC_MESSAGES, NULL));
-       str = g_strstr_len (locale, -1, ".UTF-8");
-       if (str != NULL)
-               *str = '\0';
-       str = g_strstr_len (locale, -1, ".utf8");
-       if (str != NULL)
-               *str = '\0';
+       locale = setlocale (LC_MESSAGES, NULL);
        system = gs_utils_content_rating_system_from_locale (locale);
        g_debug ("content rating system is guessed as %s from %s",
                 gs_content_rating_system_to_str (system),


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