[eog: 10/11] build: Use i18n.merge_file for plugin files




commit e1e6a83a7cb6fba06c7b486898154dd599d0b7c5
Author: Iñigo Martínez <inigomartinez gmail com>
Date:   Wed Oct 27 12:14:26 2021 +0200

    build: Use i18n.merge_file for plugin files
    
    There is no support for plugins in gettext[0] so extra keywords must
    be added when translating `.plugin` files. However, we can use extra
    parameters to use `i18n.merge_file`
    
    There is also no need to use the `.desktop` extension anymore.
    
    [0] http://lists.gnu.org/archive/html/bug-gettext/2017-06/msg00001.html

 ...reen.plugin.desktop.in => fullscreen.plugin.in} |  0
 plugins/meson.build                                | 25 ++++++----------------
 .../{reload.plugin.desktop.in => reload.plugin.in} |  0
 ....plugin.desktop.in => statusbar-date.plugin.in} |  0
 4 files changed, 7 insertions(+), 18 deletions(-)
---
diff --git a/plugins/fullscreen/fullscreen.plugin.desktop.in b/plugins/fullscreen/fullscreen.plugin.in
similarity index 100%
rename from plugins/fullscreen/fullscreen.plugin.desktop.in
rename to plugins/fullscreen/fullscreen.plugin.in
diff --git a/plugins/meson.build b/plugins/meson.build
index 18a25a56..fea407a5 100644
--- a/plugins/meson.build
+++ b/plugins/meson.build
@@ -1,13 +1,3 @@
-msgfmt_plugin_cmd = [
-  find_program('msgfmt'),
-  '--desktop',
-  '--keyword=Name',
-  '--keyword=Description',
-  '--template=@INPUT@',
-  '-d', po_dir,
-  '--output=@OUTPUT@',
-]
-
 plugins = [
   'fullscreen',
   'reload',
@@ -27,15 +17,14 @@ foreach plugin: plugins
     install_dir: eog_pluginsdir,
   )
 
-  plugin_data = f'@plugin@.plugin'
-
-  # FIXME: Move custom_target to i18n.merge_file when gettext acquires plugin support.
+  # FIXME: Remove `args` parameter when gettext acquires plugin support.
   #        http://lists.gnu.org/archive/html/bug-gettext/2017-06/msg00001.html
-  custom_target(
-    plugin_data,
-    input: f'@plugin@/@plugin_data  desktop in',
-    output: plugin_data,
-    command: msgfmt_plugin_cmd,
+  i18n.merge_file(
+    input: f'@plugin@/@plugin  plugin in',
+    output: '@BASENAME@',
+    po_dir: po_dir,
+    type: 'desktop',
+    args: ['--keyword=Name', '--keyword=Description'],
     install: true,
     install_dir: eog_pluginsdir,
   )
diff --git a/plugins/reload/reload.plugin.desktop.in b/plugins/reload/reload.plugin.in
similarity index 100%
rename from plugins/reload/reload.plugin.desktop.in
rename to plugins/reload/reload.plugin.in
diff --git a/plugins/statusbar-date/statusbar-date.plugin.desktop.in 
b/plugins/statusbar-date/statusbar-date.plugin.in
similarity index 100%
rename from plugins/statusbar-date/statusbar-date.plugin.desktop.in
rename to plugins/statusbar-date/statusbar-date.plugin.in


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]