summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJulian Andres Klode <jak@debian.org>2017-11-19 23:13:30 +0100
committerJulian Andres Klode <jak@debian.org>2017-11-20 21:48:30 +0100
commitdfb4c178b4f6a7db255cbc7dc2b162721d807b58 (patch)
tree1d0e16dda35f36be576d2c6a09c78277f77c663d
parent871f3346ea601b444eb8f487836a73d219766e0b (diff)
Translate shared documentation parts again
We accidentally did not translate the entity file, but should have. This makes apt.ent translatable again. This generates the target multiple times, but surprisingly, that works just fine, so let's just keep it that way, as it's clean code otherwise.
-rw-r--r--CMake/Documentation.cmake31
-rw-r--r--doc/CMakeLists.txt8
2 files changed, 29 insertions, 10 deletions
diff --git a/CMake/Documentation.cmake b/CMake/Documentation.cmake
index f3bbfdc6b..d8a2d2c9d 100644
--- a/CMake/Documentation.cmake
+++ b/CMake/Documentation.cmake
@@ -89,12 +89,18 @@ endfunction()
# Process one document
function(po4a_one stamp_out out full_document language deps)
path_join(full_path "${CMAKE_CURRENT_SOURCE_DIR}" "${full_document}")
- po4a_components(document _ section ext "${full_document}")
+ if (full_document MATCHES "\.ent$")
+ set(dest "${language}/${full_document}")
+ set(full_dest "${dest}")
+ else()
+ po4a_components(document _ section ext "${full_document}")
- # Calculate target file name
- set(dest "${language}/${document}.${language}")
- if(section)
- set(dest "${dest}.${section}")
+ # Calculate target file name
+ set(dest "${language}/${document}.${language}")
+ if(section)
+ set(dest "${dest}.${section}")
+ endif()
+ set(full_dest "${dest}.${ext}")
endif()
# po4a might drop files not translated enough, so build a stamp file
@@ -106,17 +112,17 @@ function(po4a_one stamp_out out full_document language deps)
--package-name='${PROJECT_NAME}-doc'
--package-version='${PACKAGE_VERSION}'
--msgid-bugs-address='${PACKAGE_MAIL}'
- --translate-only ${dest}.${ext}
+ --translate-only ${full_dest}
--srcdir ${CMAKE_CURRENT_SOURCE_DIR}
--destdir ${CMAKE_CURRENT_BINARY_DIR}
${CMAKE_CURRENT_SOURCE_DIR}/po4a.conf
COMMAND ${CMAKE_COMMAND} -E touch ${stamp}
- COMMENT "Generating ${dest}.${ext} (or dropping it)"
+ COMMENT "Generating ${full_dest} (or dropping it)"
DEPENDS ${full_document} ${deps} po/${language}.po
)
# Return result
set(${stamp_out} ${stamp} PARENT_SCOPE)
- set(${out} ${CMAKE_CURRENT_BINARY_DIR}/${dest}.${ext} PARENT_SCOPE)
+ set(${out} ${CMAKE_CURRENT_BINARY_DIR}/${full_dest} PARENT_SCOPE)
endfunction()
function(xsltproc_one)
@@ -251,7 +257,7 @@ function(add_docbook target)
set(generated "")
set(options HTML TEXT MANPAGE ALL)
set(oneValueArgs)
- set(multiValueArgs INSTALL DOCUMENTS LINGUAS DEPENDS)
+ set(multiValueArgs INSTALL DOCUMENTS LINGUAS TRANSLATED_ENTITIES DEPENDS)
cmake_parse_arguments(DOC "${options}" "${oneValueArgs}" "${multiValueArgs}" ${ARGN})
if (DOC_HTML)
@@ -264,6 +270,13 @@ function(add_docbook target)
list(APPEND formats MANPAGE)
endif()
+ foreach(document ${DOC_TRANSLATED_ENTITIES})
+ foreach(lang ${DOC_LINGUAS})
+ po4a_one(po4a_stamp po4a_out ${document} "${lang}" "")
+ list(APPEND DOC_DEPENDS ${po4a_stamp})
+ endforeach()
+ endforeach()
+
foreach(document ${DOC_DOCUMENTS})
foreach(lang ${DOC_LINGUAS})
po4a_one(po4a_stamp po4a_out ${document} "${lang}" "${DOC_DEPENDS}")
diff --git a/doc/CMakeLists.txt b/doc/CMakeLists.txt
index d7241eb5e..73d808c64 100644
--- a/doc/CMakeLists.txt
+++ b/doc/CMakeLists.txt
@@ -12,8 +12,11 @@ set(LINGUAS
pt
)
-set(ENTITIES
+set(TRANSLATED_ENTITIES
apt.ent
+)
+
+set(ENTITIES
apt-verbatim.ent
../vendor/${CURRENT_VENDOR}/apt-vendor.ent
)
@@ -25,6 +28,7 @@ add_docbook(apt-doc HTML TEXT ALL
offline.dbk
INSTALL ${CMAKE_INSTALL_DOCDIR}/../apt-doc
LINGUAS ${LINGUAS}
+ TRANSLATED_ENTITIES ${TRANSLATED_ENTITIES}
DEPENDS ${ENTITIES}
)
@@ -36,6 +40,7 @@ add_docbook(libapt-pkg-doc HTML TEXT ALL
method.dbk
INSTALL ${CMAKE_INSTALL_DOCDIR}/../libapt-pkg-doc
LINGUAS ${LINGUAS}
+ TRANSLATED_ENTITIES ${TRANSLATED_ENTITIES}
DEPENDS ${ENTITIES}
)
@@ -81,6 +86,7 @@ add_docbook(apt-man MANPAGE ALL
apt-sortpkgs.1.xml
sources.list.5.xml
DEPENDS ${ENTITIES}
+ TRANSLATED_ENTITIES ${TRANSLATED_ENTITIES}
LINGUAS ${LINGUAS}
)