]> git.saurik.com Git - apt.git/commitdiff
CMake: Translations: Add a statistics target
authorJulian Andres Klode <jak@debian.org>
Tue, 9 Aug 2016 09:58:28 +0000 (11:58 +0200)
committerJulian Andres Klode <jak@debian.org>
Wed, 10 Aug 2016 14:11:09 +0000 (16:11 +0200)
This is really useful stuff to have.

Gbp-Dch: ignore

CMake/Translations.cmake
po/CMakeLists.txt

index 6a986200510aa0803937561ad46c07d090f53c90..8b657c20fe950e2ddce66edb7fef3c26ea1c674f 100644 (file)
@@ -142,3 +142,17 @@ function(apt_add_update_po)
     endforeach()
     add_dependencies(update-po nls-${master_name})
 endfunction()
+
+function(apt_add_po_statistics)
+    add_custom_target(statistics)
+    file(GLOB translations "${PROJECT_SOURCE_DIR}/po/*.po")
+    foreach(translation ${translations})
+            get_filename_component(langcode ${translation} NAME_WE)
+            add_custom_command(
+                TARGET statistics PRE_BUILD
+                COMMAND printf "%-7s" "${langcode}:"
+                COMMAND msgfmt --statistics -o /dev/null ${translation}
+                VERBATIM
+            )
+    endforeach()
+endfunction()
index 4fdac3959b50d8b180534e8b0e32099075d28a15..92ff39867ae0bb39c18717004fff1555501d18a1 100644 (file)
@@ -36,3 +36,5 @@ apt_add_update_po(
         apt
         apt-utils
 )
+
+apt_add_po_statistics()