From e2ed9308c8284235480571652ac748715f869431 Mon Sep 17 00:00:00 2001 From: Alexander Mikhaylenko Date: Thu, 23 Aug 2018 23:13:14 +0500 Subject: [PATCH] build: Translate desktop and appdata files While their strings are translated, they are installed as is, and appear untranslated. --- fractal-gtk/res/meson.build | 19 +++++++++++++++++-- ...a.xml => org.gnome.Fractal.appdata.xml.in} | 0 ...l.desktop => org.gnome.Fractal.desktop.in} | 0 meson.build | 2 ++ scripts/new-release.sh | 2 +- 5 files changed, 20 insertions(+), 3 deletions(-) rename fractal-gtk/res/{org.gnome.Fractal.appdata.xml => org.gnome.Fractal.appdata.xml.in} (100%) rename fractal-gtk/res/{org.gnome.Fractal.desktop => org.gnome.Fractal.desktop.in} (100%) diff --git a/fractal-gtk/res/meson.build b/fractal-gtk/res/meson.build index 6635e3d7..d05bcec6 100644 --- a/fractal-gtk/res/meson.build +++ b/fractal-gtk/res/meson.build @@ -1,5 +1,20 @@ subdir('icons') -install_data('org.gnome.Fractal.desktop', install_dir : datadir + '/applications') -install_data('org.gnome.Fractal.appdata.xml', install_dir : datadir + '/appdata') +i18n.merge_file ('desktop-file', + type: 'desktop', + input: 'org.gnome.Fractal.desktop.in', + output: 'org.gnome.Fractal.desktop', + po_dir: podir, + install: true, + install_dir: join_paths (datadir, 'applications') +) + +i18n.merge_file ('appdata-file', + input: 'org.gnome.Fractal.appdata.xml.in', + output: 'org.gnome.Fractal.appdata.xml', + po_dir: podir, + install: true, + install_dir: join_paths (datadir, 'appdata') +) + install_data('org.gnome.Fractal.gschema.xml', install_dir: join_paths(get_option('datadir'), 'glib-2.0', 'schemas')) diff --git a/fractal-gtk/res/org.gnome.Fractal.appdata.xml b/fractal-gtk/res/org.gnome.Fractal.appdata.xml.in similarity index 100% rename from fractal-gtk/res/org.gnome.Fractal.appdata.xml rename to fractal-gtk/res/org.gnome.Fractal.appdata.xml.in diff --git a/fractal-gtk/res/org.gnome.Fractal.desktop b/fractal-gtk/res/org.gnome.Fractal.desktop.in similarity index 100% rename from fractal-gtk/res/org.gnome.Fractal.desktop rename to fractal-gtk/res/org.gnome.Fractal.desktop.in diff --git a/meson.build b/meson.build index 6137b2b5..4644dffe 100644 --- a/meson.build +++ b/meson.build @@ -19,6 +19,8 @@ icondir = join_paths(datadir, 'icons') i18n = import('i18n') +podir = join_paths (meson.source_root (), 'fractal-gtk', 'po') + subdir('fractal-gtk/po') subdir('fractal-gtk/res') diff --git a/scripts/new-release.sh b/scripts/new-release.sh index cabee213..fc2189b5 100755 --- a/scripts/new-release.sh +++ b/scripts/new-release.sh @@ -24,7 +24,7 @@ esac sed -i "s/$current/$next/" meson.build sed -i "s/$current/$next/" fractal-gtk/Cargo.toml sed -i "s/$current/$next/" fractal-matrix-api/Cargo.toml -sed -i "s/version=\"$current\".*/version=\"$next\" date=\"$(date +%Y-%m-%d)\"\/>/" fractal-gtk/res/org.gnome.Fractal.appdata.xml +sed -i "s/version=\"$current\".*/version=\"$next\" date=\"$(date +%Y-%m-%d)\"\/>/" fractal-gtk/res/org.gnome.Fractal.appdata.xml.in cargo check