summaryrefslogtreecommitdiff
path: root/CMake/Translations.cmake
diff options
context:
space:
mode:
authorJulian Andres Klode <jak@debian.org>2016-08-09 11:58:28 +0200
committerJulian Andres Klode <jak@debian.org>2016-08-10 16:11:09 +0200
commitddf40a42f5a699086466990f85d86e6c4977524a (patch)
treeb9a35cc1f84674ff3e87acf53eedf6e7f819ca64 /CMake/Translations.cmake
parent9a5537fcc6d3ea98909360636a45bd3cf3aba1d1 (diff)
CMake: Translations: Add a statistics target
This is really useful stuff to have. Gbp-Dch: ignore
Diffstat (limited to 'CMake/Translations.cmake')
-rw-r--r--CMake/Translations.cmake14
1 files changed, 14 insertions, 0 deletions
diff --git a/CMake/Translations.cmake b/CMake/Translations.cmake
index 6a9862005..8b657c20f 100644
--- a/CMake/Translations.cmake
+++ b/CMake/Translations.cmake
@@ -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()