build: localize .desktop and .appdata files

Fixes https://github.com/libratbag/piper/issues/257
This commit is contained in:
Piotr Drąg
2018-09-12 19:08:45 +02:00
committed by Jente Hidskes
parent cc59902a65
commit 6fc487aedf
7 changed files with 34 additions and 16 deletions

View File

@@ -20,10 +20,22 @@ gnome.compile_resources('piper', 'piper.gresource.xml',
install: true,
install_dir: pkgdatadir)
install_data('org.freedesktop.Piper.desktop', install_dir: desktopdir)
install_data('org.freedesktop.Piper.svg', install_dir: icondir)
appdata = configure_file(input: 'org.freedesktop.Piper.appdata.xml.in',
output: 'org.freedesktop.Piper.appdata.xml',
configuration: conf,
install_dir: metainfodir)
i18n.merge_file(input: 'org.freedesktop.Piper.desktop.in',
output: 'org.freedesktop.Piper.desktop',
type: 'desktop',
po_dir: podir,
install: true,
install_dir: desktopdir)
appdata = configure_file(input: 'org.freedesktop.Piper.appdata.xml.in.in',
output: 'org.freedesktop.Piper.appdata.xml.in',
configuration: conf)
i18n.merge_file(input: appdata,
output: 'org.freedesktop.Piper.appdata.xml',
type: 'xml',
po_dir: podir,
install: true,
install_dir: metainfodir)

View File

@@ -1,9 +0,0 @@
[Desktop Entry]
Name=Piper
Comment=Configurable mouse configuration utility
Exec=piper
Icon=org.freedesktop.Piper
Type=Application
StartupNotify=true
Categories=GTK;GNOME;Utility;
Keywords=gaming;configuration;mouse;mice;

View File

@@ -0,0 +1,11 @@
[Desktop Entry]
Name=Piper
Comment=Configurable mouse configuration utility
Exec=piper
# Translators: Do NOT translate or transliterate this text (this is an icon file name)!
Icon=org.freedesktop.Piper
Type=Application
StartupNotify=true
Categories=GTK;GNOME;Utility;
# Translators: Search terms to find this application. Do NOT translate or localize the semicolons! The list MUST also end with a semicolon!
Keywords=gaming;configuration;mouse;mice;

View File

@@ -45,6 +45,9 @@ datadir = join_paths(prefix, get_option('datadir'))
localedir = join_paths(prefix, get_option('localedir'))
pkgdatadir = join_paths(datadir, meson.project_name())
bindir = join_paths(prefix, get_option('bindir'))
podir = join_paths(meson.source_root(), 'po')
i18n = import('i18n')
subdir('data')
subdir('po')

View File

@@ -1,3 +1,6 @@
data/org.freedesktop.Piper.desktop.in
data/org.freedesktop.Piper.appdata.xml.in.in
piper/__init__.py
piper/application.py
piper/buttondialog.py

View File

@@ -1,3 +1 @@
i18n = import('i18n')
i18n.gettext('piper', preset: 'glib')