summaryrefslogtreecommitdiffstats
path: root/divelist.c
diff options
context:
space:
mode:
authorGravatar Dirk Hohndel <dirk@hohndel.org>2013-10-06 08:55:58 -0700
committerGravatar Dirk Hohndel <dirk@hohndel.org>2013-10-06 10:42:32 -0700
commit4d3e74a23676a33ffdc04a4a8b83c05f63b2693c (patch)
tree23cff2046459ab33f32499e71e7caeb5892dbcd6 /divelist.c
parent2c4ccc04bd384090917d7d17221012611426edb3 (diff)
downloadsubsurface-4d3e74a23676a33ffdc04a4a8b83c05f63b2693c.tar.gz
Trying to switch to Qt translation
This compiles and looks about right, but it doesn't appear to work, yet. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Diffstat (limited to 'divelist.c')
-rw-r--r--divelist.c16
1 files changed, 6 insertions, 10 deletions
diff --git a/divelist.c b/divelist.c
index 5bc175170..82b8e1128 100644
--- a/divelist.c
+++ b/divelist.c
@@ -38,11 +38,7 @@
#include <string.h>
#include <time.h>
#include <math.h>
-#if 0
-#include <glib/gi18n.h>
-#else /* stupid */
-#define _(arg) arg
-#endif
+#include "gettext.h"
#include <assert.h>
#include <zip.h>
#include <libxslt/transform.h>
@@ -580,7 +576,7 @@ char *get_dive_date_string(timestamp_t when)
utc_mkdate(when, &tm);
snprintf(buffer, MAX_DATE_STRING,
/*++GETTEXT 60 char buffer weekday, monthname, day of month, year, hour:min */
- _("%1$s, %2$s %3$d, %4$d %5$02d:%6$02d"),
+ tr("%1$s, %2$s %3$d, %4$d %5$02d:%6$02d"),
weekday(tm.tm_wday),
monthname(tm.tm_mon),
tm.tm_mday, tm.tm_year + 1900,
@@ -597,7 +593,7 @@ char *get_short_dive_date_string(timestamp_t when)
utc_mkdate(when, &tm);
snprintf(buffer, MAX_DATE_STRING,
/*++GETTEXT 40 char buffer monthname, day of month, year, hour:min */
- _("%1$s %2$d, %3$d\n%4$02d:%5$02d"),
+ tr("%1$s %2$d, %3$d\n%4$02d:%5$02d"),
monthname(tm.tm_mon),
tm.tm_mday, tm.tm_year +1900,
tm.tm_hour, tm.tm_min);
@@ -619,14 +615,14 @@ char *get_trip_date_string(timestamp_t when, int nr)
ngettext("%1$s %2$d (%3$d dive)",
"%1$s %2$d (%3$d dives)", nr),
#else
- _("%1$s %2$d (%3$d dives)"),
+ tr("%1$s %2$d (%3$d dives)"),
#endif
monthname(tm.tm_mon),
tm.tm_year + 1900,
nr);
} else {
snprintf(buffer, MAX_DATE_STRING,
- _("%1$s %2$d (1 dive)"),
+ tr("%1$s %2$d (1 dive)"),
monthname(tm.tm_mon),
tm.tm_year + 1900);
}
@@ -657,7 +653,7 @@ char *get_nitrox_string(struct dive *dive)
else
snprintf(buffer, MAX_NITROX_STRING, "%d" UTF8_ELLIPSIS "%d", o2low, o2);
else
- strcpy(buffer, _("air"));
+ strcpy(buffer, tr("air"));
}
return buffer;
}