Fix localization in Utils class
Fix the localization in the Utils class by using the “gettext” instead of the “locale” module.
This commit is contained in:
parent
704fa3278a
commit
4708344d4d
1 changed files with 4 additions and 4 deletions
|
@ -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())
|
||||
)
|
||||
|
|
Loading…
Reference in a new issue