diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/app/app.cpp | 13 | ||||
-rw-r--r-- | src/desktop/.gitignore | 1 | ||||
-rw-r--r-- | src/desktop/CMakeLists.txt | 47 | ||||
-rw-r--r-- | src/desktop/colobot.pod | 47 | ||||
-rw-r--r-- | src/desktop/po/colobot-desktop.pot | 106 | ||||
-rw-r--r-- | src/desktop/po/fr.po | 127 | ||||
-rw-r--r-- | src/desktop/po4a.cfg | 1 | ||||
-rw-r--r-- | src/graphics/engine/text.cpp | 2 |
8 files changed, 333 insertions, 11 deletions
diff --git a/src/app/app.cpp b/src/app/app.cpp index 118e100..27adcb1 100644 --- a/src/app/app.cpp +++ b/src/app/app.cpp @@ -312,11 +312,14 @@ bool CApplication::Create() break; } - std::string langStr = "LANGUAGE="; - langStr += locale; - strcpy(S_LANGUAGE, langStr.c_str()); - putenv(S_LANGUAGE); - setlocale(LC_ALL, locale.c_str()); + if (!locale.empty()) + { + std::string langStr = "LANG="; + langStr += locale; + strcpy(S_LANGUAGE, langStr.c_str()); + putenv(S_LANGUAGE); + } + setlocale(LC_ALL, ""); GetLogger()->Debug("Set locale to '%s'\n", locale.c_str()); bindtextdomain("colobot", COLOBOT_I18N_DIR); 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..1a1cfd5 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} ALL 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<colobot> [B<-datadir> I<path>] [B<-debug>] [B<-loglevel> I<level>] [B<-language> I<lang>] + +=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</path/to/data/> + +Set custom data directory path + +=item B<-debug> + +Enable debug mode (more info printed in logs) + +=item B<-loglevel> I<level> + +Set log level. Possible choices are: trace, debug, info, warn, error, none. + +=item B<-language> I<lang> + +Set language. Note that you can also fill the B<LANG> environment variable. + +=back + +=head1 AUTHOR + +This manpage was written by Didier Raboud <S<odyx@debian.org>>. 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 <EMAIL@ADDRESS>\n" "Language-Team: LANGUAGE <LL@li.org>\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<colobot> [B<-datadir> I<path>] [B<-debug>] [B<-loglevel> I<level>] " +"[B<-language> I<lang>]" +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</path/to/data/>" +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<level>" +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<lang>" +msgstr "" + +#. type: textblock +#: colobot.pod:41 +msgid "Set language. Note that you can also fill the B<LANG> environment variable." +msgstr "" + +#. type: =head1 +#: colobot.pod:45 +msgid "AUTHOR" +msgstr "" + +#. type: textblock +#: colobot.pod:47 +msgid "This manpage was written by Didier Raboud <S<odyx@debian.org>>." +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 <odyx@debian.org>, 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 <odyx@debian.org>\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<colobot> [B<-datadir> I<path>] [B<-debug>] [B<-loglevel> I<level>] [B<-" +"language> I<lang>]" +msgstr "" +"B<colobot> [B<-datadir> I<chemin>] [B<-debug>] [B<-loglevel> I<niveau>] [B<-" +"language> I<code-de-langue>]" + +#. 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</path/to/data/>" +msgstr "B<-datadir> F</chemin/vers/les/donnes/>" + +#. 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<level>" +msgstr "B<-loglevel> I<niveau>" + +#. 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<lang>" +msgstr "B<-language> I<langue>" + +#. type: textblock +#: colobot.pod:41 +msgid "" +"Set language. Note that you can also fill the B<LANG> environment variable." +msgstr "" +"Définit la langue. Il est aussi possible d'utiliser la variable " +"d'environnement B<LANG>." + +#. type: =head1 +#: colobot.pod:45 +msgid "AUTHOR" +msgstr "Auteur" + +#. type: textblock +#: colobot.pod:47 +msgid "This manpage was written by Didier Raboud <S<odyx@debian.org>>." +msgstr "" +"Cette page de manuel a été écrite et traduite par Didier Raboud " +"<S<odyx@debian.org>>." + 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 diff --git a/src/graphics/engine/text.cpp b/src/graphics/engine/text.cpp index 66c73a9..101e01a 100644 --- a/src/graphics/engine/text.cpp +++ b/src/graphics/engine/text.cpp @@ -677,7 +677,7 @@ void CText::DrawCharAndAdjustPos(UTF8Char ch, FontType font, float size, Math::P return; int width = 1; - if (ch.c1 < 32) { // FIXME add support for chars with code 9 10 23 + if (ch.c1 > 0 && ch.c1 < 32) { // FIXME add support for chars with code 9 10 23 ch.c1 = ' '; ch.c2 = 0; ch.c3 = 0; |