From 54592fdcfa2d3c9ea17ddb2ded635c5f16bf92f6 Mon Sep 17 00:00:00 2001 From: Miika Turkia Date: Sun, 25 May 2014 09:11:34 +0300 Subject: Localize worldmap export Call the translation functions for text strings when exporting the worldmap to allow localized exports. Signed-off-by: Miika Turkia Signed-off-by: Dirk Hohndel --- worldmap-save.c | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) (limited to 'worldmap-save.c') diff --git a/worldmap-save.c b/worldmap-save.c index fe98e32ed..b82ccd3eb 100644 --- a/worldmap-save.c +++ b/worldmap-save.c @@ -6,6 +6,7 @@ #include "membuffer.h" #include "worldmap-save.h" #include "worldmap-options.h" +#include "gettext.h" char *getGoogleApi() { @@ -17,8 +18,8 @@ void put_HTML_date(struct membuffer *b, struct dive *dive) { struct tm tm; utc_mkdate(dive->when, &tm); - put_format(b, "

Date: %04u-%02u-%02u

", tm.tm_year + 1900, tm.tm_mon + 1, tm.tm_mday); - put_format(b, "

Time: %02u:%02u:%02u

", tm.tm_hour, tm.tm_min, tm.tm_sec); + put_format(b, "

%s: %04u-%02u-%02u

", translate("gettextFromC", "Date"), tm.tm_year + 1900, tm.tm_mon + 1, tm.tm_mday); + put_format(b, "

%s: %02u:%02u:%02u

", translate("gettextFromC", "Time"), tm.tm_hour, tm.tm_min, tm.tm_sec); } void put_HTML_temp(struct membuffer *b, struct dive *dive) @@ -27,10 +28,10 @@ void put_HTML_temp(struct membuffer *b, struct dive *dive) double value; value = get_temp_units(dive->airtemp.mkelvin, &unit); - put_format(b, "

Air Temp: %.1f %s

", value, unit); + put_format(b, "

%s: %.1f %s

", translate("gettextFromC", "Air Temp"), value, unit); value = get_temp_units(dive->watertemp.mkelvin, &unit); - put_format(b, "

Water Temp: %.1f %s

", value, unit); + put_format(b, "

%s: %.1f %s

", translate("gettextFromC", "Water Temp"), value, unit); } char *replace_char(char *str, char replace, char *replace_by) @@ -84,7 +85,7 @@ void put_HTML_notes(struct membuffer *b, struct dive *dive) { if (dive->notes) { char *notes = quote(dive->notes); - put_format(b, "

Notes: %s

", notes); + put_format(b, "

%s: %s

", translate("gettextFromC", "Notes"), notes); free(notes); } } @@ -107,8 +108,8 @@ void writeMarkers(struct membuffer *b, const bool selected_only) put_string(b, "markers.push(temp);\ntempinfowindow = new google.maps.InfoWindow({content: '
'+'
'+'
'+'
"); put_format(b, "

%s

", quote(dive->location)); put_HTML_date(b, dive); - put_duration(b, dive->duration, "

Duration: ", " min

"); - put_depth(b, dive->maxdepth, "

Max Depth: ", " m

"); + put_duration(b, dive->duration, translate("gettextFromC", "

Duration: "), translate("gettextFromC", " min

")); + put_depth(b, dive->maxdepth, translate("gettextFromC", "

Max Depth: "), translate("gettextFromC", " m

")); put_HTML_temp(b, dive); put_HTML_notes(b, dive); put_string(b, "

'+'
'+'
'});\ninfowindows.push(tempinfowindow);\n"); -- cgit v1.2.3-70-g09d2