From 14dd983af89af47faf070fbfd6381871c1dce033 Mon Sep 17 00:00:00 2001 From: huobos Date: Fri, 17 Feb 2017 22:51:22 +0000 Subject: [PATCH] Make more text translatable Signed-off-by: Rob Norris --- src/datasource_gc.c | 2 +- src/dialog.c | 3 ++- src/geonamessearch.c | 14 ++++++++------ src/globals.c | 6 +++--- src/main.c | 2 +- src/osm.c | 12 ++++++------ src/vikdemlayer.c | 2 +- src/vikmapniklayer.c | 2 +- 8 files changed, 23 insertions(+), 20 deletions(-) diff --git a/src/datasource_gc.c b/src/datasource_gc.c index 8ec83e54..1d489874 100644 --- a/src/datasource_gc.c +++ b/src/datasource_gc.c @@ -89,7 +89,7 @@ static VikLayerParam prefs[] = { void a_datasource_gc_init() { - a_preferences_register_group ( VIKING_GC_PARAMS_GROUP_KEY, "Geocaching" ); + a_preferences_register_group ( VIKING_GC_PARAMS_GROUP_KEY, _("Geocaching") ); VikLayerParamData tmp; tmp.s = "username"; diff --git a/src/dialog.c b/src/dialog.c index e9eb283e..0b4156c9 100644 --- a/src/dialog.c +++ b/src/dialog.c @@ -613,7 +613,7 @@ void a_dialog_about ( GtkWindow *parent ) { const gchar *version = VIKING_VERSION; const gchar *website = VIKING_URL; - const gchar *copyright = "2003-2008, Evan Battaglia\n2008-"THEYEAR", Viking's contributors"; + gchar *copyright = g_strdup_printf(_("2003-2008, Evan Battaglia\n2008-%s, Viking's contributors"), THEYEAR); const gchar *comments = _("GPS Data and Topo Analyzer, Explorer, and Manager."); const gchar *license = _("This program is free software; you can redistribute it and/or modify " "it under the terms of the GNU General Public License as published by " @@ -705,6 +705,7 @@ void a_dialog_about ( GtkWindow *parent ) "translator-credits", _("Translation is coordinated on http://launchpad.net/viking"), "artists", libs, NULL); + g_free(copyright); } gboolean a_dialog_map_n_zoom(GtkWindow *parent, gchar *mapnames[], gint default_map, gchar *zoom_list[], gint default_zoom, gint *selected_map, gint *selected_zoom) diff --git a/src/geonamessearch.c b/src/geonamessearch.c index df28350a..9ee698c2 100644 --- a/src/geonamessearch.c +++ b/src/geonamessearch.c @@ -456,7 +456,7 @@ void a_geonames_wikipedia_box ( VikWindow *vw, VikTrwLayer *vtl, struct LatLon m none_found(vw); goto done; } - selected = a_select_geoname_from_list(VIK_GTK_WINDOW_FROM_WIDGET(vw), wiki_places, TRUE, "Select articles", "Select the articles you want to add."); + selected = a_select_geoname_from_list(VIK_GTK_WINDOW_FROM_WIDGET(vw), wiki_places, TRUE, _("Select articles"), _("Select the articles you want to add.")); wp_runner = selected; while (wp_runner) { wiki_geoname = (found_geoname *)wp_runner->data; @@ -469,16 +469,18 @@ void a_geonames_wikipedia_box ( VikWindow *vw, VikTrwLayer *vtl, struct LatLon m // Use the featue type to generate a suitable waypoint icon // http://www.geonames.org/wikipedia/wikipedia_features.html // Only a few values supported as only a few symbols make sense + // The feature name may not be translated + // Double check the english and the translated if ( wiki_geoname->feature ) { - if ( !strcmp (wiki_geoname->feature, "city") ) + if ( !strcmp (wiki_geoname->feature, "city") || !strcmp (wiki_geoname->feature, _("city"))) vik_waypoint_set_symbol(wiki_wp, "city (medium)"); - if ( !strcmp (wiki_geoname->feature, "edu") ) + if ( !strcmp (wiki_geoname->feature, "edu") || !strcmp (wiki_geoname->feature, _("edu"))) vik_waypoint_set_symbol(wiki_wp, "school"); - if ( !strcmp (wiki_geoname->feature, "airport") ) + if ( !strcmp (wiki_geoname->feature, "airport") || !strcmp (wiki_geoname->feature, _("airport"))) vik_waypoint_set_symbol(wiki_wp, "airport"); - if ( !strcmp (wiki_geoname->feature, "mountain") ) + if ( !strcmp (wiki_geoname->feature, "mountain") || !strcmp (wiki_geoname->feature, _("mountain"))) vik_waypoint_set_symbol(wiki_wp, "summit"); - if ( !strcmp (wiki_geoname->feature, "forest") ) + if ( !strcmp (wiki_geoname->feature, "forest") || !strcmp (wiki_geoname->feature, _("forest"))) vik_waypoint_set_symbol(wiki_wp, "forest"); } vik_trw_layer_filein_add_waypoint ( vtl, wiki_geoname->name, wiki_wp ); diff --git a/src/globals.c b/src/globals.c index b4f2b5f9..072ca73a 100644 --- a/src/globals.c +++ b/src/globals.c @@ -64,10 +64,10 @@ gint viking_version_to_number ( gchar *version ) return version_number; } -static gchar * params_degree_formats[] = {"DDD", "DMM", "DMS", N_("Raw"), NULL}; +static gchar * params_degree_formats[] = {N_("DDD"), N_("DMM"), N_("DMS"), N_("Raw"), NULL}; static gchar * params_units_distance[] = {N_("Kilometres"), N_("Miles"), N_("Nautical Miles"), NULL}; -static gchar * params_units_speed[] = {"km/h", "mph", "m/s", "knots", NULL}; -static gchar * params_units_height[] = {"Metres", "Feet", NULL}; +static gchar * params_units_speed[] = {N_("km/h"), N_("mph"), N_("m/s"), N_("knots"), NULL}; +static gchar * params_units_height[] = {N_("Metres"), N_("Feet"), NULL}; static VikLayerParamScale params_scales_lat[] = { {-90.0, 90.0, 0.05, 2} }; static VikLayerParamScale params_scales_long[] = { {-180.0, 180.0, 0.05, 2} }; static gchar * params_time_ref_frame[] = {N_("Locale"), N_("World"), N_("UTC"), NULL}; diff --git a/src/main.c b/src/main.c index d931f1a7..e5400f06 100644 --- a/src/main.c +++ b/src/main.c @@ -157,7 +157,7 @@ int main( int argc, char *argv[] ) if (vik_version) { - (void)g_printf ("%s %s\nCopyright (c) 2003-2008 Evan Battaglia\nCopyright (c) 2008-"THEYEAR" Viking's contributors\n", PACKAGE_NAME, PACKAGE_VERSION); + (void)g_printf (_("%s %s\nCopyright (c) 2003-2008 Evan Battaglia\nCopyright (c) 2008-%s Viking's contributors\n"), PACKAGE_NAME, PACKAGE_VERSION, THEYEAR); return EXIT_SUCCESS; } diff --git a/src/osm.c b/src/osm.c index 87694a8f..a9a3771d 100644 --- a/src/osm.c +++ b/src/osm.c @@ -47,7 +47,7 @@ void osm_init () { VikMapSource *mapnik_type = VIK_MAP_SOURCE(g_object_new(VIK_TYPE_SLIPPY_MAP_SOURCE, "id", MAP_ID_OSM_MAPNIK, - "label", "OpenStreetMap (Mapnik)", + "label", _("OpenStreetMap (Mapnik)"), "name", "OSM-Mapnik", "hostname", "tile.openstreetmap.org", "url", "/%d/%d/%d.png", @@ -62,7 +62,7 @@ void osm_init () { VikMapSource *cycle_type = VIK_MAP_SOURCE(g_object_new(VIK_TYPE_SLIPPY_MAP_SOURCE, "id", MAP_ID_OSM_CYCLE, - "label", "OpenStreetMap (Cycle)", + "label", _("OpenStreetMap (Cycle)"), "name", "OSM-Cycle", "hostname", "tile.opencyclemap.org", "url", "/cycle/%d/%d/%d.png", @@ -77,7 +77,7 @@ void osm_init () { VikMapSource *transport_type = VIK_MAP_SOURCE(g_object_new(VIK_TYPE_SLIPPY_MAP_SOURCE, "id", MAP_ID_OSM_TRANSPORT, - "label", "OpenStreetMap (Transport)", + "label", _("OpenStreetMap (Transport)"), "name", "OSM-Transport", "hostname", "tile2.opencyclemap.org", "url", "/transport/%d/%d/%d.png", @@ -93,7 +93,7 @@ void osm_init () { VIK_MAP_SOURCE(g_object_new(VIK_TYPE_SLIPPY_MAP_SOURCE, "id", MAP_ID_OSM_HUMANITARIAN, "name", "OSM-Humanitarian", - "label", "OpenStreetMap (Humanitarian)", + "label", _("OpenStreetMap (Humanitarian)"), "hostname", "c.tile.openstreetmap.fr", "url", "/hot/%d/%d/%d.png", "check-file-server-time", TRUE, @@ -145,14 +145,14 @@ void osm_init () { VIK_MAP_SOURCE(g_object_new(VIK_TYPE_SLIPPY_MAP_SOURCE, "id", MAP_ID_MAPBOX_OUTDOORS, "name", "Mapbox-Outdoors", - "label", "Mapbox Outdoors", + "label", _("Mapbox Outdoors"), "url", "https://api.tiles.mapbox.com/styles/v1/mapbox/outdoors-v9/tiles/256/%d/%d/%d?access_token=pk.eyJ1Ijoicndub3JyaXMiLCJhIjoiY2lxc294anN2MDA5bWhzbWFseWsxMW1ydiJ9.HcybKtZsiG6RVuOHg481Kg", "check-file-server-time", TRUE, "use-etag", FALSE, "zoom-min", 0, "zoom-max", 19, "copyright", "© Mapbox © OpenStreetMap", - "license", "Mapbox Specific", + "license", _("Mapbox Specific"), "license-url", "https://www.mapbox.com/tos", NULL)); diff --git a/src/vikdemlayer.c b/src/vikdemlayer.c index 934a7559..7df1a57a 100644 --- a/src/vikdemlayer.c +++ b/src/vikdemlayer.c @@ -82,7 +82,7 @@ static VikLayerParamScale param_scales[] = { }; static gchar *params_source[] = { - "SRTM Global 90m (3 arcsec)", + N_("SRTM Global 90m (3 arcsec)"), #ifdef VIK_CONFIG_DEM24K "USA 10m (USGS 24k)", #endif diff --git a/src/vikmapniklayer.c b/src/vikmapniklayer.c index 88b0445d..47cd4e88 100644 --- a/src/vikmapniklayer.c +++ b/src/vikmapniklayer.c @@ -274,7 +274,7 @@ static GHashTable *requests = NULL; */ void vik_mapnik_layer_init (void) { - a_preferences_register_group ( MAPNIK_PREFS_GROUP_KEY, "Mapnik" ); + a_preferences_register_group ( MAPNIK_PREFS_GROUP_KEY, _("Mapnik") ); guint i = 0; VikLayerParamData tmp = plugins_default(); -- 2.39.5