Internationalization

- Fixed the mechanism used to select translations (thanks to Fidel Mato).
This commit is contained in:
Paul Beckingham 2012-10-13 15:30:04 -04:00
parent 9fe9f96f8f
commit 879ecf9505
6 changed files with 40 additions and 24 deletions

View file

@ -77,6 +77,7 @@ The following submitted code, packages or analysis, and deserve special thanks:
Scott Kostyshak Scott Kostyshak
Erik Wenzel Erik Wenzel
Štěpán Henek Štěpán Henek
Fidel Mato
Thanks to the following, who submitted detailed bug reports and excellent Thanks to the following, who submitted detailed bug reports and excellent
suggestions: suggestions:

View file

@ -100,6 +100,18 @@ else (HAVE_UUID AND HAVE_UUID_UNPARSE_LOWER)
message ("-- libuuid not found, using internal uuid") message ("-- libuuid not found, using internal uuid")
endif (HAVE_UUID AND HAVE_UUID_UNPARSE_LOWER) endif (HAVE_UUID AND HAVE_UUID_UNPARSE_LOWER)
# Set the package language.
if (LANGUAGE)
set (PACKAGE_LANGUAGE ${LANGUAGE})
else (LANGUAGE)
set (PACKAGE_LANGUAGE 1)
endif (LANGUAGE)
set (LANGUAGE_EN_US 1)
set (LANGUAGE_ES_ES 2)
set (LANGUAGE_DE_DE 3)
set (LANGUAGE_FR_FR 4)
message ("-- Configuring cmake.h") message ("-- Configuring cmake.h")
configure_file ( configure_file (
${CMAKE_SOURCE_DIR}/cmake.h.in ${CMAKE_SOURCE_DIR}/cmake.h.in

View file

@ -20,6 +20,7 @@ Features
+ Virtual tags. + Virtual tags.
+ New 'modified' attribute, which contains the most recent modification date, + New 'modified' attribute, which contains the most recent modification date,
if a modification has occurred. if a modification has occurred.
+ Fixed the mechanism used for selecting translations (thanks to Fidel Mato).
Bugs Bugs
+ Fixed bug #1031, which kept expanding aliases after the '--' operator (thanks + Fixed bug #1031, which kept expanding aliases after the '--' operator (thanks

View file

@ -15,13 +15,11 @@
#define TASK_RCDIR "${CMAKE_INSTALL_PREFIX}/${TASK_DOCDIR}/rc" #define TASK_RCDIR "${CMAKE_INSTALL_PREFIX}/${TASK_DOCDIR}/rc"
/* Localization */ /* Localization */
#define PACKAGE_LANGUAGE 1 #define PACKAGE_LANGUAGE ${PACKAGE_LANGUAGE}
#define LANGUAGE_EN_US 1 #define LANGUAGE_EN_US ${LANGUAGE_EN_US}
#define LANGUAGE_ES_ES ${LANGUAGE_ES_ES}
/* #define LANGUAGE_DE_DE ${LANGUAGE_DE_DE}
Override PACKAGE_LANGUAGE, then #define LANGUAGE_FR_FR ${LANGUAGE_FR_FR}
#define LANGUAGE_XX_YY 2
*/
/* git information */ /* git information */
#cmakedefine HAVE_COMMIT #cmakedefine HAVE_COMMIT

View file

@ -64,27 +64,28 @@
// 2. Modify all the strings below. // 2. Modify all the strings below.
// i.e. change "Unknown error." to "Unbekannter Fehler.". // i.e. change "Unknown error." to "Unbekannter Fehler.".
// //
// 3. Add your new translation to the task.git/src/i18n.h file by changing: // 3. Add your new translation to the task.git/src/i18n.h file, if necessary,
// by inserting:
// //
// #if PACKAGE_LANGUAGE == LANGUAGE_EN_US
// #include <en-US.h>
// #endif
//
// to:
//
// #if PACKAGE_LANGUAGE == LANGUAGE_EN_US
// #include <en-US.h>
// #elif PACKAGE_LANGUAGE == LANGUAGE_DE_DE // #elif PACKAGE_LANGUAGE == LANGUAGE_DE_DE
// #include <de-DE.h> // #include <de-DE.h>
// #endif
// //
// 4. Build your localized Taskwarrior with these commands: // 4. Add your new language to task.git/CMakeLists.txt, making sure that
// number is unique:
//
// set (LANGUAGE_DE_DE 3)
//
// 5. Add your new language to task.git/cmake.h.in:
//
// #define LANGUAGE_DE_DE ${LANGUAGE_DE_DE}
//
// 6. Build your localized Taskwarrior with these commands:
// //
// cd task.git // cd task.git
// cmake -D PACKAGE_LANGUAGE=LANGUAGE_DE_DE . // cmake -D LANGUAGE=3 .
// make // make
// //
// 5. Submit your translation to support@taskwarrior.org, where it will be // 7. Submit your translation to support@taskwarrior.org, where it will be
// shared with others. // shared with others.
// //
//////////////////////////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////////////////////////

View file

@ -44,14 +44,17 @@
#include <cmake.h> #include <cmake.h>
// Translators: // Translators:
// Duplicate these three lines, changing "EN_US" and "en-US" to the new // Add more, as appropriate.
// localization.
#if PACKAGE_LANGUAGE == LANGUAGE_EN_US #if PACKAGE_LANGUAGE == LANGUAGE_EN_US
#include <en-US.h> #include <en-US.h>
#elif PACKAGE_LANGUAGE == LANGUAGE_ES_ES
#include <es-ES.h>
#elif PACKAGE_LANGUAGE == LANGUAGE_DE_DE
#include <de-DE.h>
#elif PACKAGE_LANGUAGE == LANGUAGE_FR_FR
#include <fr-FR.h>
#endif #endif
// Add other languages here.
#define CCOLOR_BOLD 500 #define CCOLOR_BOLD 500
#define CCOLOR_UNDERLINE 501 #define CCOLOR_UNDERLINE 501
#define CCOLOR_ON 502 #define CCOLOR_ON 502