Browse Source

CMake: Translations: Pass some additional arguments to commands

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
Julian Andres Klode 10 years ago
parent
commit
672aa8d90e
1 changed files with 2 additions and 1 deletions
  1. 2 1
      CMake/Translations.cmake

+ 2 - 1
CMake/Translations.cmake

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