]> git.saurik.com Git - apt.git/commitdiff
CMake: Translations: Pass some additional arguments to commands
authorJulian Andres Klode <jak@debian.org>
Sun, 7 Aug 2016 11:37:15 +0000 (13:37 +0200)
committerJulian Andres Klode <jak@debian.org>
Wed, 10 Aug 2016 14:11:00 +0000 (16:11 +0200)
This gets rid of the line numbers, adds the plural keyword,
and makes msgfmt print statistics, so we know how well translated
we are.

Gbp-Dch: ignore

CMake/Translations.cmake

index 3a05d80b0b3fe76aad2fb13e998d0b6daeed6816..64f5886fbaea223e89b2cafb2b31c941bf1316ea 100644 (file)
@@ -28,6 +28,7 @@ function(apt_add_translation_domain domain)
     # Create the template for this specific sub-domain
     add_custom_command (OUTPUT ${PROJECT_BINARY_DIR}/${domain}.pot
         COMMAND xgettext --add-comments --foreign -k_ -kN_
+                         --add-location=file --keyword=P_:1,2
                          -o ${PROJECT_BINARY_DIR}/${domain}.pot ${files}
         DEPENDS ${abs_files}
         WORKING_DIRECTORY ${PROJECT_SOURCE_DIR}
@@ -43,7 +44,7 @@ function(apt_add_translation_domain domain)
         # Command to merge and compile the messages
         add_custom_command(OUTPUT ${outdir}/${domain}.mo
             COMMAND msgmerge -qo - ${file} ${PROJECT_BINARY_DIR}/${domain}.pot |
-                    msgfmt -o ${outdir}/${domain}.mo -
+                    msgfmt --statistics -o ${outdir}/${domain}.mo -
             DEPENDS ${file} ${PROJECT_BINARY_DIR}/${domain}.pot
         )