diff --git a/AUTHORS b/AUTHORS index 6f0225037..8e818aed5 100644 --- a/AUTHORS +++ b/AUTHORS @@ -77,6 +77,7 @@ The following submitted code, packages or analysis, and deserve special thanks: Scott Kostyshak Erik Wenzel Štěpán Henek + Fidel Mato Thanks to the following, who submitted detailed bug reports and excellent suggestions: diff --git a/CMakeLists.txt b/CMakeLists.txt index c4236f56a..19cc450cb 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -100,6 +100,18 @@ else (HAVE_UUID AND HAVE_UUID_UNPARSE_LOWER) message ("-- libuuid not found, using internal uuid") 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") configure_file ( ${CMAKE_SOURCE_DIR}/cmake.h.in diff --git a/ChangeLog b/ChangeLog index 39c374f08..a8a96c9b3 100644 --- a/ChangeLog +++ b/ChangeLog @@ -20,6 +20,7 @@ Features + Virtual tags. + New 'modified' attribute, which contains the most recent modification date, if a modification has occurred. + + Fixed the mechanism used for selecting translations (thanks to Fidel Mato). Bugs + Fixed bug #1031, which kept expanding aliases after the '--' operator (thanks diff --git a/cmake.h.in b/cmake.h.in index 29f9fd5ed..38ae27a74 100644 --- a/cmake.h.in +++ b/cmake.h.in @@ -15,13 +15,11 @@ #define TASK_RCDIR "${CMAKE_INSTALL_PREFIX}/${TASK_DOCDIR}/rc" /* Localization */ -#define PACKAGE_LANGUAGE 1 -#define LANGUAGE_EN_US 1 - -/* -Override PACKAGE_LANGUAGE, then -#define LANGUAGE_XX_YY 2 -*/ +#define PACKAGE_LANGUAGE ${PACKAGE_LANGUAGE} +#define LANGUAGE_EN_US ${LANGUAGE_EN_US} +#define LANGUAGE_ES_ES ${LANGUAGE_ES_ES} +#define LANGUAGE_DE_DE ${LANGUAGE_DE_DE} +#define LANGUAGE_FR_FR ${LANGUAGE_FR_FR} /* git information */ #cmakedefine HAVE_COMMIT diff --git a/src/en-US.h b/src/en-US.h index a13cf0668..ccca19347 100644 --- a/src/en-US.h +++ b/src/en-US.h @@ -64,27 +64,28 @@ // 2. Modify all the strings below. // 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 -// #endif -// -// to: -// -// #if PACKAGE_LANGUAGE == LANGUAGE_EN_US -// #include // #elif PACKAGE_LANGUAGE == LANGUAGE_DE_DE // #include -// #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 -// cmake -D PACKAGE_LANGUAGE=LANGUAGE_DE_DE . +// cmake -D LANGUAGE=3 . // 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. // //////////////////////////////////////////////////////////////////////////////// diff --git a/src/i18n.h b/src/i18n.h index 55f8a482d..17ee54790 100644 --- a/src/i18n.h +++ b/src/i18n.h @@ -44,14 +44,17 @@ #include // Translators: -// Duplicate these three lines, changing "EN_US" and "en-US" to the new -// localization. +// Add more, as appropriate. #if PACKAGE_LANGUAGE == LANGUAGE_EN_US #include +#elif PACKAGE_LANGUAGE == LANGUAGE_ES_ES +#include +#elif PACKAGE_LANGUAGE == LANGUAGE_DE_DE +#include +#elif PACKAGE_LANGUAGE == LANGUAGE_FR_FR +#include #endif -// Add other languages here. - #define CCOLOR_BOLD 500 #define CCOLOR_UNDERLINE 501 #define CCOLOR_ON 502