summaryrefslogtreecommitdiffstats
path: root/worldmap-save.c
diff options
context:
space:
mode:
authorGravatar Henrik Brautaset Aronsen <subsurface@henrik.synth.no>2014-06-29 14:35:47 +0200
committerGravatar Dirk Hohndel <dirk@hohndel.org>2014-06-29 08:34:24 -0700
commit0f535620e43dd9edc6fb8e8cad01e0c5bce6f0eb (patch)
treecc094404d85dd5bd6f2181e4539aa552d24e5f2c /worldmap-save.c
parent5617f36ed8f905ac00cbf6a705147914f8596a83 (diff)
downloadsubsurface-0f535620e43dd9edc6fb8e8cad01e0c5bce6f0eb.tar.gz
Don't translate HTML tags
We were sending HTML tags to translate() in worldmap-save.c Signed-off-by: Henrik Brautaset Aronsen <subsurface@henrik.synth.no> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Diffstat (limited to 'worldmap-save.c')
-rw-r--r--worldmap-save.c27
1 files changed, 19 insertions, 8 deletions
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: '<div id=\"content\">'+'<div id=\"siteNotice\">'+'</div>'+'<div id=\"bodyContent\">");
- put_HTML_date(b, dive, translate("gettextFromC", "<p>Date:"), "</p>");
- put_HTML_time(b, dive, translate("gettextFromC", "<p>Time:"), "</p>");
- put_duration(b, dive->duration, translate("gettextFromC", "<p>Duration: "), translate("gettextFromC", " min</p>"));
- put_depth(b, dive->maxdepth, translate("gettextFromC", "<p>Max Depth: "), translate("gettextFromC", " m</p>"));
- put_HTML_airtemp(b, dive, translate("gettextFromC", "<p>Air Temp: "), "</p>");
- put_HTML_watertemp(b, dive, translate("gettextFromC", "<p>Water Temp : "), "</p>");
- put_string(b, "<p>Location : <b>");
+ snprintf(pre, sizeof(pre), "<p>%s ", translate("gettextFromC", "Date:"));
+ put_HTML_date(b, dive, pre, "</p>");
+ snprintf(pre, sizeof(pre), "<p>%s ", translate("gettextFromC", "Time:"));
+ put_HTML_time(b, dive, pre, "</p>");
+ snprintf(pre, sizeof(pre), "<p>%s ", translate("gettextFromC", "Duration:"));
+ snprintf(post, sizeof(post), " %s</p>", translate("gettextFromC", "min"));
+ put_duration(b, dive->duration, pre, post);
+ snprintf(pre, sizeof(pre), "<p>%s ", translate("gettextFromC", "Max Depth:"));
+ snprintf(post, sizeof(post), " %s</p>", translate("gettextFromC", "m"));
+ put_depth(b, dive->maxdepth, pre, post);
+ snprintf(pre, sizeof(pre), "<p>%s ", translate("gettextFromC", "Air Temp:"));
+ put_HTML_airtemp(b, dive, pre, "</p>");
+ snprintf(pre, sizeof(pre), "<p>%s ", translate("gettextFromC", "Water Temp:"));
+ put_HTML_watertemp(b, dive, pre, "</p>");
+ snprintf(pre, sizeof(pre), "<p>%s <b>", translate("gettextFromC", "Location:"));
+ put_string(b, pre);
put_HTML_quoted(b, dive->location);
put_string(b, "</b></p>");
- put_HTML_notes(b, dive, translate("gettextFromC", "<p> Notes"), " </p>");
+ snprintf(pre, sizeof(pre), "<p> %s ", translate("gettextFromC", "Notes:"));
+ put_HTML_notes(b, dive, pre, " </p>");
put_string(b, "</p>'+'</div>'+'</div>'});\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);