From 4708344d4db26d26556a46d4b7432796686314dc Mon Sep 17 00:00:00 2001 From: coderkun Date: Sun, 22 Mar 2020 15:39:58 +0100 Subject: [PATCH] Fix localization in Utils class MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Fix the localization in the Utils class by using the “gettext” instead of the “locale” module. --- mcg/utils.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/mcg/utils.py b/mcg/utils.py index c465cbe..22bcbed 100644 --- a/mcg/utils.py +++ b/mcg/utils.py @@ -4,7 +4,7 @@ import gi gi.require_version('Gtk', '3.0') import hashlib -import locale +import gettext import os import urllib @@ -59,7 +59,7 @@ class Utils: def create_artists_label(album): label = ', '.join(album.get_albumartists()) if album.get_artists(): - label = locale.gettext("{} feat. {}").format( + label = gettext.gettext("{} feat. {}").format( label, ", ".join(album.get_artists()) ) @@ -70,13 +70,13 @@ class Utils: minutes = album.get_length() // 60 seconds = album.get_length() - minutes * 60 - return locale.gettext("{}:{} minutes").format(minutes, seconds) + return gettext.gettext("{}:{} minutes").format(minutes, seconds) def create_track_title(track): title = track.get_title() if track.get_artists(): - title = locale.gettext("{} feat. {}").format( + title = gettext.gettext("{} feat. {}").format( title, ", ".join(track.get_artists()) )