summaryrefslogtreecommitdiffstats
path: root/dive.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 /dive.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 'dive.c')
-rw-r--r--dive.c29
1 files changed, 13 insertions, 16 deletions
diff --git a/dive.c b/dive.c
index 935e932e3..554bfd54b 100644
--- a/dive.c
+++ b/dive.c
@@ -2,10 +2,7 @@
/* maintains the internal dive list structure */
#include <string.h>
#include <stdio.h>
-#if 0
-#include <glib/gi18n.h>
-#endif
-
+#include "gettext.h"
#include "dive.h"
void add_event(struct divecomputer *dc, int time, int type, int flags, int value, const char *name)
@@ -43,15 +40,15 @@ int get_pressure_units(unsigned int mb, const char **units)
switch (units_p->pressure) {
case PASCAL:
pressure = mb * 100;
- unit = _("pascal");
+ unit = tr("pascal");
break;
case BAR:
pressure = (mb + 500) / 1000;
- unit = _("bar");
+ unit = tr("bar");
break;
case PSI:
pressure = mbar_to_PSI(mb);
- unit = _("psi");
+ unit = tr("psi");
break;
}
if (units)
@@ -87,12 +84,12 @@ double get_volume_units(unsigned int ml, int *frac, const char **units)
switch (units_p->volume) {
case LITER:
vol = ml / 1000.0;
- unit = _("l");
+ unit = tr("l");
decimals = 1;
break;
case CUFT:
vol = ml_to_cuft(ml);
- unit = _("cuft");
+ unit = tr("cuft");
decimals = 2;
break;
}
@@ -113,12 +110,12 @@ double get_depth_units(unsigned int mm, int *frac, const char **units)
switch (units_p->length) {
case METERS:
d = mm / 1000.0;
- unit = _("m");
+ unit = tr("m");
decimals = d < 20;
break;
case FEET:
d = mm_to_feet(mm);
- unit = _("ft");
+ unit = tr("ft");
decimals = 0;
break;
}
@@ -139,11 +136,11 @@ double get_vertical_speed_units(unsigned int mms, int *frac, const char **units)
switch (units_p->length) {
case METERS:
d = mms / 1000.0 * time_factor;
- unit = _((units_p->vertical_speed_time == MINUTES) ? "m/min" : "m/s");
+ unit = tr((units_p->vertical_speed_time == MINUTES) ? "m/min" : "m/s");
break;
case FEET:
d = mm_to_feet(mms) * time_factor;
- unit = _((units_p->vertical_speed_time == MINUTES) ? "ft/min" : "ft/s");
+ unit = tr((units_p->vertical_speed_time == MINUTES) ? "ft/min" : "ft/s");
break;
}
if (frac)
@@ -162,11 +159,11 @@ double get_weight_units(unsigned int grams, int *frac, const char **units)
if (units_p->weight == LBS) {
value = grams_to_lbs(grams);
- unit = _("lbs");
+ unit = tr("lbs");
decimals = 0;
} else {
value = grams / 1000.0;
- unit = _("kg");
+ unit = tr("kg");
decimals = 1;
}
if (frac)
@@ -962,7 +959,7 @@ static char *merge_text(const char *a, const char *b)
res = malloc(strlen(a) + strlen(b) + 32);
if (!res)
return (char *)a;
- sprintf(res, _("(%s) or (%s)"), a, b);
+ sprintf(res, tr("(%s) or (%s)"), a, b);
return res;
}