[file-roller] meson: updated the POTFILES.in creation script



commit 5433fd9e316514cba34afa4be5d42d815c6a9618
Author: Paolo Bacchilega <paobac src gnome org>
Date:   Tue Oct 24 18:07:27 2017 +0200

    meson: updated the POTFILES.in creation script

 po/POTFILES.in         |   51 +++++++++++++++++++++++------------------------
 po/make-potfiles-in.py |   44 +++++++++++++++++++++++++++++++++++++++++
 po/update-potfiles.sh  |   18 ----------------
 3 files changed, 69 insertions(+), 44 deletions(-)
---
diff --git a/po/POTFILES.in b/po/POTFILES.in
index 844d3dc..7c54772 100644
--- a/po/POTFILES.in
+++ b/po/POTFILES.in
@@ -2,11 +2,10 @@
 #
 # DO NOT EDIT.  This file is automatically generated, to
 # update the content run the following command:
-# sh update-potfiles.sh > POTFILES.in
-[encoding: UTF-8]
+# ./make-potfiles-in.py > POTFILES.in
 data/org.gnome.FileRoller.appdata.xml.in
 data/org.gnome.FileRoller.desktop.in.in
-[type: gettext/gsettings]data/org.gnome.FileRoller.gschema.xml
+data/org.gnome.FileRoller.gschema.xml
 nautilus/fileroller-module.c
 nautilus/nautilus-fileroller.c
 nautilus/nautilus-fileroller.h
@@ -38,14 +37,14 @@ src/file-data.c
 src/file-data.h
 src/file-utils.c
 src/file-utils.h
-src/fr-application.c
-src/fr-application.h
 src/fr-application-menu.c
 src/fr-application-menu.h
-src/fr-archive.c
-src/fr-archive.h
+src/fr-application.c
+src/fr-application.h
 src/fr-archive-libarchive.c
 src/fr-archive-libarchive.h
+src/fr-archive.c
+src/fr-archive.h
 src/fr-command-7z.c
 src/fr-command-7z.h
 src/fr-command-ace.c
@@ -56,14 +55,12 @@ src/fr-command-ar.c
 src/fr-command-ar.h
 src/fr-command-arj.c
 src/fr-command-arj.h
-src/fr-command.c
 src/fr-command-cfile.c
 src/fr-command-cfile.h
 src/fr-command-cpio.c
 src/fr-command-cpio.h
 src/fr-command-dpkg.c
 src/fr-command-dpkg.h
-src/fr-command.h
 src/fr-command-iso.c
 src/fr-command-iso.h
 src/fr-command-jar.c
@@ -88,6 +85,8 @@ src/fr-command-zip.c
 src/fr-command-zip.h
 src/fr-command-zoo.c
 src/fr-command-zoo.h
+src/fr-command.c
+src/fr-command.h
 src/fr-error.c
 src/fr-error.h
 src/fr-file-selector-dialog.c
@@ -128,20 +127,20 @@ src/rar-utils.c
 src/rar-utils.h
 src/test-server.c
 src/typedefs.h
-[type: gettext/glade]src/ui/add-dialog-options.ui
-[type: gettext/glade]src/ui/add-options.ui
-[type: gettext/glade]src/ui/app-menubar.ui
-[type: gettext/glade]src/ui/app-menu.ui
-[type: gettext/glade]src/ui/ask-password.ui
-[type: gettext/glade]src/ui/delete.ui
-[type: gettext/glade]src/ui/extract-dialog-options.ui
-[type: gettext/glade]src/ui/file-selector.ui
-[type: gettext/glade]src/ui/gears-menu.ui
-[type: gettext/glade]src/ui/menus-toolbars.ui
-[type: gettext/glade]src/ui/menus.ui
-[type: gettext/glade]src/ui/new-archive-dialog.ui
-[type: gettext/glade]src/ui/password.ui
-[type: gettext/glade]src/ui/progress-dialog.ui
-[type: gettext/glade]src/ui/properties.ui
-[type: gettext/glade]src/ui/request-dialog.ui
-[type: gettext/glade]src/ui/update.ui
+src/ui/add-dialog-options.ui
+src/ui/add-options.ui
+src/ui/app-menu.ui
+src/ui/app-menubar.ui
+src/ui/ask-password.ui
+src/ui/delete.ui
+src/ui/extract-dialog-options.ui
+src/ui/file-selector.ui
+src/ui/gears-menu.ui
+src/ui/menus-toolbars.ui
+src/ui/menus.ui
+src/ui/new-archive-dialog.ui
+src/ui/password.ui
+src/ui/progress-dialog.ui
+src/ui/properties.ui
+src/ui/request-dialog.ui
+src/ui/update.ui
diff --git a/po/make-potfiles-in.py b/po/make-potfiles-in.py
new file mode 100755
index 0000000..dffe4a3
--- /dev/null
+++ b/po/make-potfiles-in.py
@@ -0,0 +1,44 @@
+#!/usr/bin/env python3
+
+import os
+import re
+
+root_dir = '..'
+valid_extensions = [ 
+    '.c', 
+    '.h', 
+    '.cpp', 
+    '.ui', 
+    '.gschema.xml', 
+    '.schemas.in', 
+    '.xml.in', 
+    '.desktop.in.in', 
+    '.extension.in.in' 
+]
+prefix_for_ext = {
+    '.ui'              : '[type: gettext/glade]',
+    '.extension.in.in' : '[type: gettext/ini]',
+    '.gschema.xml'     : '[type: gettext/gsettings]'
+}
+
+print("# List of source files which contain translatable strings.")
+print("#")
+print("# DO NOT EDIT.  This file is automatically generated, to")
+print("# update the content run the following command:")
+print("# ./make-potfiles-in.py > POTFILES.in")
+#print("[encoding: UTF-8]")
+
+all_files = []
+for root, dirs, files in os.walk(root_dir):
+    all_files += map(lambda file: os.path.join(root, file), files)
+    
+for file in sorted(all_files):
+    # ignore the build directory   
+    if 'build' in file:
+        continue
+    
+    for ext in valid_extensions:
+        if file.endswith(ext):        
+            prefix = ''#prefix_for_ext.get(ext, '')
+            file = os.path.relpath(file, root_dir)
+            print("{0}{1}".format(prefix, file)) 


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