[cheese] build: Migrate from Intltool to Gettext



commit f4fe90e3902ef7be09fa18f95cd13983489c485d
Author: Iñigo Martínez <inigomartinez gmail com>
Date:   Mon Jul 29 22:58:05 2019 +0200

    build: Migrate from Intltool to Gettext
    
    Recent versions of Gettext are able to translate several formats
    that are used in GNOME applications.
    
    The use of Intltool in Cheese has been replaced by Gettext.

 data/meson.build                     |  9 +++++----
 data/org.gnome.Cheese.appdata.xml.in | 16 ++++++++--------
 data/org.gnome.Cheese.desktop.in     |  8 ++++----
 meson.build                          |  5 -----
 po/POTFILES.in                       | 13 ++++++-------
 5 files changed, 23 insertions(+), 28 deletions(-)
---
diff --git a/data/meson.build b/data/meson.build
index aa5acbdb..34e669da 100644
--- a/data/meson.build
+++ b/data/meson.build
@@ -22,22 +22,23 @@ resource_sources = gnome.compile_resources(
 
 desktop = cheese_namespace + '.desktop'
 
-custom_target(
+i18n.merge_file(
   desktop,
+  type: 'desktop',
   input: desktop + '.in',
   output: '@BASENAME@',
-  command: intltool_desktop_cmd,
+  po_dir: po_dir,
   install: true,
   install_dir: cheese_datadir / 'applications',
 )
 
 appdata = cheese_namespace + '.appdata.xml'
 
-custom_target(
+i18n.merge_file(
   appdata,
   input: appdata + '.in',
   output: '@BASENAME@',
-  command: intltool_xml_cmd,
+  po_dir: po_dir,
   install: true,
   install_dir: cheese_datadir / 'metainfo',
 )
diff --git a/data/org.gnome.Cheese.appdata.xml.in b/data/org.gnome.Cheese.appdata.xml.in
index e8dc6545..19c7b5d7 100644
--- a/data/org.gnome.Cheese.appdata.xml.in
+++ b/data/org.gnome.Cheese.appdata.xml.in
@@ -6,24 +6,24 @@
   <project_license>GPL-2.0+</project_license>
 
   <!-- Both taken from the desktop file. -->
-  <_name>Cheese</_name>
-  <_summary>Take photos and videos with your webcam, with fun graphical effects</_summary>
+  <name>Cheese</name>
+  <summary>Take photos and videos with your webcam, with fun graphical effects</summary>
   <description>
-    <_p>
+    <p>
       Cheese uses your webcam to take photos and videos, applies fancy
       special effects and lets you share the fun with others.
-    </_p>
-    <_p>
+    </p>
+    <p>
       Take multiple photos in quick succession with burst mode.
       Use the countdown to give yourself time to strike a pose, and wait for the
       flash!
-    </_p>
-    <_p>
+    </p>
+    <p>
       Under the hood, Cheese uses GStreamer to apply fancy effects to
       photos and videos.
       With Cheese it is easy to take photos of you, your friends, pets or
       whatever you want and share them with others.
-    </_p>
+    </p>
   </description>
   <url type="homepage">https://wiki.gnome.org/Apps/Cheese</url>
   <url type="bugtracker">https://bugzilla.gnome.org/enter_bug.cgi?product=cheese</url>
diff --git a/data/org.gnome.Cheese.desktop.in b/data/org.gnome.Cheese.desktop.in
index 63ea4d5e..db420143 100644
--- a/data/org.gnome.Cheese.desktop.in
+++ b/data/org.gnome.Cheese.desktop.in
@@ -1,8 +1,8 @@
 [Desktop Entry]
-_Name=Cheese
-_GenericName=Webcam Booth
-_Comment=Take photos and videos with your webcam, with fun graphical effects
-_Keywords=photo;video;webcam;
+Name=Cheese
+GenericName=Webcam Booth
+Comment=Take photos and videos with your webcam, with fun graphical effects
+Keywords=photo;video;webcam;
 Exec=cheese
 Terminal=false
 Type=Application
diff --git a/meson.build b/meson.build
index 0265a019..98b1d9a9 100644
--- a/meson.build
+++ b/meson.build
@@ -53,11 +53,6 @@ source_root = meson.current_source_dir()
 po_dir = source_root / 'po'
 vapi_dir = source_root / 'src/vapi'
 
-intltool_merge = find_program('intltool-merge')
-intltool_cache = po_dir / '.intltool-merge-cache'
-intltool_desktop_cmd = [intltool_merge, '-d', '-u', '-c', intltool_cache, po_dir, '@INPUT@', '@OUTPUT@']
-intltool_xml_cmd = [intltool_merge, '-x', '-u', '-c', intltool_cache, po_dir, '@INPUT@', '@OUTPUT@']
-
 top_inc = include_directories('.')
 
 cc = meson.get_compiler('c')
diff --git a/po/POTFILES.in b/po/POTFILES.in
index 16d5c97a..4e0b0874 100644
--- a/po/POTFILES.in
+++ b/po/POTFILES.in
@@ -1,14 +1,13 @@
 # List of source files containing translatable strings.
 # Please keep this file sorted alphabetically.
-[encoding: UTF-8]
-[type: gettext/glade]data/cheese-main-window.ui
-[type: gettext/glade]data/cheese-prefs.ui
-[type: gettext/glade]data/headerbar.ui
-[type: gettext/glade]data/menus.ui
-[type: gettext/glade]data/shortcuts.ui
+data/cheese-main-window.ui
+data/cheese-prefs.ui
+data/headerbar.ui
+data/menus.ui
 data/org.gnome.Cheese.appdata.xml.in
 data/org.gnome.Cheese.desktop.in
-[type: gettext/gsettings]data/org.gnome.Cheese.gschema.xml
+data/org.gnome.Cheese.gschema.xml
+data/shortcuts.ui
 libcheese/cheese-avatar-chooser.c
 libcheese/cheese-avatar-widget.c
 libcheese/cheese-camera.c


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