diff options
author | Dirk Hohndel <dirk@hohndel.org> | 2013-10-09 22:48:35 -0700 |
---|---|---|
committer | Dirk Hohndel <dirk@hohndel.org> | 2013-10-09 22:51:59 -0700 |
commit | 193d20c479d597db307ac5e206b74b26c2f97ba9 (patch) | |
tree | b9f55e5acbacb4d397edb022cf8a37ef4654efbf /divelist.c | |
parent | 2d69d4a5ef5f2d3e777d77380732c333151fe949 (diff) | |
download | subsurface-193d20c479d597db307ac5e206b74b26c2f97ba9.tar.gz |
Next step towards working translations
This may seem like a really odd change - but with this change the Qt tools
can correctly parse the C files (and qt-gui.cpp) and get the context for
the translatable strings right.
It's not super-pretty (I'll admit that _("string literal") is much easier
on the eye than translate("gettextFromC", "string literal") ) but I think
this will be the price of success.
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Diffstat (limited to 'divelist.c')
-rw-r--r-- | divelist.c | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/divelist.c b/divelist.c index 69393f2f6..6df961808 100644 --- a/divelist.c +++ b/divelist.c @@ -470,7 +470,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 */ - tr("%1$s, %2$s %3$d, %4$d %5$02d:%6$02d"), + translate("gettextFromC","%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, @@ -487,7 +487,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 */ - tr("%1$s %2$d, %3$d\n%4$02d:%5$02d"), + translate("gettextFromC","%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); @@ -509,14 +509,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 - tr("%1$s %2$d (%3$d dives)"), + translate("gettextFromC","%1$s %2$d (%3$d dives)"), #endif monthname(tm.tm_mon), tm.tm_year + 1900, nr); } else { snprintf(buffer, MAX_DATE_STRING, - tr("%1$s %2$d (1 dive)"), + translate("gettextFromC","%1$s %2$d (1 dive)"), monthname(tm.tm_mon), tm.tm_year + 1900); } @@ -547,7 +547,7 @@ char *get_nitrox_string(struct dive *dive) else snprintf(buffer, MAX_NITROX_STRING, "%d" UTF8_ELLIPSIS "%d", o2low, o2); else - strcpy(buffer, tr("air")); + strcpy(buffer, translate("gettextFromC","air")); } return buffer; } |