mirror of
https://github.com/GothenburgBitFactory/taskwarrior.git
synced 2025-07-07 20:06:36 +02:00
Internationalization
- Fixed the mechanism used to select translations (thanks to Fidel Mato).
This commit is contained in:
parent
9fe9f96f8f
commit
879ecf9505
6 changed files with 40 additions and 24 deletions
1
AUTHORS
1
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:
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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
|
||||
|
|
12
cmake.h.in
12
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
|
||||
|
|
27
src/en-US.h
27
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 <en-US.h>
|
||||
// #endif
|
||||
//
|
||||
// to:
|
||||
//
|
||||
// #if PACKAGE_LANGUAGE == LANGUAGE_EN_US
|
||||
// #include <en-US.h>
|
||||
// #elif PACKAGE_LANGUAGE == LANGUAGE_DE_DE
|
||||
// #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
|
||||
// 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.
|
||||
//
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
|
|
11
src/i18n.h
11
src/i18n.h
|
@ -44,14 +44,17 @@
|
|||
#include <cmake.h>
|
||||
|
||||
// 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 <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
|
||||
|
||||
// Add other languages here.
|
||||
|
||||
#define CCOLOR_BOLD 500
|
||||
#define CCOLOR_UNDERLINE 501
|
||||
#define CCOLOR_ON 502
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue