gdk_threads_enter();
if (w->ok) {
gps_user_data_t *gps_data = (gps_user_data_t *)w->user_data;
- s = g_strdup_printf(_("Downloading %d %s..."), cnt, (gps_data->progress_label == gps_data->wp_label) ? _("waypoints") : _("trackpoints"));
+ const gchar *tmp_str;
+ if (gps_data->progress_label == gps_data->wp_label)
+ tmp_str = ngettext("Downloading %d waypoint...", "Downloading %d waypoints...", cnt);
+ else
+ tmp_str = ngettext("Downloading %d trackpoint...", "Downloading %d trackpoints...", cnt);
+ s = g_strdup_printf(tmp_str, cnt);
gtk_label_set_text ( GTK_LABEL(gps_data->progress_label), s );
gtk_widget_show ( gps_data->progress_label );
gps_data->total_count = cnt;
gdk_threads_enter();
g_mutex_lock(sess->mutex);
if (sess->ok) {
- g_sprintf(s, "%s %d %s...",
- (sess->direction == GPS_DOWN) ? _("Downloading") : _("Uploading"), cnt,
- (sess->progress_label == sess->wp_label) ? _("waypoints") : _("trackpoints"));
+ const gchar *tmp_str;
+ if (sess->direction == GPS_DOWN)
+ {
+ if (sess->progress_label == sess->wp_label)
+ tmp_str = ngettext("Downloading %d waypoint", "Downloading %d waypoints", cnt);
+ else
+ tmp_str = ngettext("Downloading %d trackpoint", "Downloading %d trackpoints", cnt);
+ }
+ else
+ {
+ if (sess->progress_label == sess->wp_label)
+ tmp_str = ngettext("Uploading %d waypoint", "Uploading %d waypoints", cnt);
+ else
+ tmp_str = ngettext("Uploading %d trackpoint", "Uploading %d trackpoints", cnt);
+ }
+
+ g_snprintf(s, 128, tmp_str, cnt);
gtk_label_set_text ( GTK_LABEL(sess->progress_label), s );
gtk_widget_show ( sess->progress_label );
sess->total_count = cnt;
static void set_current_count(gint cnt, GpsSession *sess)
{
gchar s[128];
- const gchar *dir_str = (sess->direction == GPS_DOWN) ? _("Downloaded") : _("Uploaded");
+ const gchar *tmp_str;
gdk_threads_enter();
g_mutex_lock(sess->mutex);
if (sess->ok) {
if (cnt < sess->total_count) {
- g_sprintf(s, _("%s %d out of %d %s..."), dir_str, cnt, sess->total_count, (sess->progress_label == sess->wp_label) ? _("waypoints") : _("trackpoints"));
+ if (sess->direction == GPS_DOWN)
+ {
+ if (sess->progress_label == sess->wp_label)
+ tmp_str = ngettext("Downloaded %d out of %d waypoint...", "Downloaded %d out of %d waypoints...", sess->total_count);
+ else
+ tmp_str = ngettext("Downloaded %d out of %d trackpoint...", "Downloaded %d out of %d trackpoints...", sess->total_count);
+ }
+ else {
+ if (sess->progress_label == sess->wp_label)
+ tmp_str = ngettext("Uploaded %d out of %d waypoint...", "Uploaded %d out of %d waypoints...", sess->total_count);
+ else
+ tmp_str = ngettext("Uploaded %d out of %d trackpoint...", "Uploaded %d out of %d trackpoints...", sess->total_count);
+ }
+ g_snprintf(s, 128, tmp_str, cnt, sess->total_count);
} else {
- g_sprintf(s, "%s %d %s.", dir_str, cnt, (sess->progress_label == sess->wp_label) ? _("waypoints") : _("trackpoints"));
+ if (sess->direction == GPS_DOWN)
+ {
+ if (sess->progress_label == sess->wp_label)
+ tmp_str = ngettext("Downloaded %d waypoint.", "Downloaded %d waypoints...", cnt);
+ else
+ tmp_str = ngettext("Downloaded %d trackpoint.", "Downloaded %d trackpoints...", cnt);
+ }
+ else {
+ if (sess->progress_label == sess->wp_label)
+ tmp_str = ngettext("Uploaded %d waypoint.", "Uploaded %d waypoints...", cnt);
+ else
+ tmp_str = ngettext("Uploaded %d trackpoint.", "Uploaded %d trackpoints...", cnt);
+ }
+ g_snprintf(s, 128, tmp_str, cnt);
}
gtk_label_set_text ( GTK_LABEL(sess->progress_label), s );
}
gdk_threads_enter();
g_mutex_lock(sess->mutex);
if (sess->ok) {
- g_sprintf(s, _("GPS Device: %s"), info);
+ g_snprintf(s, 256, _("GPS Device: %s"), info);
gtk_label_set_text ( GTK_LABEL(sess->gps_label), s );
}
g_mutex_unlock(sess->mutex);
if ( mdi->mapstoget )
{
- gchar *tmp = g_strdup_printf ( "%s %s%d %s %s...", redownload ? _("Redownloading") : _("Downloading"), redownload == REDOWNLOAD_BAD ? _("up to ") : "", mdi->mapstoget, MAPS_LAYER_NTH_LABEL(vml->maptype), ngettext("map", "maps", mdi->mapstoget) );
+ const gchar *tmp_str;
+ gchar *tmp;
+ if (redownload)
+ {
+ if (redownload == REDOWNLOAD_BAD)
+ tmp_str = ngettext("Redownloading up to %d %s map...", "Redownloading up to %d %s maps...", mdi->mapstoget);
+ else
+ tmp_str = ngettext("Redownloading %d %s map...", "Redownloading %d %s maps...", mdi->mapstoget);
+ }
+ else
+ {
+ tmp_str = ngettext("Downloading %d %s map...", "Downloading %d %s maps...", mdi->mapstoget);
+ }
+ tmp = g_strdup_printf ( tmp_str, mdi->mapstoget, MAPS_LAYER_NTH_LABEL(vml->maptype));
+
g_object_weak_ref(G_OBJECT(mdi->vml), weak_ref_cb, mdi);
/* launch the thread */
a_background_thread ( VIK_GTK_WINDOW_FROM_LAYER(vml), /* parent window */