]> git.street.me.uk Git - andy/viking.git/commitdiff
Make more text translatable
authorhuobos <huobos@yahoo.com>
Fri, 17 Feb 2017 22:51:22 +0000 (22:51 +0000)
committerRob Norris <rw_norris@hotmail.com>
Sat, 25 Feb 2017 17:25:07 +0000 (17:25 +0000)
Signed-off-by: Rob Norris <rw_norris@hotmail.com>
src/datasource_gc.c
src/dialog.c
src/geonamessearch.c
src/globals.c
src/main.c
src/osm.c
src/vikdemlayer.c
src/vikmapniklayer.c

index 8ec83e544aa169bb5398b0b07325862a85aa9aea..1d489874c25615946c1fd7cdf9c583cb9c02156f 100644 (file)
@@ -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";
index e9eb283e28fc0f0a06b475b6c4666ead0362520e..0b4156c9508730d64a812bebf26b5baf02e91e76 100644 (file)
@@ -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)
index df28350ad7dc78a5d9b4ccb17ba0534df6176768..9ee698c2e5dd7f8cf1eda30ae8fdb22ee116d5b9 100644 (file)
@@ -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 );
index b4f2b5f90721f49f932a3914a64f67eab2df233f..072ca73a719c33969e45f68abdf21c67fdffb158 100644 (file)
@@ -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};
index d931f1a741b970392c038f15c2826f77cde0abfc..e5400f06b506b4776687710b4605a6ce27d17585 100644 (file)
@@ -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;
   }
 
index 87694a8f44ed1c028b9d99382f1184371b0e032a..a9a3771daf0bf3b6e93de5d54d574abd70eb37f8 100644 (file)
--- 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));
 
index 934a755964a5409c8e06a86a384cdcdb33be14bf..7df1a57ad735c6bfe45293cf59cca4c6bf7e1f53 100644 (file)
@@ -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
index 88b0445d34bd93d7b6a15c4d9e8e1dfc9e08d779..47cd4e887fd52d1241c34a1a5d84de84fcff02e2 100644 (file)
@@ -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();