From 0f535620e43dd9edc6fb8e8cad01e0c5bce6f0eb Mon Sep 17 00:00:00 2001 From: Henrik Brautaset Aronsen Date: Sun, 29 Jun 2014 14:35:47 +0200 Subject: Don't translate HTML tags We were sending HTML tags to translate() in worldmap-save.c Signed-off-by: Henrik Brautaset Aronsen Signed-off-by: Dirk Hohndel --- worldmap-save.c | 27 +++++++++++++++++++-------- 1 file changed, 19 insertions(+), 8 deletions(-) (limited to 'worldmap-save.c') diff --git a/worldmap-save.c b/worldmap-save.c index 35a68966f..dfce3627a 100644 --- a/worldmap-save.c +++ b/worldmap-save.c @@ -20,6 +20,7 @@ void writeMarkers(struct membuffer *b, const bool selected_only) { int i, dive_no = 0; struct dive *dive; + char pre[1000], post[1000]; for_each_dive (i, dive) { if (selected_only) { @@ -32,16 +33,26 @@ void writeMarkers(struct membuffer *b, const bool selected_only) put_degrees(b, dive->latitude, "temp = new google.maps.Marker({position: new google.maps.LatLng(", ""); put_degrees(b, dive->longitude, ",", ")});\n"); put_string(b, "markers.push(temp);\ntempinfowindow = new google.maps.InfoWindow({content: '
'+'
'+'
'+'
"); - put_HTML_date(b, dive, translate("gettextFromC", "

Date:"), "

"); - put_HTML_time(b, dive, translate("gettextFromC", "

Time:"), "

"); - 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_airtemp(b, dive, translate("gettextFromC", "

Air Temp: "), "

"); - put_HTML_watertemp(b, dive, translate("gettextFromC", "

Water Temp : "), "

"); - put_string(b, "

Location : "); + snprintf(pre, sizeof(pre), "

%s ", translate("gettextFromC", "Date:")); + put_HTML_date(b, dive, pre, "

"); + snprintf(pre, sizeof(pre), "

%s ", translate("gettextFromC", "Time:")); + put_HTML_time(b, dive, pre, "

"); + snprintf(pre, sizeof(pre), "

%s ", translate("gettextFromC", "Duration:")); + snprintf(post, sizeof(post), " %s

", translate("gettextFromC", "min")); + put_duration(b, dive->duration, pre, post); + snprintf(pre, sizeof(pre), "

%s ", translate("gettextFromC", "Max Depth:")); + snprintf(post, sizeof(post), " %s

", translate("gettextFromC", "m")); + put_depth(b, dive->maxdepth, pre, post); + snprintf(pre, sizeof(pre), "

%s ", translate("gettextFromC", "Air Temp:")); + put_HTML_airtemp(b, dive, pre, "

"); + snprintf(pre, sizeof(pre), "

%s ", translate("gettextFromC", "Water Temp:")); + put_HTML_watertemp(b, dive, pre, "

"); + snprintf(pre, sizeof(pre), "

%s ", translate("gettextFromC", "Location:")); + put_string(b, pre); put_HTML_quoted(b, dive->location); put_string(b, "

"); - put_HTML_notes(b, dive, translate("gettextFromC", "

Notes"), "

"); + snprintf(pre, sizeof(pre), "

%s ", translate("gettextFromC", "Notes:")); + put_HTML_notes(b, dive, pre, "

"); put_string(b, "

'+'
'+'
'});\ninfowindows.push(tempinfowindow);\n"); put_format(b, "google.maps.event.addListener(markers[%d], 'mouseover', function() {\ninfowindows[%d].open(map,markers[%d]);}", dive_no, dive_no, dive_no); put_format(b, ");google.maps.event.addListener(markers[%d], 'mouseout', function() {\ninfowindows[%d].close();});\n", dive_no, dive_no); -- cgit v1.2.3-70-g09d2