diff options
author | Dirk Hohndel <dirk@hohndel.org> | 2013-01-29 01:27:36 -0800 |
---|---|---|
committer | Dirk Hohndel <dirk@hohndel.org> | 2013-01-29 20:32:56 +1100 |
commit | a61877d1d4efdd1ed295d31b0b3042ca44747b25 (patch) | |
tree | 74b3112bdbcc45a79c2c1a7f7415014fbaf1ee60 | |
parent | 8d6dd5f87d38fa25769e900028781fa1e851ebc5 (diff) | |
download | subsurface-a61877d1d4efdd1ed295d31b0b3042ca44747b25.tar.gz |
Add missing strings for translations
Mostly in new code, but some of them are strings in older code that have
been missed in the past.
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
-rw-r--r-- | gps.c | 2 | ||||
-rw-r--r-- | gtk-gui.c | 6 | ||||
-rw-r--r-- | info.c | 4 | ||||
-rw-r--r-- | libdivecomputer.c | 2 | ||||
-rw-r--r-- | planner.c | 40 | ||||
-rw-r--r-- | profile.c | 34 | ||||
-rw-r--r-- | uemis-downloader.c | 20 |
7 files changed, 54 insertions, 54 deletions
@@ -179,7 +179,7 @@ void show_map(OsmGpsMap *map, GtkWidget **window, struct dive *dive, void (*call *window = gtk_window_new(GTK_WINDOW_TOPLEVEL); gtk_window_set_position(GTK_WINDOW(*window), GTK_WIN_POS_MOUSE); gtk_window_set_default_size(GTK_WINDOW(*window), 640, 480); - gtk_window_set_title(GTK_WINDOW(*window), _("Dives locations")); + gtk_window_set_title(GTK_WINDOW(*window), _("Dive locations")); gtk_container_set_border_width(GTK_CONTAINER(*window), 5); gtk_window_set_resizable(GTK_WINDOW(*window), TRUE); gtk_container_add(GTK_CONTAINER(*window), GTK_WIDGET(map)); @@ -1268,17 +1268,17 @@ static void edit_dc_nicknames(GtkWidget *w, gpointer data) /* columns */ renderer = gtk_cell_renderer_text_new(); g_object_set(renderer, "background", C_INACTIVE, NULL); - gtk_tree_view_insert_column_with_attributes(GTK_TREE_VIEW(view), -1, "Model", + gtk_tree_view_insert_column_with_attributes(GTK_TREE_VIEW(view), -1, _("Model"), renderer, "text", NE_MODEL, NULL); renderer = gtk_cell_renderer_text_new(); g_object_set(renderer, "background", C_INACTIVE, NULL); - gtk_tree_view_insert_column_with_attributes(GTK_TREE_VIEW(view), -1, "Device Id", + gtk_tree_view_insert_column_with_attributes(GTK_TREE_VIEW(view), -1, _("Device Id"), renderer, "text", NE_ID_STR, NULL); renderer = gtk_cell_renderer_text_new(); g_object_set(renderer, "background", C_INACTIVE, NULL); - gtk_tree_view_insert_column_with_attributes(GTK_TREE_VIEW(view), -1, "Nickname", + gtk_tree_view_insert_column_with_attributes(GTK_TREE_VIEW(view), -1, _("Nickname"), renderer, "text", NE_NICKNAME, NULL); g_object_set(renderer, "editable", TRUE, NULL); g_object_set(renderer, "background", C_ACTIVE, NULL); @@ -625,8 +625,8 @@ void print_gps_coordinates(char *buffer, int len, float lat, float lon) float latmin, lonmin; char *lath, *lonh; - lath = lat >= 0.0 ? "N" : "S"; - lonh = lon >= 0.0 ? "E" : "W"; + lath = lat >= 0.0 ? _("N") : _("S"); + lonh = lon >= 0.0 ? _("E") : _("W"); lat = fabs(lat); lon = fabs(lon); latdeg = lat; diff --git a/libdivecomputer.c b/libdivecomputer.c index 3a32c5d97..e0d180906 100644 --- a/libdivecomputer.c +++ b/libdivecomputer.c @@ -753,7 +753,7 @@ GError *do_import(device_data_t *data) switch (result) { case GTK_RESPONSE_CANCEL: import_thread_cancelled = TRUE; - progress_bar_text = "Cancelled..."; + progress_bar_text = _("Cancelled..."); break; default: /* nothing */ @@ -188,7 +188,7 @@ struct dive *create_dive_from_plan(struct diveplan *diveplan) dive->when = diveplan->when; dive->dc.surface_pressure.mbar = diveplan->surface_pressure; dc = &dive->dc; - dc->model = strdup("Simulated Dive"); + dc->model = strdup(_("Simulated Dive")); dp = diveplan->dp; /* let's start with the gas given on the first segment */ @@ -458,7 +458,7 @@ static void add_plan_to_notes(struct diveplan *diveplan, struct dive *dive) if (!dp) return; - snprintf(buffer, sizeof(buffer), "Subsurface dive plan\nbased on GFlow = %.0f and GFhigh = %.0f\n\n", + snprintf(buffer, sizeof(buffer), _("Subsurface dive plan\nbased on GFlow = %.0f and GFhigh = %.0f\n\n"), plangflow * 100, plangfhigh * 100); /* we start with gas 0, then check if that was changed */ o2 = dive->cylinder[0].gasmix.o2.permille; @@ -499,7 +499,7 @@ static void add_plan_to_notes(struct diveplan *diveplan, struct dive *dive) if (dp->depth != lastdepth) { used = diveplan->bottomsac / 1000.0 * depth_to_mbar((dp->depth + lastdepth) / 2, dive) * (dp->time - lasttime) / 60; - snprintf(buffer + len, sizeof(buffer) - len, "Transition to %.*f %s in %d:%02d min - runtime %d:%02u on %s\n", + snprintf(buffer + len, sizeof(buffer) - len, _("Transition to %.*f %s in %d:%02d min - runtime %d:%02u on %s\n"), decimals, depthvalue, depth_unit, FRACTION(dp->time - lasttime, 60), FRACTION(dp->time, 60), @@ -508,7 +508,7 @@ static void add_plan_to_notes(struct diveplan *diveplan, struct dive *dive) /* we use deco SAC rate during the calculated deco stops, bottom SAC rate everywhere else */ int sac = dp->entered ? diveplan->bottomsac : diveplan->decosac; used = sac / 1000.0 * depth_to_mbar(dp->depth, dive) * (dp->time - lasttime) / 60; - snprintf(buffer + len, sizeof(buffer) - len, "Stay at %.*f %s for %d:%02d min - runtime %d:%02u on %s\n", + snprintf(buffer + len, sizeof(buffer) - len, _("Stay at %.*f %s for %d:%02d min - runtime %d:%02u on %s\n"), decimals, depthvalue, depth_unit, FRACTION(dp->time - lasttime, 60), FRACTION(dp->time, 60), @@ -518,7 +518,7 @@ static void add_plan_to_notes(struct diveplan *diveplan, struct dive *dive) get_gas_string(newo2, newhe, gas, 12); if (o2 != newo2 || he != newhe) { len = strlen(buffer); - snprintf(buffer + len, sizeof(buffer) - len, "Switch gas to %s\n", gas); + snprintf(buffer + len, sizeof(buffer) - len, _("Switch gas to %s\n"), gas); } o2 = newo2; he = newhe; @@ -526,7 +526,7 @@ static void add_plan_to_notes(struct diveplan *diveplan, struct dive *dive) lastdepth = dp->depth; } while((dp = dp->next) != NULL); len = strlen(buffer); - snprintf(buffer + len, sizeof(buffer) - len, "Gas consumption:\n"); + snprintf(buffer + len, sizeof(buffer) - len, _("Gas consumption:\n")); for (gasidx = 0; gasidx < MAX_CYLINDERS; gasidx++) { double volume; const char *unit; @@ -537,7 +537,7 @@ static void add_plan_to_notes(struct diveplan *diveplan, struct dive *dive) volume = get_volume_units(consumption[gasidx], NULL, &unit); get_gas_string(dive->cylinder[gasidx].gasmix.o2.permille, dive->cylinder[gasidx].gasmix.he.permille, gas, 12); - snprintf(buffer + len, sizeof(buffer) - len, "%.0f%s of %s\n", volume, unit, gas); + snprintf(buffer + len, sizeof(buffer) - len, _("%.0f%s of %s\n"), volume, unit, gas); } dive->notes = strdup(buffer); } @@ -722,9 +722,9 @@ static int validate_gas(const char *text, int *o2_p, int *he_p) if (!*text) return 0; - if (!strcasecmp(text, "air")) { + if (!strcasecmp(text, _("air"))) { o2 = O2_IN_AIR; he = 0; text += 3; - } else if (!strncasecmp(text, "ean", 3)) { + } else if (!strncasecmp(text, _("ean"), 3)) { o2 = get_permille(text+3, &text); he = 0; } else { o2 = get_permille(text, &text); he = 0; @@ -828,7 +828,7 @@ static int validate_depth(const char *text, int *mm_p) if (*text == 'm') { imperial = 0; text++; - } else if (!strcasecmp(text, "ft")) { + } else if (!strcasecmp(text, _("ft"))) { imperial = 1; text += 2; } @@ -887,13 +887,13 @@ static int validate_volume(const char *text, int *sac) if (*text == 'l') { imperial = 0; text++; - } else if (!strncasecmp(text, "cuft", 4)) { + } else if (!strncasecmp(text, _("cuft"), 4)) { imperial = 1; text += 4; } while (isspace(*text) || *text == '/') text++; - if (!strncasecmp(text, "min", 3)) + if (!strncasecmp(text, _("min"), 3)) text += 3; while (isspace(*text)) text++; @@ -1103,9 +1103,9 @@ static GtkWidget *add_gas_combobox_to_box(GtkWidget *box, const char *label, int if (!gas_model) { gas_model = gtk_list_store_new(1, G_TYPE_STRING); - add_string_list_entry("AIR", gas_model); - add_string_list_entry("EAN32", gas_model); - add_string_list_entry("EAN36", gas_model); + add_string_list_entry(_("AIR"), gas_model); + add_string_list_entry(_("EAN32"), gas_model); + add_string_list_entry(_("EAN36"), gas_model); } combo = combo_box_with_model_and_entry(gas_model); gtk_widget_add_events(combo, GDK_FOCUS_CHANGE_MASK); @@ -1201,7 +1201,7 @@ void input_plan() "An entry that has a depth and a gas given but no time is special; it " "informs the planner that the gas specified is available for the ascent " "once the depth given has been reached.\n" - "CC SetPoint specifies CC dives, leave empty for OC.</small>")); + "CC SetPoint specifies CC (rebreather) dives, leave empty for OC.</small>")); gtk_label_set_line_wrap(GTK_LABEL(label), TRUE); gtk_label_set_use_markup(GTK_LABEL(label), TRUE); gtk_box_pack_start(GTK_BOX(outervbox), label, TRUE, TRUE, 0); @@ -1215,13 +1215,13 @@ void input_plan() hbox = gtk_hbox_new(FALSE, 0); gtk_box_pack_start(GTK_BOX(vbox), hbox, TRUE, TRUE, 0); if (get_units()->volume == CUFT) { - bottom_sac = "0.7 cuft/min"; - deco_sac = "0.6 cuft/min"; + bottom_sac = _("0.7 cuft/min"); + deco_sac = _("0.6 cuft/min"); diveplan.bottomsac = 1000 * cuft_to_l(0.7); diveplan.decosac = 1000 * cuft_to_l(0.6); } else { - bottom_sac = "20 l/min"; - deco_sac = "17 l/min"; + bottom_sac = _("20 l/min"); + deco_sac = _("17 l/min"); diveplan.bottomsac = 20000; diveplan.decosac = 17000; } @@ -399,7 +399,7 @@ static void plot_one_event(struct graphics_context *gc, struct plot_info *pi, st _(event->name), _("air")); else snprintf(buffer, sizeof(buffer), "%s: %u%% %s", - _(event->name), o2, _("O" UTF8_SUBSCRIPT_2)); + _(event->name), o2, "O" UTF8_SUBSCRIPT_2); } } else { snprintf(buffer, sizeof(buffer), "%s: %d", _(event->name), event->value); @@ -2081,21 +2081,21 @@ static void plot_string(struct plot_data *entry, char *buf, size_t bufsize, double depthvalue, tempvalue; depthvalue = get_depth_units(depth, NULL, &depth_unit); - snprintf(buf, bufsize, "D:%.1f %s", depthvalue, depth_unit); + snprintf(buf, bufsize, _("D:%.1f %s"), depthvalue, depth_unit); if (pressure) { pressurevalue = get_pressure_units(pressure, &pressure_unit); memcpy(buf2, buf, bufsize); - snprintf(buf, bufsize, "%s\nP:%d %s", buf2, pressurevalue, pressure_unit); + snprintf(buf, bufsize, _("%s\nP:%d %s"), buf2, pressurevalue, pressure_unit); } if (temp) { tempvalue = get_temp_units(temp, &temp_unit); memcpy(buf2, buf, bufsize); - snprintf(buf, bufsize, "%s\nT:%.1f %s", buf2, tempvalue, temp_unit); + snprintf(buf, bufsize, _("%s\nT:%.1f %s"), buf2, tempvalue, temp_unit); } if (entry->ceiling) { depthvalue = get_depth_units(entry->ceiling, NULL, &depth_unit); memcpy(buf2, buf, bufsize); - snprintf(buf, bufsize, "%s\nCalculated ceiling %.0f %s", buf2, depthvalue, depth_unit); + snprintf(buf, bufsize, _("%s\nCalculated ceiling %.0f %s"), buf2, depthvalue, depth_unit); } if (entry->stopdepth) { depthvalue = get_depth_units(entry->stopdepth, NULL, &depth_unit); @@ -2103,55 +2103,55 @@ static void plot_string(struct plot_data *entry, char *buf, size_t bufsize, if (entry->ndl) { /* this is a safety stop as we still have ndl */ if (entry->stoptime) - snprintf(buf, bufsize, "%s\nSafetystop:%umin @ %.0f %s", buf2, entry->stoptime / 60, + snprintf(buf, bufsize, _("%s\nSafetystop:%umin @ %.0f %s"), buf2, entry->stoptime / 60, depthvalue, depth_unit); else - snprintf(buf, bufsize, "%s\nSafetystop:unkn time @ %.0f %s", buf2, + snprintf(buf, bufsize, _("%s\nSafetystop:unkn time @ %.0f %s"), buf2, depthvalue, depth_unit); } else { /* actual deco stop */ if (entry->stoptime) - snprintf(buf, bufsize, "%s\nDeco:%umin @ %.0f %s", buf2, entry->stoptime / 60, + snprintf(buf, bufsize, _("%s\nDeco:%umin @ %.0f %s"), buf2, entry->stoptime / 60, depthvalue, depth_unit); else - snprintf(buf, bufsize, "%s\nDeco:unkn time @ %.0f %s", buf2, + snprintf(buf, bufsize, _("%s\nDeco:unkn time @ %.0f %s"), buf2, depthvalue, depth_unit); } } else if (entry->in_deco) { /* this means we had in_deco set but don't have a stop depth */ memcpy(buf2, buf, bufsize); - snprintf(buf, bufsize, "%s\nIn deco", buf2); + snprintf(buf, bufsize, _("%s\nIn deco"), buf2); } else if (has_ndl) { memcpy(buf2, buf, bufsize); - snprintf(buf, bufsize, "%s\nNDL:%umin", buf2, entry->ndl / 60); + snprintf(buf, bufsize, _("%s\nNDL:%umin"), buf2, entry->ndl / 60); } if (entry->cns) { memcpy(buf2, buf, bufsize); - snprintf(buf, bufsize, "%s\nCNS:%u%%", buf2, entry->cns); + snprintf(buf, bufsize, _("%s\nCNS:%u%%"), buf2, entry->cns); } if (prefs.pp_graphs.po2) { memcpy(buf2, buf, bufsize); - snprintf(buf, bufsize, "%s\npO" UTF8_SUBSCRIPT_2 ":%.2fbar", buf2, entry->po2); + snprintf(buf, bufsize, _("%s\npO%s:%.2fbar"), buf2, UTF8_SUBSCRIPT_2, entry->po2); } if (prefs.pp_graphs.pn2) { memcpy(buf2, buf, bufsize); - snprintf(buf, bufsize, "%s\npN" UTF8_SUBSCRIPT_2 ":%.2fbar", buf2, entry->pn2); + snprintf(buf, bufsize, _("%s\npN%s:%.2fbar"), buf2, UTF8_SUBSCRIPT_2, entry->pn2); } if (prefs.pp_graphs.phe) { memcpy(buf2, buf, bufsize); - snprintf(buf, bufsize, "%s\npHe:%.2fbar", buf2, entry->phe); + snprintf(buf, bufsize, _("%s\npHe:%.2fbar"), buf2, entry->phe); } if (prefs.mod) { mod = (int)get_depth_units(entry->mod, NULL, &depth_unit); memcpy(buf2, buf, bufsize); - snprintf(buf, bufsize, "%s\nMOD:%d%s", buf2, mod, depth_unit); + snprintf(buf, bufsize, _("%s\nMOD:%d%s"), buf2, mod, depth_unit); } if (prefs.ead) { ead = (int)get_depth_units(entry->ead, NULL, &depth_unit); end = (int)get_depth_units(entry->end, NULL, &depth_unit); eadd = (int)get_depth_units(entry->eadd, NULL, &depth_unit); memcpy(buf2, buf, bufsize); - snprintf(buf, bufsize, "%s\nEAD:%d%s\nEND:%d%s\nEADD:%d%s", buf2, ead, depth_unit, end, depth_unit, eadd, depth_unit); + snprintf(buf, bufsize, _("%s\nEAD:%d%s\nEND:%d%s\nEADD:%d%s"), buf2, ead, depth_unit, end, depth_unit, eadd, depth_unit); } free(buf2); } diff --git a/uemis-downloader.c b/uemis-downloader.c index 6a20a0af1..8274884e6 100644 --- a/uemis-downloader.c +++ b/uemis-downloader.c @@ -130,7 +130,7 @@ static void uemis_get_weight(char *buffer, weightsystem_t *weight, int diveid) { weight->weight.grams = uemis_get_weight_unit(diveid) ? lbs_to_grams(g_ascii_strtod(buffer, NULL)) : g_ascii_strtod(buffer, NULL) * 1000; - weight->description = strdup("unknown"); + weight->description = strdup(_("unknown")); } static struct dive *uemis_start_dive(uint32_t deviceid) @@ -587,9 +587,9 @@ static void track_divespot(char *val, int diveid, char **location, degrees_t *la return; } -static char *suit[] = { "", "wetsuit", "semidry", "drysuit" }; -static char *suit_type[] = { "", "shorty", "vest", "long john", "jacket", "full suit", "2 pcs full suit" }; -static char *suit_thickness[] = { "", "0.5-2mm", "2-3mm", "3-5mm", "5-7mm", "8mm+", "membrane" }; +static char *suit[] = { "", N_("wetsuit"), N_("semidry"), N_("drysuit") }; +static char *suit_type[] = { "", N_("shorty"), N_("vest"), N_("long john"), N_("jacket"), N_("full suit"), N_("2 pcs full suit") }; +static char *suit_thickness[] = { "", "0.5-2mm", "2-3mm", "3-5mm", "5-7mm", "8mm+", N_("membrane") }; static void parse_tag(struct dive *dive, char *tag, char *val) { @@ -610,11 +610,11 @@ static void parse_tag(struct dive *dive, char *tag, char *val) else if (!strcmp(tag, "notes")) uemis_add_string(val, &dive->notes); else if (!strcmp(tag, "u8DiveSuit")) - uemis_add_string(suit[atoi(val)], &dive->suit); + uemis_add_string(_(suit[atoi(val)]), &dive->suit); else if (!strcmp(tag, "u8DiveSuitType")) - uemis_add_string(suit_type[atoi(val)], &dive->suit); + uemis_add_string(_(suit_type[atoi(val)]), &dive->suit); else if (!strcmp(tag, "u8SuitThickness")) - uemis_add_string(suit_thickness[atoi(val)], &dive->suit); + uemis_add_string(_(suit_thickness[atoi(val)]), &dive->suit); } /* This function is called for both divelog and dive information that we get @@ -759,7 +759,7 @@ static char *do_uemis_download(struct argument_block *args) if (dive_table.nr == 0) keep_number = TRUE; - uemis_info("Init Communication"); + uemis_info(_("Init Communication")); if (! uemis_init(mountpath)) return _("Uemis init failed"); if (! uemis_get_answer(mountpath, "getDeviceId", 0, 1, &result)) @@ -772,7 +772,7 @@ static char *do_uemis_download(struct argument_block *args) /* param_buff[0] is still valid */ if (! uemis_get_answer(mountpath, "initSession", 1, 6, &result)) goto bail; - uemis_info("Start download"); + uemis_info(_("Start download")); if (! uemis_get_answer(mountpath, "processSync", 0, 2, &result)) goto bail; /* before starting the long download, check if user pressed cancel */ @@ -906,7 +906,7 @@ GError *uemis_download(const char *mountpath, progressbar_t *progress, import_thread_cancelled = TRUE; } else { update_progressbar(args.progress, progress_bar_fraction); - update_progressbar_text(args.progress, "Cancelled, exiting cleanly..."); + update_progressbar_text(args.progress, _("Cancelled, exiting cleanly...")); usleep(100000); } } |