Set up infrastructure for localized man pages

PR #19515.
This commit is contained in:
Victor Chernyakin 2023-09-02 11:38:37 -07:00 committed by GitHub
parent 145971b915
commit 2dc1a7d66f
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
10 changed files with 42 additions and 9 deletions

View File

@ -18,17 +18,20 @@ if (SYSTEMD)
)
endif()
if (GUI)
list(APPEND MAN_FILES ${PROJECT_SOURCE_DIR}/doc/qbittorrent.1)
else()
list(APPEND MAN_FILES ${PROJECT_SOURCE_DIR}/doc/qbittorrent-nox.1)
endif()
install(FILES ${MAN_FILES}
DESTINATION ${CMAKE_INSTALL_MANDIR}/man1
COMPONENT doc
set(manPageLanguages
en
ru
)
foreach(manPageLanguage ${manPageLanguages})
install(FILES ${PROJECT_SOURCE_DIR}/doc/${manPageLanguage}/$<IF:$<BOOL:${GUI}>,qbittorrent.1,qbittorrent-nox.1>
# English man pages are installed into ${CMAKE_INSTALL_MANDIR}/man1, while man pages
# in other languages are installed into ${CMAKE_INSTALL_MANDIR}/${manPageLanguage}/man1.
DESTINATION ${CMAKE_INSTALL_MANDIR}/$<$<NOT:$<STREQUAL:${manPageLanguage},en>>:${manPageLanguage}/>man1
COMPONENT doc
)
endforeach()
if (GUI)
install(FILES org.qbittorrent.qBittorrent.desktop
DESTINATION ${CMAKE_INSTALL_DATAROOTDIR}/applications/

View File

@ -18,3 +18,9 @@ You'll need to be careful when you copy the output to file as some headers will
Careful not to overwrite the existing leading headers or trim off the trailing headers.
Remember to commit Markdown files (\*.md) and the generated man pages (\*.1 files) after editing!
### Translation
To translate the man pages into a new language, create a new subdirectory here
with the translated files and add it to the `manPageLanguages` list in
[`dist/unix/CMakeLists.txt`](../dist/unix/CMakeLists.txt).

6
doc/ru/qbittorrent-nox.1 Normal file
View File

@ -0,0 +1,6 @@
.TH "QBITTORRENT-NOX" "1" "16 января 2010" "Клиент сети БитТоррент для командной строки" ""
.SH НАЗВАНИЕ
.PP
qBittorrent-nox \[em] клиент сети БитТоррент для командной строки.
.SH АВТОРЫ
Christophe Dumez <chris@qbittorrent.org>

View File

@ -0,0 +1,6 @@
% QBITTORRENT-NOX(1) Клиент сети БитТоррент для командной строки
% Christophe Dumez <chris@qbittorrent.org>
% 16 января 2010
# НАЗВАНИЕ
qBittorrent-nox — клиент сети БитТоррент для командной строки.

6
doc/ru/qbittorrent.1 Normal file
View File

@ -0,0 +1,6 @@
.TH "QBITTORRENT" "1" "16 января 2010" "Клиент сети БитТоррент" ""
.SH НАЗВАНИЕ
.PP
qBittorrent \[em] клиент сети БитТоррент.
.SH АВТОРЫ
Christophe Dumez <chris@qbittorrent.org>

6
doc/ru/qbittorrent.1.md Normal file
View File

@ -0,0 +1,6 @@
% QBITTORRENT(1) Клиент сети БитТоррент
% Christophe Dumez <chris@qbittorrent.org>
% 16 января 2010
# НАЗВАНИЕ
qBittorrent — клиент сети БитТоррент.