From 2dc1a7d66f246faee94f08c1a033f107ae126f0f Mon Sep 17 00:00:00 2001 From: Victor Chernyakin <56512186+LocalSpook@users.noreply.github.com> Date: Sat, 2 Sep 2023 11:38:37 -0700 Subject: [PATCH] Set up infrastructure for localized man pages PR #19515. --- dist/unix/CMakeLists.txt | 21 ++++++++++++--------- doc/README.md | 6 ++++++ doc/{ => en}/qbittorrent-nox.1 | 0 doc/{ => en}/qbittorrent-nox.1.md | 0 doc/{ => en}/qbittorrent.1 | 0 doc/{ => en}/qbittorrent.1.md | 0 doc/ru/qbittorrent-nox.1 | 6 ++++++ doc/ru/qbittorrent-nox.1.md | 6 ++++++ doc/ru/qbittorrent.1 | 6 ++++++ doc/ru/qbittorrent.1.md | 6 ++++++ 10 files changed, 42 insertions(+), 9 deletions(-) rename doc/{ => en}/qbittorrent-nox.1 (100%) rename doc/{ => en}/qbittorrent-nox.1.md (100%) rename doc/{ => en}/qbittorrent.1 (100%) rename doc/{ => en}/qbittorrent.1.md (100%) create mode 100644 doc/ru/qbittorrent-nox.1 create mode 100644 doc/ru/qbittorrent-nox.1.md create mode 100644 doc/ru/qbittorrent.1 create mode 100644 doc/ru/qbittorrent.1.md diff --git a/dist/unix/CMakeLists.txt b/dist/unix/CMakeLists.txt index ad27776c6..19fb16fbb 100644 --- a/dist/unix/CMakeLists.txt +++ b/dist/unix/CMakeLists.txt @@ -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}/$,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}/$<$>:${manPageLanguage}/>man1 + COMPONENT doc + ) +endforeach() + if (GUI) install(FILES org.qbittorrent.qBittorrent.desktop DESTINATION ${CMAKE_INSTALL_DATAROOTDIR}/applications/ diff --git a/doc/README.md b/doc/README.md index c3835658d..7b821e8c6 100644 --- a/doc/README.md +++ b/doc/README.md @@ -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). diff --git a/doc/qbittorrent-nox.1 b/doc/en/qbittorrent-nox.1 similarity index 100% rename from doc/qbittorrent-nox.1 rename to doc/en/qbittorrent-nox.1 diff --git a/doc/qbittorrent-nox.1.md b/doc/en/qbittorrent-nox.1.md similarity index 100% rename from doc/qbittorrent-nox.1.md rename to doc/en/qbittorrent-nox.1.md diff --git a/doc/qbittorrent.1 b/doc/en/qbittorrent.1 similarity index 100% rename from doc/qbittorrent.1 rename to doc/en/qbittorrent.1 diff --git a/doc/qbittorrent.1.md b/doc/en/qbittorrent.1.md similarity index 100% rename from doc/qbittorrent.1.md rename to doc/en/qbittorrent.1.md diff --git a/doc/ru/qbittorrent-nox.1 b/doc/ru/qbittorrent-nox.1 new file mode 100644 index 000000000..7eccb73c5 --- /dev/null +++ b/doc/ru/qbittorrent-nox.1 @@ -0,0 +1,6 @@ +.TH "QBITTORRENT-NOX" "1" "16 января 2010" "Клиент сети БитТоррент для командной строки" "" +.SH НАЗВАНИЕ +.PP +qBittorrent-nox \[em] клиент сети БитТоррент для командной строки. +.SH АВТОРЫ +Christophe Dumez diff --git a/doc/ru/qbittorrent-nox.1.md b/doc/ru/qbittorrent-nox.1.md new file mode 100644 index 000000000..0122e6de7 --- /dev/null +++ b/doc/ru/qbittorrent-nox.1.md @@ -0,0 +1,6 @@ +% QBITTORRENT-NOX(1) Клиент сети БитТоррент для командной строки +% Christophe Dumez +% 16 января 2010 + +# НАЗВАНИЕ +qBittorrent-nox — клиент сети БитТоррент для командной строки. diff --git a/doc/ru/qbittorrent.1 b/doc/ru/qbittorrent.1 new file mode 100644 index 000000000..413595ac8 --- /dev/null +++ b/doc/ru/qbittorrent.1 @@ -0,0 +1,6 @@ +.TH "QBITTORRENT" "1" "16 января 2010" "Клиент сети БитТоррент" "" +.SH НАЗВАНИЕ +.PP +qBittorrent \[em] клиент сети БитТоррент. +.SH АВТОРЫ +Christophe Dumez diff --git a/doc/ru/qbittorrent.1.md b/doc/ru/qbittorrent.1.md new file mode 100644 index 000000000..f010e5f9b --- /dev/null +++ b/doc/ru/qbittorrent.1.md @@ -0,0 +1,6 @@ +% QBITTORRENT(1) Клиент сети БитТоррент +% Christophe Dumez +% 16 января 2010 + +# НАЗВАНИЕ +qBittorrent — клиент сети БитТоррент.