[gnome-terminal/wip/inigomartinez/gettext: 52/52] build: Migrate from Intltool to Gettext



commit bb2d417efcdd86274b47ce7727fc0ca37d949388
Author: Iñigo Martínez <inigomartinez gmail com>
Date:   Thu Jan 24 12:54:04 2019 +0100

    build: Migrate from Intltool to Gettext
    
    Recent versions of Gettext are able to translate several formats
    that are used in GNOME applications. This patch migrates from
    Intltool to Gettext using meson's i18n capabilities.

 meson.build                                 | 18 +++++++-----------
 org.gnome.Terminal.Nautilus.metainfo.xml.in |  6 +++---
 org.gnome.Terminal.appdata.xml.in           |  8 ++++----
 org.gnome.Terminal.desktop.in.in            | 12 +++++++-----
 po/POTFILES.in                              | 13 ++++++-------
 5 files changed, 27 insertions(+), 30 deletions(-)
---
diff --git a/meson.build b/meson.build
index e33b0d5a..d469cb08 100644
--- a/meson.build
+++ b/meson.build
@@ -35,11 +35,6 @@ source_root = meson.current_source_dir()
 
 po_dir = source_root / 'po'
 
-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')
@@ -170,11 +165,11 @@ if enable_nautilus_extension
 
   appdata = gt_iface_name + '.Nautilus.metainfo.xml'
 
-  custom_target(
+  i18n.merge_file(
     appdata,
     input: appdata + '.in',
     output: '@BASENAME@',
-    command: intltool_xml_cmd,
+    po_dir: po_dir,
     install: true,
     install_dir: gt_datadir / 'metainfo',
   )
@@ -196,22 +191,23 @@ desktop_in = configure_file(
   configuration: desktop_conf,
 )
 
-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: gt_datadir / 'applications',
 )
 
 appdata = gt_iface_name + '.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: gt_datadir / 'metainfo',
 )
diff --git a/org.gnome.Terminal.Nautilus.metainfo.xml.in b/org.gnome.Terminal.Nautilus.metainfo.xml.in
index f9b17064..24aa1018 100644
--- a/org.gnome.Terminal.Nautilus.metainfo.xml.in
+++ b/org.gnome.Terminal.Nautilus.metainfo.xml.in
@@ -36,10 +36,10 @@
   <extends>org.gnome.Nautilus.desktop</extends>
   <metadata_license>GPL-3.0+ or GFDL-1.3-only</metadata_license>
   <project_license>GPL-3.0+</project_license>
-  <_name>Terminal plugin for Files</_name>
-  <_summary>Open a terminal from Files</_summary>
+  <name>Terminal plugin for Files</name>
+  <summary>Open a terminal from Files</summary>
   <description>
-    <_p>Open Terminal is a plugin for the Files application that adds a menu item to the context menu to 
open a terminal in the currently browsed directory.</_p>
+    <p>Open Terminal is a plugin for the Files application that adds a menu item to the context menu to open 
a terminal in the currently browsed directory.</p>
   </description>
   <url type="homepage">https://wiki.gnome.org/Apps/Terminal</url>
   <project_group>GNOME</project_group>
diff --git a/org.gnome.Terminal.appdata.xml.in b/org.gnome.Terminal.appdata.xml.in
index 31aaa302..b411ccdd 100644
--- a/org.gnome.Terminal.appdata.xml.in
+++ b/org.gnome.Terminal.appdata.xml.in
@@ -35,11 +35,11 @@
   <id>org.gnome.Terminal.desktop</id>
   <metadata_license>GPL-3.0+ or GFDL-1.3-only</metadata_license>
   <project_license>GPL-3.0+</project_license>
-  <_name>Terminal</_name>
-  <_summary>Use the command line</_summary>
+  <name>Terminal</name>
+  <summary>Use the command line</summary>
   <description>
-    <_p>GNOME Terminal is a terminal emulator application for accessing a UNIX shell environment which can 
be used to run programs available on your system.</_p>
-    <_p>It supports several profiles, multiple tabs and implements several keyboard shortcuts.</_p>
+    <p>GNOME Terminal is a terminal emulator application for accessing a UNIX shell environment which can be 
used to run programs available on your system.</p>
+    <p>It supports several profiles, multiple tabs and implements several keyboard shortcuts.</p>
   </description>
   <screenshots>
     <screenshot 
type="default">https://help.gnome.org/users/gnome-terminal/stable/figures/gnome-terminal.png</screenshot>
diff --git a/org.gnome.Terminal.desktop.in.in b/org.gnome.Terminal.desktop.in.in
index ae18a544..7edabe73 100644
--- a/org.gnome.Terminal.desktop.in.in
+++ b/org.gnome.Terminal.desktop.in.in
@@ -1,10 +1,12 @@
 [Desktop Entry]
 # VERSION=@VERSION@
-_Name=Terminal
-_Comment=Use the command line
-_Keywords=shell;prompt;command;commandline;cmd;
+Name=Terminal
+Comment=Use the command line
+# Translators: Search terms to find this application. Do NOT translate or localize the semicolons! The list 
MUST also end with a semicolon!
+Keywords=shell;prompt;command;commandline;cmd;
 TryExec=gnome-terminal
 Exec=gnome-terminal
+# Translators: Do NOT translate or transliterate this text (this is an icon file name)!
 Icon=org.gnome.Terminal
 Type=Application
 Categories=GNOME;GTK;System;TerminalEmulator;
@@ -13,9 +15,9 @@ X-GNOME-SingleWindow=false
 Actions=new-window;preferences;
 
 [Desktop Action new-window]
-_Name=New Window
+Name=New Window
 Exec=gnome-terminal --window
 
 [Desktop Action preferences]
-_Name=Preferences
+Name=Preferences
 Exec=gnome-terminal --preferences
diff --git a/po/POTFILES.in b/po/POTFILES.in
index fa872e50..dd126b76 100644
--- a/po/POTFILES.in
+++ b/po/POTFILES.in
@@ -1,27 +1,26 @@
-[encoding: UTF-8]
 # List of source files containing translatable strings.
 # Please keep this file sorted alphabetically.
 org.gnome.Terminal.appdata.xml.in
 org.gnome.Terminal.Nautilus.metainfo.xml.in
 org.gnome.Terminal.desktop.in.in
 src/org.gnome.Terminal.gschema.xml
-[type: gettext/glade]src/preferences.ui
+src/preferences.ui
 src/profile-editor.c
-[type: gettext/glade]src/search-popover.ui
+src/search-popover.ui
 src/server.c
 src/terminal-accels.c
 src/terminal-app.c
 src/terminal.c
 src/terminal-encoding.c
-[type: gettext/glade]src/terminal-headerbar.ui
-[type: gettext/glade]src/terminal-headermenu.ui
+src/terminal-headerbar.ui
+src/terminal-headermenu.ui
 src/terminal-headerbar.c
 src/terminal-mdi-container.c
-[type: gettext/glade]src/terminal-menubar.ui.in
+src/terminal-menubar.ui.in
 src/terminal-menu-button.c
 src/terminal-nautilus.c
 src/terminal-notebook.c
-[type: gettext/glade]src/terminal-notebook-menu.ui
+src/terminal-notebook-menu.ui
 src/terminal-options.c
 src/terminal-prefs.c
 src/terminal-screen.c


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