Repository: graphhopper/graphhopper
Pull request #1071 (2017-05-26 01:46:23)

Updated translations
I updated some of the translations.

I removed the `!` from the German and English finish translation. We don't use a `!` in the other instructions, why do we do this for the last one, seems a bit inconsistent?

I changed the German translation for `continue` to `dem Straßenverlauf folgen` and `continue_onto` to `dem Straßenverlauf von %1$s folgen`. These seem to better describe what is happening for the user.

I switched the translation for `finish`. I changed the case, since other translations usually start with a lower case, so I switched it for the finish instruction as well. Also I changed it to `arrive at destination`. I wasn't sure if `destination reached` would be a better translation. I choose to use `arrive at destination` as this seems to be the common phrase used by other routing engines. Usually they also add the name of the road, which could be a nice addition for use as well?

So it would be like `arrive at main road`.

Let me know if you are OK with the changes or if I should change anything. Translations are always very subjective, so let me know if you have a different opinion.

karussell: Thanks :+1: 

> We don't use a ! in the other instructions, why do we do this for the last one, seems a bit inconsistent?

Historical reasons (!!) ;)

> Usually they also add the name of the road, which could be a nice addition for use as well?

And and also the side but lets do this in another change.

Patch:
diff --git a/core/src/main/resources/com/graphhopper/util/de_DE.txt b/core/src/main/resources/com/graphhopper/util/de_DE.txt
index 6a8d8ac0a..2c8ab6fca 100644
--- a/core/src/main/resources/com/graphhopper/util/de_DE.txt
+++ b/core/src/main/resources/com/graphhopper/util/de_DE.txt
@@ -1,7 +1,7 @@
 # do not edit manually, instead use spreadsheet https://t.co/f086oJXAEI and script ./core/files/update-translations.sh
 
-continue=geradeaus
-continue_onto=geradeaus auf %1$s
+continue=dem Straßenverlauf folgen
+continue_onto=dem Straßenverlauf von %1$s folgen
 turn_left=links abbiegen
 turn_right=rechts abbiegen
 turn_slight_left=leicht links abbiegen
@@ -32,7 +32,7 @@ web.truck=LKW
 web.staticlink=Link
 web.motorcycle=Motorrad
 via=über
-finish=Ziel erreicht!
+finish=Ziel erreicht
 hour_abbr=h
 day_abbr=d
 min_abbr=min
diff --git a/core/src/main/resources/com/graphhopper/util/en_US.txt b/core/src/main/resources/com/graphhopper/util/en_US.txt
index e45c799c4..b0359f038 100644
--- a/core/src/main/resources/com/graphhopper/util/en_US.txt
+++ b/core/src/main/resources/com/graphhopper/util/en_US.txt
@@ -32,7 +32,7 @@ web.truck=Truck
 web.staticlink=static link
 web.motorcycle=Motorcycle
 via=via
-finish=Finish!
+finish=arrive at destination
 hour_abbr=h
 day_abbr=d
 min_abbr=min


Test patch:
diff --git a/core/src/test/java/com/graphhopper/routing/PathTest.java b/core/src/test/java/com/graphhopper/routing/PathTest.java
index acb8944f8..06932b1f6 100644
--- a/core/src/test/java/com/graphhopper/routing/PathTest.java
+++ b/core/src/test/java/com/graphhopper/routing/PathTest.java
@@ -86,7 +86,7 @@ public class PathTest {
         tmp = res.get(1);
         assertEquals(0.0, tmp.get("distance"));
         assertEquals(0L, tmp.get("time"));
-        assertEquals("Finish!", tmp.get("text"));
+        assertEquals("Arrive at destination", tmp.get("text"));
         assertEquals("[6, 6]", tmp.get("interval").toString());
         int lastIndex = (Integer) ((List) res.get(res.size() - 1).get("interval")).get(0);
         assertEquals(path.calcPoints().size() - 1, lastIndex);
@@ -219,7 +219,7 @@ public class PathTest {
             List<String> tmpList = pick("text", wayList.createJson());
             assertEquals(Arrays.asList("Continue onto MainStreet 1 2",
                     "At roundabout, take exit 3 onto 5-8",
-                    "Finish!"),
+                    "Arrive at destination"),
                     tmpList);
             // Test Radian
             double delta = roundaboutGraph.getAngle(1, 2, 5, 8);
@@ -233,7 +233,7 @@ public class PathTest {
             tmpList = pick("text", wayList.createJson());
             assertEquals(Arrays.asList("Continue onto MainStreet 1 2",
                     "At roundabout, take exit 2 onto MainStreet 4 7",
-                    "Finish!"),
+                    "Arrive at destination"),
                     tmpList);
             // Test Radian
             delta = roundaboutGraph.getAngle(1, 2, 4, 7);
@@ -253,7 +253,7 @@ public class PathTest {
         InstructionList wayList = p.calcInstructions(tr);
         List<String> tmpList = pick("text", wayList.createJson());
         assertEquals(Arrays.asList("At roundabout, take exit 3 onto 5-8",
-                "Finish!"),
+                "Arrive at destination"),
                 tmpList);
     }
 
