Skip to content

Commit da902d9

Browse files
committed
Add support for exits.
1 parent 4012525 commit da902d9

File tree

180 files changed

+4040
-9
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

180 files changed

+4040
-9
lines changed

index.js

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -150,8 +150,12 @@ module.exports = function(version, _options) {
150150
// Decide which instruction string to use
151151
// Destination takes precedence over name
152152
var instruction;
153-
if (step.destinations && instructionObject.destination) {
153+
if (step.destinations && step.exits && instructionObject.exit_destination) {
154+
instruction = instructionObject.exit_destination;
155+
} else if (step.destinations && instructionObject.destination) {
154156
instruction = instructionObject.destination;
157+
} else if (step.exits && instructionObject.exit) {
158+
instruction = instructionObject.exit;
155159
} else if (wayName && instructionObject.name) {
156160
instruction = instructionObject.name;
157161
} else {
@@ -169,6 +173,7 @@ module.exports = function(version, _options) {
169173
instruction = instruction
170174
.replace('{way_name}', wayName)
171175
.replace('{destination}', (step.destinations || '').split(',')[0])
176+
.replace('{exit}', (step.exits || '').split(',')[0])
172177
.replace('{exit_number}', this.ordinalize(language, step.maneuver.exit || 1))
173178
.replace('{rotary_name}', step.rotary_name)
174179
.replace('{lane_instruction}', laneInstruction)

languages/translations/en.json

Lines changed: 22 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -238,37 +238,51 @@
238238
"default": {
239239
"default": "Take the ramp",
240240
"name": "Take the ramp onto {way_name}",
241-
"destination": "Take the ramp towards {destination}"
241+
"destination": "Take the ramp towards {destination}",
242+
"exit": "Take exit {exit}",
243+
"exit_destination": "Take exit {exit} towards {destination}"
242244
},
243245
"left": {
244246
"default": "Take the ramp on the left",
245247
"name": "Take the ramp on the left onto {way_name}",
246-
"destination": "Take the ramp on the left towards {destination}"
248+
"destination": "Take the ramp on the left towards {destination}",
249+
"exit": "Take exit {exit} on the left",
250+
"exit_destination": "Take exit {exit} on the left towards {destination}"
247251
},
248252
"right": {
249253
"default": "Take the ramp on the right",
250254
"name": "Take the ramp on the right onto {way_name}",
251-
"destination": "Take the ramp on the right towards {destination}"
255+
"destination": "Take the ramp on the right towards {destination}",
256+
"exit": "Take exit {exit}",
257+
"exit_destination": "Take exit {exit} towards {destination}"
252258
},
253259
"sharp left": {
254260
"default": "Take the ramp on the left",
255261
"name": "Take the ramp on the left onto {way_name}",
256-
"destination": "Take the ramp on the left towards {destination}"
262+
"destination": "Take the ramp on the left towards {destination}",
263+
"exit": "Take exit {exit} on the left",
264+
"exit_destination": "Take exit {exit} on the left towards {destination}"
257265
},
258266
"sharp right": {
259267
"default": "Take the ramp on the right",
260268
"name": "Take the ramp on the right onto {way_name}",
261-
"destination": "Take the ramp on the right towards {destination}"
269+
"destination": "Take the ramp on the right towards {destination}",
270+
"exit": "Take exit {exit}",
271+
"exit_destination": "Take exit {exit} towards {destination}"
262272
},
263273
"slight left": {
264274
"default": "Take the ramp on the left",
265275
"name": "Take the ramp on the left onto {way_name}",
266-
"destination": "Take the ramp on the left towards {destination}"
276+
"destination": "Take the ramp on the left towards {destination}",
277+
"exit": "Take exit {exit} on the left",
278+
"exit_destination": "Take exit {exit} on the left towards {destination}"
267279
},
268280
"slight right": {
269281
"default": "Take the ramp on the right",
270282
"name": "Take the ramp on the right onto {way_name}",
271-
"destination": "Take the ramp on the right towards {destination}"
283+
"destination": "Take the ramp on the right towards {destination}",
284+
"exit": "Take exit {exit}",
285+
"exit_destination": "Take exit {exit} towards {destination}"
272286
}
273287
},
274288
"on ramp": {
@@ -399,4 +413,4 @@
399413
}
400414
}
401415
}
402-
}
416+
}
Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
{
2+
"step": {
3+
"maneuver": {
4+
"type": "continue",
5+
"modifier": "left"
6+
},
7+
"name": "Way Name",
8+
"exits": "4A,4B"
9+
},
10+
"instructions": {
11+
"de": "Links weiterfahren auf Way Name",
12+
"en": "Continue left onto Way Name",
13+
"es": "Continua izquierda en Way Name",
14+
"fr": "Continuer à gauche sur Way Name",
15+
"id": "Terus kiri ke Way Name",
16+
"nl": "Ga links naar Way Name",
17+
"ru": "Двигайтесь налево по Way Name",
18+
"sv": "Fortsätt vänster in på Way Name",
19+
"vi": "Chạy tiếp bên trái trên Way Name",
20+
"zh-Hans": "继续向左,上Way Name"
21+
}
22+
}
Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
{
2+
"step": {
3+
"maneuver": {
4+
"type": "continue",
5+
"modifier": "left"
6+
},
7+
"name": "Way Name",
8+
"destinations": "Destination 1,Destination 2",
9+
"exits": "4A,4B"
10+
},
11+
"instructions": {
12+
"de": "Links weiterfahren Richtung Destination 1",
13+
"en": "Continue left towards Destination 1",
14+
"es": "Continua izquierda hacia Destination 1",
15+
"fr": "Continuer à gauche en direction de Destination 1",
16+
"id": "Teruskan kiri menuju Destination 1",
17+
"nl": "Ga links richting Destination 1",
18+
"ru": "Двигайтесь налево в направлении Destination 1",
19+
"sv": "Fortsätt vänster mot Destination 1",
20+
"vi": "Chạy tiếp bên trái đến Destination 1",
21+
"zh-Hans": "继续向左行驶,前往Destination 1"
22+
}
23+
}
Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
{
2+
"step": {
3+
"maneuver": {
4+
"type": "continue",
5+
"modifier": "right"
6+
},
7+
"name": "Way Name",
8+
"exits": "4A,4B"
9+
},
10+
"instructions": {
11+
"de": "Rechts weiterfahren auf Way Name",
12+
"en": "Continue right onto Way Name",
13+
"es": "Continua derecha en Way Name",
14+
"fr": "Continuer à droite sur Way Name",
15+
"id": "Terus kanan ke Way Name",
16+
"nl": "Ga rechts naar Way Name",
17+
"ru": "Двигайтесь направо по Way Name",
18+
"sv": "Fortsätt höger in på Way Name",
19+
"vi": "Chạy tiếp bên phải trên Way Name",
20+
"zh-Hans": "继续向右,上Way Name"
21+
}
22+
}
Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
{
2+
"step": {
3+
"maneuver": {
4+
"type": "continue",
5+
"modifier": "right"
6+
},
7+
"name": "Way Name",
8+
"destinations": "Destination 1,Destination 2",
9+
"exits": "4A,4B"
10+
},
11+
"instructions": {
12+
"de": "Rechts weiterfahren Richtung Destination 1",
13+
"en": "Continue right towards Destination 1",
14+
"es": "Continua derecha hacia Destination 1",
15+
"fr": "Continuer à droite en direction de Destination 1",
16+
"id": "Teruskan kanan menuju Destination 1",
17+
"nl": "Ga rechts richting Destination 1",
18+
"ru": "Двигайтесь направо в направлении Destination 1",
19+
"sv": "Fortsätt höger mot Destination 1",
20+
"vi": "Chạy tiếp bên phải đến Destination 1",
21+
"zh-Hans": "继续向右行驶,前往Destination 1"
22+
}
23+
}
Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
{
2+
"step": {
3+
"maneuver": {
4+
"type": "continue",
5+
"modifier": "sharp left"
6+
},
7+
"name": "Way Name",
8+
"exits": "4A,4B"
9+
},
10+
"instructions": {
11+
"de": "Scharf links weiterfahren auf Way Name",
12+
"en": "Continue sharp left onto Way Name",
13+
"es": "Continua cerrada a la izquierda en Way Name",
14+
"fr": "Continuer franchement à gauche sur Way Name",
15+
"id": "Terus tajam kiri ke Way Name",
16+
"nl": "Ga linksaf naar Way Name",
17+
"ru": "Двигайтесь налево по Way Name",
18+
"sv": "Fortsätt skarp vänster in på Way Name",
19+
"vi": "Chạy tiếp bên trái gắt trên Way Name",
20+
"zh-Hans": "继续向左,上Way Name"
21+
}
22+
}
Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
{
2+
"step": {
3+
"maneuver": {
4+
"type": "continue",
5+
"modifier": "sharp left"
6+
},
7+
"name": "Way Name",
8+
"destinations": "Destination 1,Destination 2",
9+
"exits": "4A,4B"
10+
},
11+
"instructions": {
12+
"de": "Scharf links weiterfahren Richtung Destination 1",
13+
"en": "Continue sharp left towards Destination 1",
14+
"es": "Continua cerrada a la izquierda hacia Destination 1",
15+
"fr": "Continuer franchement à gauche en direction de Destination 1",
16+
"id": "Teruskan tajam kiri menuju Destination 1",
17+
"nl": "Ga linksaf richting Destination 1",
18+
"ru": "Двигайтесь налево в направлении Destination 1",
19+
"sv": "Fortsätt skarp vänster mot Destination 1",
20+
"vi": "Chạy tiếp bên trái gắt đến Destination 1",
21+
"zh-Hans": "继续向左行驶,前往Destination 1"
22+
}
23+
}
Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
{
2+
"step": {
3+
"maneuver": {
4+
"type": "continue",
5+
"modifier": "sharp right"
6+
},
7+
"name": "Way Name",
8+
"exits": "4A,4B"
9+
},
10+
"instructions": {
11+
"de": "Scharf rechts weiterfahren auf Way Name",
12+
"en": "Continue sharp right onto Way Name",
13+
"es": "Continua cerrada a la derecha en Way Name",
14+
"fr": "Continuer franchement à droite sur Way Name",
15+
"id": "Terus tajam kanan ke Way Name",
16+
"nl": "Ga rechtsaf naar Way Name",
17+
"ru": "Двигайтесь направо по Way Name",
18+
"sv": "Fortsätt skarp höger in på Way Name",
19+
"vi": "Chạy tiếp bên phải gắt trên Way Name",
20+
"zh-Hans": "继续向右,上Way Name"
21+
}
22+
}
Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
{
2+
"step": {
3+
"maneuver": {
4+
"type": "continue",
5+
"modifier": "sharp right"
6+
},
7+
"name": "Way Name",
8+
"destinations": "Destination 1,Destination 2",
9+
"exits": "4A,4B"
10+
},
11+
"instructions": {
12+
"de": "Scharf rechts weiterfahren Richtung Destination 1",
13+
"en": "Continue sharp right towards Destination 1",
14+
"es": "Continua cerrada a la derecha hacia Destination 1",
15+
"fr": "Continuer franchement à droite en direction de Destination 1",
16+
"id": "Teruskan tajam kanan menuju Destination 1",
17+
"nl": "Ga rechtsaf richting Destination 1",
18+
"ru": "Двигайтесь направо в направлении Destination 1",
19+
"sv": "Fortsätt skarp höger mot Destination 1",
20+
"vi": "Chạy tiếp bên phải gắt đến Destination 1",
21+
"zh-Hans": "继续向右行驶,前往Destination 1"
22+
}
23+
}
Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
{
2+
"step": {
3+
"maneuver": {
4+
"type": "continue",
5+
"modifier": "slight left"
6+
},
7+
"name": "Way Name",
8+
"exits": "4A,4B"
9+
},
10+
"instructions": {
11+
"de": "Leicht links weiter auf Way Name",
12+
"en": "Continue slightly left onto Way Name",
13+
"es": "Continua ligeramente a la izquierda en Way Name",
14+
"fr": "Continuer légèrement à gauche sur Way Name",
15+
"id": "Tetap agak di kiri ke Way Name",
16+
"nl": "Links aanhouden naar Way Name",
17+
"ru": "Плавно поверните налево на Way Name",
18+
"sv": "Fortsätt med lätt vänstersväng in på Way Name",
19+
"vi": "Nghiêng về bên trái vào Way Name",
20+
"zh-Hans": "继续向左,上Way Name"
21+
}
22+
}
Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
{
2+
"step": {
3+
"maneuver": {
4+
"type": "continue",
5+
"modifier": "slight left"
6+
},
7+
"name": "Way Name",
8+
"destinations": "Destination 1,Destination 2",
9+
"exits": "4A,4B"
10+
},
11+
"instructions": {
12+
"de": "Leicht links weiter Richtung Destination 1",
13+
"en": "Continue slightly left towards Destination 1",
14+
"es": "Continua ligeramente a la izquierda hacia Destination 1",
15+
"fr": "Continuer légèrement à gauche en direction de Destination 1",
16+
"id": "Tetap agak di kiri menuju Destination 1",
17+
"nl": "Links aanhouden richting Destination 1",
18+
"ru": "Плавно поверните налево в направлении Destination 1",
19+
"sv": "Fortsätt med lätt vänstersväng mot Destination 1",
20+
"vi": "Nghiêng về bên trái đến Destination 1",
21+
"zh-Hans": "继续向左行驶,前往Destination 1"
22+
}
23+
}
Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
{
2+
"step": {
3+
"maneuver": {
4+
"type": "continue",
5+
"modifier": "slight right"
6+
},
7+
"name": "Way Name",
8+
"exits": "4A,4B"
9+
},
10+
"instructions": {
11+
"de": "Leicht rechts weiter auf Way Name",
12+
"en": "Continue slightly right onto Way Name",
13+
"es": "Continua ligeramente a la derecha en Way Name",
14+
"fr": "Continuer légèrement à droite sur Way Name",
15+
"id": "Tetap agak di kanan ke Way Name",
16+
"nl": "Rechts aanhouden naar Way Name",
17+
"ru": "Плавно поверните направо на Way Name",
18+
"sv": "Fortsätt med lätt högersväng in på Way Name",
19+
"vi": "Nghiêng về bên phải vào Way Name",
20+
"zh-Hans": "继续向右,上Way Name"
21+
}
22+
}
Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
{
2+
"step": {
3+
"maneuver": {
4+
"type": "continue",
5+
"modifier": "slight right"
6+
},
7+
"name": "Way Name",
8+
"destinations": "Destination 1,Destination 2",
9+
"exits": "4A,4B"
10+
},
11+
"instructions": {
12+
"de": "Leicht rechts weiter Richtung Destination 1",
13+
"en": "Continue slightly right towards Destination 1",
14+
"es": "Continua ligeramente a la derecha hacia Destination 1",
15+
"fr": "Continuer légèrement à droite en direction de Destination 1",
16+
"id": "Tetap agak di kanan menuju Destination 1",
17+
"nl": "Rechts aanhouden richting Destination 1",
18+
"ru": "Плавно поверните направо в направлении Destination 1",
19+
"sv": "Fortsätt med lätt högersväng mot Destination 1",
20+
"vi": "Nghiêng về bên phải đến Destination 1",
21+
"zh-Hans": "继续向右行驶,前往Destination 1"
22+
}
23+
}
Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
{
2+
"step": {
3+
"maneuver": {
4+
"type": "continue",
5+
"modifier": "straight"
6+
},
7+
"name": "Way Name",
8+
"exits": "4A,4B"
9+
},
10+
"instructions": {
11+
"de": "Geradeaus weiterfahren auf Way Name",
12+
"en": "Continue onto Way Name",
13+
"es": "Continua en Way Name",
14+
"fr": "Continuer tout droit sur Way Name",
15+
"id": "Terus ke Way Name",
16+
"nl": "Ga rechtdoor naar Way Name",
17+
"ru": "Продолжите движение по Way Name",
18+
"sv": "Fortsätt in på Way Name",
19+
"vi": "Chạy tiếp trên Way Name",
20+
"zh-Hans": "继续直行,上Way Name"
21+
}
22+
}

0 commit comments

Comments
 (0)