mirror of
https://github.com/SoongNoonien/mpdevil.git
synced 2023-08-10 21:12:44 +03:00
simplified locale settings
This commit is contained in:
parent
efabfca7d8
commit
e746812c7d
@ -1,5 +1,6 @@
|
|||||||
conf = configuration_data()
|
conf = configuration_data()
|
||||||
conf.set('RESOURCES_DIR', resources_dir)
|
conf.set('RESOURCES_DIR', resources_dir)
|
||||||
|
conf.set('LOCALE_DIR', join_paths(get_option('prefix'), get_option('datadir'), 'locale'))
|
||||||
|
|
||||||
configure_file(
|
configure_file(
|
||||||
input: 'mpdevil.in',
|
input: 'mpdevil.in',
|
||||||
|
@ -32,16 +32,14 @@ import os
|
|||||||
import sys
|
import sys
|
||||||
import re
|
import re
|
||||||
import locale
|
import locale
|
||||||
|
from gettext import gettext as _, ngettext, textdomain, bindtextdomain
|
||||||
|
|
||||||
try:
|
try:
|
||||||
locale.setlocale(locale.LC_ALL, "")
|
locale.setlocale(locale.LC_ALL, "")
|
||||||
except locale.Error as e:
|
except locale.Error as e:
|
||||||
print(e)
|
print(e)
|
||||||
from gettext import gettext as _, ngettext, textdomain, bindtextdomain
|
bindtextdomain("mpdevil", localedir="@LOCALE_DIR@")
|
||||||
textdomain("mpdevil")
|
textdomain("mpdevil")
|
||||||
if os.path.isfile("/.flatpak-info"): # test for flatpak environment
|
|
||||||
bindtextdomain("mpdevil", "/app/share/locale")
|
|
||||||
else:
|
|
||||||
bindtextdomain("mpdevil", localedir=None) # replace "None" by a static path if needed (e.g when installing on a non-FHS distro)
|
|
||||||
Gio.Resource._register(Gio.resource_load(os.path.join("@RESOURCES_DIR@", "mpdevil.gresource")))
|
Gio.Resource._register(Gio.resource_load(os.path.join("@RESOURCES_DIR@", "mpdevil.gresource")))
|
||||||
|
|
||||||
COVER_REGEX=r"^\.?(album|cover|folder|front).*\.(gif|jpeg|jpg|png)$"
|
COVER_REGEX=r"^\.?(album|cover|folder|front).*\.(gif|jpeg|jpg|png)$"
|
||||||
|
Loading…
Reference in New Issue
Block a user