@@ -270,7 +270,7 @@ public class PathTest {
         List<String> tmpList = pick("text", wayList.createJson());
         assertEquals(Arrays.asList("Continue onto 3-6",
                 "At roundabout, take exit 3 onto 5-8",
-                "Finish!"),
+                "Arrive at destination"),
                 tmpList);
         roundaboutGraph.inverse3to9();
     }
@@ -288,7 +288,7 @@ public class PathTest {
         List<String> tmpList = pick("text", wayList.createJson());
         assertEquals(Arrays.asList("Continue onto MainStreet 1 2",
                 "At roundabout, take exit 2 onto 5-8",
-                "Finish!"),
+                "Arrive at destination"),
                 tmpList);
         // Test Radian
         double delta = roundaboutGraph.getAngle(1, 2, 5, 8);
@@ -357,7 +357,7 @@ public class PathTest {
         InstructionList wayList = p.calcInstructions(tr);
         List<String> tmpList = pick("text", wayList.createJson());
         assertEquals(Arrays.asList("At roundabout, take exit 1 onto MainStreet 1 11",
-                "Finish!"),
+                "Arrive at destination"),
                 tmpList);
     }
 
@@ -374,7 +374,7 @@ public class PathTest {
         List<String> tmpList = pick("text", wayList.createJson());
         assertEquals(Arrays.asList("Continue onto MainStreet 1 2",
                 "At roundabout, take exit 1 onto 5-8",
-                "Finish!"),
+                "Arrive at destination"),
                 tmpList);
         // Test Radian
         double delta = roundaboutGraph.getAngle(1, 2, 5, 8);
