From 778ae32c12143c0740e9b9b6023df21183c998d5 Mon Sep 17 00:00:00 2001 From: Didier Raboud Date: Thu, 27 Dec 2012 11:05:02 +0100 Subject: Add manpage for colobot - Translate it with po4a - Use POD-format as source, and pod2man for building --- src/desktop/.gitignore | 1 + src/desktop/CMakeLists.txt | 47 ++++++++++++++ src/desktop/colobot.pod | 47 ++++++++++++++ src/desktop/po/colobot-desktop.pot | 106 ++++++++++++++++++++++++++++++- src/desktop/po/fr.po | 127 ++++++++++++++++++++++++++++++++++++- src/desktop/po4a.cfg | 1 + 6 files changed, 324 insertions(+), 5 deletions(-) create mode 100644 src/desktop/.gitignore create mode 100644 src/desktop/colobot.pod diff --git a/src/desktop/.gitignore b/src/desktop/.gitignore new file mode 100644 index 0000000..bade6f3 --- /dev/null +++ b/src/desktop/.gitignore @@ -0,0 +1 @@ +lang/ diff --git a/src/desktop/CMakeLists.txt b/src/desktop/CMakeLists.txt index cc159a9..1e5058f 100644 --- a/src/desktop/CMakeLists.txt +++ b/src/desktop/CMakeLists.txt @@ -37,6 +37,40 @@ if(RSVG_CONVERT) endforeach() endif() +# Create manpage from pod-formatted file +find_program(POD2MAN pod2man) +if(POD2MAN) + set(COLOBOT_MANPAGE_SECTION 6) + + macro(podman) + cmake_parse_arguments(PM "" "PODFILE;LOCALE;" "" ${ARGN}) + if(PM_LOCALE) + # This copes with the fact that english has no "/LANG" in the paths and filenames. + set(SLASHLOCALE /${PM_LOCALE}) + endif() + file(MAKE_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}${SLASHLOCALE}) + add_custom_command(OUTPUT ${CMAKE_CURRENT_BINARY_DIR}${SLASHLOCALE}/colobot.${COLOBOT_MANPAGE_SECTION} + DEPENDS ${CMAKE_CURRENT_SOURCE_DIR}/${PM_PODFILE} + COMMAND ${POD2MAN} ARGS --section=${COLOBOT_MANPAGE_SECTION} + --center="Colobot" --stderr --utf8 + ${CMAKE_CURRENT_SOURCE_DIR}/${PM_PODFILE} + ${CMAKE_CURRENT_BINARY_DIR}${SLASHLOCALE}/colobot.${COLOBOT_MANPAGE_SECTION} + COMMENT "Create ${SLASHLOCALE}/colobot.${COLOBOT_MANPAGE_SECTION} manpage" + ) + add_custom_target(man${PM_LOCALE} DEPENDS ${CMAKE_CURRENT_BINARY_DIR}${SLASHLOCALE}/colobot.${COLOBOT_MANPAGE_SECTION}) + + install( + FILES ${CMAKE_CURRENT_BINARY_DIR}${SLASHLOCALE}/colobot.${COLOBOT_MANPAGE_SECTION} + DESTINATION ${CMAKE_INSTALL_PREFIX}/share/man${SLASHLOCALE}/man${COLOBOT_MANPAGE_SECTION}/ ) + + add_dependencies(man man${PM_LOCALE}) + endmacro() + + # Create the english manpage + podman(PODFILE colobot.pod) + +endif() + # Translate translatable material find_program(PO4A po4a) @@ -46,4 +80,17 @@ if(PO4A) WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR} ) add_dependencies(desktopfile desktop_po4a) + + if(POD2MAN) + add_custom_target(man_po4a + COMMAND ${PO4A} po4a.cfg + WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR} + ) + add_dependencies(man man_po4a) + file(GLOB LINGUAS_PO RELATIVE ${CMAKE_CURRENT_SOURCE_DIR}/po/ ${CMAKE_CURRENT_SOURCE_DIR}/po/*.po) + string(REGEX REPLACE ".po$" "" LINGUAS ${LINGUAS_PO}) + foreach(LOCALE ${LINGUAS}) + podman(PODFILE lang/${LOCALE}/colobot.pod LOCALE ${LOCALE}) + endforeach() + endif() endif() diff --git a/src/desktop/colobot.pod b/src/desktop/colobot.pod new file mode 100644 index 0000000..2fc3a00 --- /dev/null +++ b/src/desktop/colobot.pod @@ -0,0 +1,47 @@ +=encoding utf8 + +=head1 COLOBOT + +colobot - educational programming strategy game + +=head1 SYNOPSIS + +B [B<-datadir> I] [B<-debug>] [B<-loglevel> I] [B<-language> I] + +=head1 DESCRIPTION + +Colobot (Colonize with Bots) is an educational game aiming to teach +programming through entertainment. You are playing as an astronaut on a +journey with robot helpers to find a planet for colonization. It features 3D +real-time graphics and a C++ and Java-like, object-oriented language, CBOT, +which can be used to program the robots available in the game. + +=head1 OPTIONS + +=over 8 + +=item B<-help> + +Display a short help text + +=item B<-datadir> F + +Set custom data directory path + +=item B<-debug> + +Enable debug mode (more info printed in logs) + +=item B<-loglevel> I + +Set log level. Possible choices are: trace, debug, info, warn, error, none. + +=item B<-language> I + +Set language. Note that you can also fill the B environment variable. + +=back + +=head1 AUTHOR + +This manpage was written by Didier Raboud >. diff --git a/src/desktop/po/colobot-desktop.pot b/src/desktop/po/colobot-desktop.pot index e74136a..17e60c3 100644 --- a/src/desktop/po/colobot-desktop.pot +++ b/src/desktop/po/colobot-desktop.pot @@ -7,13 +7,13 @@ msgid "" msgstr "" "Project-Id-Version: PACKAGE VERSION\n" -"POT-Creation-Date: 2012-12-26 15:05+0100\n" +"POT-Creation-Date: 2012-12-27 10:59+0100\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME \n" "Language-Team: LANGUAGE \n" "Language: \n" "MIME-Version: 1.0\n" -"Content-Type: text/plain; charset=CHARSET\n" +"Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" #: colobot.ini:1 @@ -30,3 +30,105 @@ msgstr "" #, no-wrap msgid "Colonize with bots" msgstr "" + +#. type: =head1 +#: colobot.pod:3 +msgid "COLOBOT" +msgstr "" + +#. type: textblock +#: colobot.pod:5 +msgid "colobot - educational programming strategy game" +msgstr "" + +#. type: =head1 +#: colobot.pod:7 +msgid "SYNOPSIS" +msgstr "" + +#. type: textblock +#: colobot.pod:9 +msgid "" +"B [B<-datadir> I] [B<-debug>] [B<-loglevel> I] " +"[B<-language> I]" +msgstr "" + +#. type: =head1 +#: colobot.pod:11 +msgid "DESCRIPTION" +msgstr "" + +#. type: textblock +#: colobot.pod:13 +msgid "" +"Colobot (Colonize with Bots) is an educational game aiming to teach " +"programming through entertainment. You are playing as an astronaut on a " +"journey with robot helpers to find a planet for colonization. It features 3D " +"real-time graphics and a C++ and Java-like, object-oriented language, CBOT, " +"which can be used to program the robots available in the game." +msgstr "" + +#. type: =head1 +#: colobot.pod:19 +msgid "OPTIONS" +msgstr "" + +#. type: =item +#: colobot.pod:23 +msgid "B<-help>" +msgstr "" + +#. type: textblock +#: colobot.pod:25 +msgid "Display a short help text" +msgstr "" + +#. type: =item +#: colobot.pod:27 +msgid "B<-datadir> F" +msgstr "" + +#. type: textblock +#: colobot.pod:29 +msgid "Set custom data directory path" +msgstr "" + +#. type: =item +#: colobot.pod:31 +msgid "B<-debug>" +msgstr "" + +#. type: textblock +#: colobot.pod:33 +msgid "Enable debug mode (more info printed in logs)" +msgstr "" + +#. type: =item +#: colobot.pod:35 +msgid "B<-loglevel> I" +msgstr "" + +#. type: textblock +#: colobot.pod:37 +msgid "Set log level. Possible choices are: trace, debug, info, warn, error, none." +msgstr "" + +#. type: =item +#: colobot.pod:39 +msgid "B<-language> I" +msgstr "" + +#. type: textblock +#: colobot.pod:41 +msgid "Set language. Note that you can also fill the B environment variable." +msgstr "" + +#. type: =head1 +#: colobot.pod:45 +msgid "AUTHOR" +msgstr "" + +#. type: textblock +#: colobot.pod:47 +msgid "This manpage was written by Didier Raboud >." +msgstr "" diff --git a/src/desktop/po/fr.po b/src/desktop/po/fr.po index 63dbb23..4709d49 100644 --- a/src/desktop/po/fr.po +++ b/src/desktop/po/fr.po @@ -1,13 +1,13 @@ # French translations for PACKAGE package # Copyright (C) 2012 Free Software Foundation, Inc. # This file is distributed under the same license as the PACKAGE package. -# Automatically generated, 2012. # +# Didier Raboud , 2012. msgid "" msgstr "" "Project-Id-Version: PACKAGE VERSION\n" -"POT-Creation-Date: 2012-12-26 15:05+0100\n" -"PO-Revision-Date: 2012-12-26 15:05+0100\n" +"POT-Creation-Date: 2012-12-27 10:55+0100\n" +"PO-Revision-Date: 2012-12-27 11:00+0100\n" "Last-Translator: Didier Raboud \n" "Language-Team: none\n" "Language: fr\n" @@ -30,3 +30,124 @@ msgstr "Apprentissage de la programmation par le jeu" #, no-wrap msgid "Colonize with bots" msgstr "Colonise avec des roBots" + +#. type: =head1 +#: colobot.pod:3 +msgid "COLOBOT" +msgstr "COLOBOT" + +#. type: textblock +#: colobot.pod:5 +msgid "colobot - educational programming strategy game" +msgstr "colobot - Jeu éducatif de stratégie et de programmation" + +#. type: =head1 +#: colobot.pod:7 +msgid "SYNOPSIS" +msgstr "RÉSUMÉ" + +#. type: textblock +#: colobot.pod:9 +msgid "" +"B [B<-datadir> I] [B<-debug>] [B<-loglevel> I] [B<-" +"language> I]" +msgstr "" +"B [B<-datadir> I] [B<-debug>] [B<-loglevel> I] [B<-" +"language> I]" + +#. type: =head1 +#: colobot.pod:11 +msgid "DESCRIPTION" +msgstr "DESCRIPTION" + +#. type: textblock +#: colobot.pod:13 +msgid "" +"Colobot (Colonize with Bots) is an educational game aiming to teach " +"programming through entertainment. You are playing as an astronaut on a " +"journey with robot helpers to find a planet for colonization. It features 3D " +"real-time graphics and a C++ and Java-like, object-oriented language, CBOT, " +"which can be used to program the robots available in the game." +msgstr "" +"Colobot (Colonise avec des roBots) est un jeu éducatif visant à " +"l'enseignement de la programmation par le jeu. Vous jouez un astronaute en " +"voyage avec des robots à la recherche d'une planète à coloniser. Son " +"interface est en trois-dimensions et en temps réel; le language utilisé " +"(CBOT) ressemble au C++ et à Java et peut être utilisé pour programmer les " +"robots disponibles dans le jeu." + +#. type: =head1 +#: colobot.pod:19 +msgid "OPTIONS" +msgstr "OPTIONS" + +#. type: =item +#: colobot.pod:23 +msgid "B<-help>" +msgstr "B<-help>" + +#. type: textblock +#: colobot.pod:25 +msgid "Display a short help text" +msgstr "Affiche un court texte d'aide" + +#. type: =item +#: colobot.pod:27 +msgid "B<-datadir> F" +msgstr "B<-datadir> F" + +#. type: textblock +#: colobot.pod:29 +msgid "Set custom data directory path" +msgstr "Définit le chemin vers un répertoire de données spécifique" + +#. type: =item +#: colobot.pod:31 +msgid "B<-debug>" +msgstr "B<-debug>" + +#. type: textblock +#: colobot.pod:33 +msgid "Enable debug mode (more info printed in logs)" +msgstr "" +"Active le mode de déboguage (plus d'informations sont affichées dans le " +"journal)" + +#. type: =item +#: colobot.pod:35 +msgid "B<-loglevel> I" +msgstr "B<-loglevel> I" + +#. type: textblock +#: colobot.pod:37 +msgid "" +"Set log level. Possible choices are: trace, debug, info, warn, error, none." +msgstr "" +"Définit le niveau de journalisation parmi: trace, debug, info, warn, error, " +"none." + +#. type: =item +#: colobot.pod:39 +msgid "B<-language> I" +msgstr "B<-language> I" + +#. type: textblock +#: colobot.pod:41 +msgid "" +"Set language. Note that you can also fill the B environment variable." +msgstr "" +"Définit la langue. Il est aussi possible d'utiliser la variable " +"d'environnement B." + +#. type: =head1 +#: colobot.pod:45 +msgid "AUTHOR" +msgstr "Auteur" + +#. type: textblock +#: colobot.pod:47 +msgid "This manpage was written by Didier Raboud >." +msgstr "" +"Cette page de manuel a été écrite et traduite par Didier Raboud " +">." + diff --git a/src/desktop/po4a.cfg b/src/desktop/po4a.cfg index eda2985..c251959 100644 --- a/src/desktop/po4a.cfg +++ b/src/desktop/po4a.cfg @@ -1,3 +1,4 @@ [po_directory] po/ [type:ini] colobot.ini $lang:lang/$lang/colobot.ini +[type:pod] colobot.pod $lang:lang/$lang/colobot.pod -- cgit v1.2.3-1-g7c22 From afea08d57049b58361059cd0a11b92c942ff5458 Mon Sep 17 00:00:00 2001 From: Didier Raboud Date: Thu, 27 Dec 2012 13:13:16 +0100 Subject: Always build manpages solves #105 --- src/desktop/CMakeLists.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/desktop/CMakeLists.txt b/src/desktop/CMakeLists.txt index 1e5058f..1a1cfd5 100644 --- a/src/desktop/CMakeLists.txt +++ b/src/desktop/CMakeLists.txt @@ -57,7 +57,7 @@ if(POD2MAN) ${CMAKE_CURRENT_BINARY_DIR}${SLASHLOCALE}/colobot.${COLOBOT_MANPAGE_SECTION} COMMENT "Create ${SLASHLOCALE}/colobot.${COLOBOT_MANPAGE_SECTION} manpage" ) - add_custom_target(man${PM_LOCALE} DEPENDS ${CMAKE_CURRENT_BINARY_DIR}${SLASHLOCALE}/colobot.${COLOBOT_MANPAGE_SECTION}) + add_custom_target(man${PM_LOCALE} ALL DEPENDS ${CMAKE_CURRENT_BINARY_DIR}${SLASHLOCALE}/colobot.${COLOBOT_MANPAGE_SECTION}) install( FILES ${CMAKE_CURRENT_BINARY_DIR}${SLASHLOCALE}/colobot.${COLOBOT_MANPAGE_SECTION} -- cgit v1.2.3-1-g7c22