diff --git a/core/src/test/java/com/graphhopper/util/InstructionListTest.java b/core/src/test/java/com/graphhopper/util/InstructionListTest.java
index b7c8d0b09..e5f1f3fb1 100644
--- a/core/src/test/java/com/graphhopper/util/InstructionListTest.java
+++ b/core/src/test/java/com/graphhopper/util/InstructionListTest.java
@@ -112,12 +112,12 @@ public class InstructionListTest {
         Path p = new Dijkstra(g, new ShortestWeighting(carEncoder), tMode).calcPath(0, 10);
         InstructionList wayList = p.calcInstructions(usTR);
         List<String> tmpList = pick("text", wayList.createJson());
-        assertEquals(Arrays.asList("Continue onto 0-1", "Turn right onto 1-4", "Turn left onto 7-8", "Finish!"),
+        assertEquals(Arrays.asList("Continue onto 0-1", "Turn right onto 1-4", "Turn left onto 7-8", "Arrive at destination"),
                 tmpList);
 
         wayList = p.calcInstructions(trMap.getWithFallBack(Locale.GERMAN));
         tmpList = pick("text", wayList.createJson());
-        assertEquals(Arrays.asList("Geradeaus auf 0-1", "Rechts abbiegen auf 1-4", "Links abbiegen auf 7-8", "Ziel erreicht!"),
+        assertEquals(Arrays.asList("Dem Straßenverlauf von 0-1 folgen", "Rechts abbiegen auf 1-4", "Links abbiegen auf 7-8", "Ziel erreicht"),
                 tmpList);
 
         assertEquals(70000.0, sumDistances(wayList), 1e-1);
@@ -142,7 +142,7 @@ public class InstructionListTest {
 
         wayList = p.calcInstructions(usTR);
         tmpList = pick("text", wayList.createJson());
-        assertEquals(Arrays.asList("Continue onto 6-7", "Turn left onto 5-8", "Finish!"),
+        assertEquals(Arrays.asList("Continue onto 6-7", "Turn left onto 5-8", "Arrive at destination"),
                 tmpList);
 
         compare(Arrays.asList(asL(1d, 1d), asL(1d, 1.2), asL(1.2, 1.2)),
@@ -152,7 +152,7 @@ public class InstructionListTest {
         p = new Dijkstra(g, new ShortestWeighting(carEncoder), tMode).calcPath(0, 0);
         wayList = p.calcInstructions(usTR);
         assertEquals(1, wayList.size());
-        assertEquals("Finish!", wayList.get(0).getTurnDescription(usTR));
+        assertEquals("arrive at destination", wayList.get(0).getTurnDescription(usTR));
     }
 
     List<String> pick(String key, List<Map<String, Object>> instructionJson) {
@@ -227,13 +227,13 @@ public class InstructionListTest {
 
         InstructionList wayList = p.calcInstructions(usTR);
         List<String> tmpList = pick("text", wayList.createJson());
-        assertEquals(Arrays.asList("Continue onto 2-4", "Turn slight right onto 3-4", "Finish!"),
+        assertEquals(Arrays.asList("Continue onto 2-4", "Turn slight right onto 3-4", "Arrive at destination"),
                 tmpList);
 
         p = new Dijkstra(g, new ShortestWeighting(carEncoder), tMode).calcPath(3, 5);
         wayList = p.calcInstructions(usTR);
         tmpList = pick("text", wayList.createJson());
-        assertEquals(Arrays.asList("Continue onto 3-4", "Turn slight right onto 4-5", "Finish!"),
+        assertEquals(Arrays.asList("Continue onto 3-4", "Turn slight right onto 4-5", "Arrive at destination"),
                 tmpList);
     }
 
@@ -265,7 +265,7 @@ public class InstructionListTest {
         Path p = new Dijkstra(g, new ShortestWeighting(carEncoder), tMode).calcPath(2, 3);
         InstructionList wayList = p.calcInstructions(usTR);
         List<String> tmpList = pick("text", wayList.createJson());
-        assertEquals(Arrays.asList("Continue onto street", "Turn right onto street", "Finish!"), tmpList);
+        assertEquals(Arrays.asList("Continue onto street", "Turn right onto street", "Arrive at destination"), tmpList);
     }
 
     @Test
diff --git a/reader-osm/src/test/java/com/graphhopper/GraphHopperIT.java b/reader-osm/src/test/java/com/graphhopper/GraphHopperIT.java
index 8f593308a..67af7da76 100644
--- a/reader-osm/src/test/java/com/graphhopper/GraphHopperIT.java
+++ b/reader-osm/src/test/java/com/graphhopper/GraphHopperIT.java
@@ -331,7 +331,7 @@ public class GraphHopperIT {
         assertEquals("Turn right onto Quai Jean-Charles Rey", resultJson.get(33).get("text"));
         assertEquals("Turn sharp left onto Avenue des Papalins", resultJson.get(34).get("text"));
         assertEquals("Continue onto Avenue des Guelfes", resultJson.get(36).get("text"));
-        assertEquals("Finish!", resultJson.get(37).get("text"));
+        assertEquals("Arrive at destination", resultJson.get(37).get("text"));
 
         assertEquals(11, (Double) resultJson.get(0).get("distance"), 1);
         assertEquals(97, (Double) resultJson.get(1).get("distance"), 1);
@@ -358,7 +358,7 @@ public class GraphHopperIT {
         assertEquals(0, arsp.getRouteWeight(), .1);
         assertEquals(1, arsp.getPoints().getSize());
         assertEquals(1, arsp.getInstructions().size());
-        assertEquals("Finish!", arsp.getInstructions().createJson().get(0).get("text"));
+        assertEquals("Arrive at destination", arsp.getInstructions().createJson().get(0).get("text"));
         assertEquals(Instruction.FINISH, arsp.getInstructions().createJson().get(0).get("sign"));
 
         rsp = hopper.route(new GHRequest().
diff --git a/web/src/test/java/com/graphhopper/http/GraphHopperServletIT.java b/web/src/test/java/com/graphhopper/http/GraphHopperServletIT.java
index 9edb2417d..84d877be0 100644
--- a/web/src/test/java/com/graphhopper/http/GraphHopperServletIT.java
+++ b/web/src/test/java/com/graphhopper/http/GraphHopperServletIT.java
@@ -202,7 +202,7 @@ public class GraphHopperServletIT extends BaseServletTester {
     public void testGPXWithTrackAndWaypointsSelection() throws Exception {
         String str = queryString("point=42.554851,1.536198&point=42.510071,1.548128&type=gpx&gpx.track=true&gpx.route=false&gpx.waypoints=true", 200);
         assertFalse(str.contains("<gh:distance>115.1</gh:distance>"));
-        assertTrue(str.contains("<wpt lat=\"42.51003\" lon=\"1.548188\"> <name>Finish!</name></wpt>"));
+        assertTrue(str.contains("<wpt lat=\"42.51003\" lon=\"1.548188\"> <name>arrive at destination</name></wpt>"));
         assertTrue(str.contains("<trkpt lat=\"42.554839\" lon=\"1.536374\"><time>"));
     }