Skip to content

Commit c3fae5f

Browse files
author
Bobby Sudekum
authored
Add ceremonial name handling (#129)
1 parent c2c8b2e commit c3fae5f

37 files changed

+733
-11
lines changed

index.js

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -139,8 +139,18 @@ module.exports = function(version, _options) {
139139
}
140140
name = name.replace(' (' + step.ref + ')', '');
141141

142-
if (name && ref && name !== ref) {
142+
// In attempt to avoid using the highway name of a way,
143+
// check and see if the step has a class which should signal
144+
// the ref should be used instead of the name.
145+
var wayMotorway = false;
146+
if (options && options.classes) {
147+
wayMotorway = options.classes.some((className) => ['motorway'].indexOf(className) > -1);
148+
}
149+
150+
if (name && ref && name !== ref && !wayMotorway) {
143151
wayName = name + ' (' + ref + ')';
152+
} else if (name && ref && wayMotorway && (/\d/).test(ref)) {
153+
wayName = ref;
144154
} else if (!name && ref) {
145155
wayName = ref;
146156
} else {

languages/translations/de.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -408,4 +408,4 @@
408408
}
409409
}
410410
}
411-
}
411+
}

languages/translations/es.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -399,4 +399,4 @@
399399
}
400400
}
401401
}
402-
}
402+
}

languages/translations/fr.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -399,4 +399,4 @@
399399
}
400400
}
401401
}
402-
}
402+
}

languages/translations/id.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -399,4 +399,4 @@
399399
}
400400
}
401401
}
402-
}
402+
}

languages/translations/nl.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -399,4 +399,4 @@
399399
}
400400
}
401401
}
402-
}
402+
}

languages/translations/pl.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -413,4 +413,4 @@
413413
}
414414
}
415415
}
416-
}
416+
}

languages/translations/ru.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -399,4 +399,4 @@
399399
}
400400
}
401401
}
402-
}
402+
}

languages/translations/sv.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -399,4 +399,4 @@
399399
}
400400
}
401401
}
402-
}
402+
}

languages/translations/vi.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -413,4 +413,4 @@
413413
}
414414
}
415415
}
416-
}
416+
}

languages/translations/zh-Hans.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -284,4 +284,4 @@
284284
}
285285
}
286286
}
287-
}
287+
}
Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
{
2+
"step": {
3+
"maneuver": {
4+
"type": "continue",
5+
"modifier": "left"
6+
},
7+
"name": "Cool highway",
8+
"ref": "Ref no number"
9+
},
10+
"instructions": {
11+
"de": "Links weiterfahren auf Cool highway",
12+
"en": "Continue left onto Cool highway",
13+
"es": "Continua izquierda en Cool highway",
14+
"fr": "Continuer à gauche sur Cool highway",
15+
"id": "Terus kiri ke Cool highway",
16+
"nl": "Ga links naar Cool highway",
17+
"pl": "Kontynuuj lewo na Cool highway",
18+
"ru": "Двигайтесь налево по Cool highway",
19+
"sv": "Fortsätt vänster in på Cool highway",
20+
"vi": "Chạy tiếp bên trái trên Cool highway",
21+
"zh-Hans": "继续向左,上Cool highway"
22+
},
23+
"options": {
24+
"classes": [
25+
"motorway"
26+
]
27+
}
28+
}
Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
{
2+
"step": {
3+
"maneuver": {
4+
"type": "continue",
5+
"modifier": "right"
6+
},
7+
"name": "Cool highway",
8+
"ref": "Ref no number"
9+
},
10+
"instructions": {
11+
"de": "Rechts weiterfahren auf Cool highway",
12+
"en": "Continue right onto Cool highway",
13+
"es": "Continua derecha en Cool highway",
14+
"fr": "Continuer à droite sur Cool highway",
15+
"id": "Terus kanan ke Cool highway",
16+
"nl": "Ga rechts naar Cool highway",
17+
"pl": "Kontynuuj prawo na Cool highway",
18+
"ru": "Двигайтесь направо по Cool highway",
19+
"sv": "Fortsätt höger in på Cool highway",
20+
"vi": "Chạy tiếp bên phải trên Cool highway",
21+
"zh-Hans": "继续向右,上Cool highway"
22+
},
23+
"options": {
24+
"classes": [
25+
"motorway"
26+
]
27+
}
28+
}
Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
{
2+
"step": {
3+
"maneuver": {
4+
"type": "continue",
5+
"modifier": "sharp left"
6+
},
7+
"name": "Cool highway",
8+
"ref": "Ref no number"
9+
},
10+
"instructions": {
11+
"de": "Scharf links weiterfahren auf Cool highway",
12+
"en": "Continue sharp left onto Cool highway",
13+
"es": "Continua cerrada a la izquierda en Cool highway",
14+
"fr": "Continuer franchement à gauche sur Cool highway",
15+
"id": "Terus tajam kiri ke Cool highway",
16+
"nl": "Ga linksaf naar Cool highway",
17+
"pl": "Kontynuuj ostro w lewo na Cool highway",
18+
"ru": "Двигайтесь налево по Cool highway",
19+
"sv": "Fortsätt skarp vänster in på Cool highway",
20+
"vi": "Chạy tiếp bên trái gắt trên Cool highway",
21+
"zh-Hans": "继续向左,上Cool highway"
22+
},
23+
"options": {
24+
"classes": [
25+
"motorway"
26+
]
27+
}
28+
}
Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
{
2+
"step": {
3+
"maneuver": {
4+
"type": "continue",
5+
"modifier": "sharp right"
6+
},
7+
"name": "Cool highway",
8+
"ref": "Ref no number"
9+
},
10+
"instructions": {
11+
"de": "Scharf rechts weiterfahren auf Cool highway",
12+
"en": "Continue sharp right onto Cool highway",
13+
"es": "Continua cerrada a la derecha en Cool highway",
14+
"fr": "Continuer franchement à droite sur Cool highway",
15+
"id": "Terus tajam kanan ke Cool highway",
16+
"nl": "Ga rechtsaf naar Cool highway",
17+
"pl": "Kontynuuj ostro w prawo na Cool highway",
18+
"ru": "Двигайтесь направо по Cool highway",
19+
"sv": "Fortsätt skarp höger in på Cool highway",
20+
"vi": "Chạy tiếp bên phải gắt trên Cool highway",
21+
"zh-Hans": "继续向右,上Cool highway"
22+
},
23+
"options": {
24+
"classes": [
25+
"motorway"
26+
]
27+
}
28+
}
Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
{
2+
"step": {
3+
"maneuver": {
4+
"type": "continue",
5+
"modifier": "slight left"
6+
},
7+
"name": "Cool highway",
8+
"ref": "Ref no number"
9+
},
10+
"instructions": {
11+
"de": "Leicht links weiter auf Cool highway",
12+
"en": "Continue slightly left onto Cool highway",
13+
"es": "Continua ligeramente a la izquierda en Cool highway",
14+
"fr": "Continuer légèrement à gauche sur Cool highway",
15+
"id": "Tetap agak di kiri ke Cool highway",
16+
"nl": "Links aanhouden naar Cool highway",
17+
"pl": "Kontynuuj łagodnie w lewo na Cool highway",
18+
"ru": "Плавно поверните налево на Cool highway",
19+
"sv": "Fortsätt med lätt vänstersväng in på Cool highway",
20+
"vi": "Nghiêng về bên trái vào Cool highway",
21+
"zh-Hans": "继续向左,上Cool highway"
22+
},
23+
"options": {
24+
"classes": [
25+
"motorway"
26+
]
27+
}
28+
}
Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
{
2+
"step": {
3+
"maneuver": {
4+
"type": "continue",
5+
"modifier": "slight right"
6+
},
7+
"name": "Cool highway",
8+
"ref": "Ref no number"
9+
},
10+
"instructions": {
11+
"de": "Leicht rechts weiter auf Cool highway",
12+
"en": "Continue slightly right onto Cool highway",
13+
"es": "Continua ligeramente a la derecha en Cool highway",
14+
"fr": "Continuer légèrement à droite sur Cool highway",
15+
"id": "Tetap agak di kanan ke Cool highway",
16+
"nl": "Rechts aanhouden naar Cool highway",
17+
"pl": "Kontynuuj łagodnie w prawo na Cool highway",
18+
"ru": "Плавно поверните направо на Cool highway",
19+
"sv": "Fortsätt med lätt högersväng in på Cool highway",
20+
"vi": "Nghiêng về bên phải vào Cool highway",
21+
"zh-Hans": "继续向右,上Cool highway"
22+
},
23+
"options": {
24+
"classes": [
25+
"motorway"
26+
]
27+
}
28+
}
Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
{
2+
"step": {
3+
"maneuver": {
4+
"type": "continue",
5+
"modifier": "straight"
6+
},
7+
"name": "Cool highway",
8+
"ref": "Ref no number"
9+
},
10+
"instructions": {
11+
"de": "Geradeaus weiterfahren auf Cool highway",
12+
"en": "Continue onto Cool highway",
13+
"es": "Continua en Cool highway",
14+
"fr": "Continuer tout droit sur Cool highway",
15+
"id": "Terus ke Cool highway",
16+
"nl": "Ga rechtdoor naar Cool highway",
17+
"pl": "Kontynuuj na Cool highway",
18+
"ru": "Продолжите движение по Cool highway",
19+
"sv": "Fortsätt in på Cool highway",
20+
"vi": "Chạy tiếp trên Cool highway",
21+
"zh-Hans": "继续直行,上Cool highway"
22+
},
23+
"options": {
24+
"classes": [
25+
"motorway"
26+
]
27+
}
28+
}
Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
{
2+
"step": {
3+
"maneuver": {
4+
"type": "continue",
5+
"modifier": "uturn"
6+
},
7+
"name": "Cool highway",
8+
"ref": "Ref no number"
9+
},
10+
"instructions": {
11+
"de": "180°-Wendung auf Cool highway",
12+
"en": "Make a U-turn onto Cool highway",
13+
"es": "Haz un cambio de sentido en Cool highway",
14+
"fr": "Faire demi-tour sur Cool highway",
15+
"id": "Putar balik ke arah Cool highway",
16+
"nl": "Keer om naar Cool highway",
17+
"pl": "Zawróć na Cool highway",
18+
"ru": "Развернитесь на Cool highway",
19+
"sv": "Gör en U-sväng in på Cool highway",
20+
"vi": "Quẹo ngược lại Cool highway",
21+
"zh-Hans": "调头上Cool highway"
22+
},
23+
"options": {
24+
"classes": [
25+
"motorway"
26+
]
27+
}
28+
}
Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
{
2+
"step": {
3+
"maneuver": {
4+
"type": "continue",
5+
"modifier": "left"
6+
},
7+
"name": "Cool highway",
8+
"ref": "Ref1;Ref2"
9+
},
10+
"instructions": {
11+
"de": "Links weiterfahren auf Ref1",
12+
"en": "Continue left onto Ref1",
13+
"es": "Continua izquierda en Ref1",
14+
"fr": "Continuer à gauche sur Ref1",
15+
"id": "Terus kiri ke Ref1",
16+
"nl": "Ga links naar Ref1",
17+
"pl": "Kontynuuj lewo na Ref1",
18+
"ru": "Двигайтесь налево по Ref1",
19+
"sv": "Fortsätt vänster in på Ref1",
20+
"vi": "Chạy tiếp bên trái trên Ref1",
21+
"zh-Hans": "继续向左,上Ref1"
22+
},
23+
"options": {
24+
"classes": [
25+
"motorway"
26+
]
27+
}
28+
}
Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
{
2+
"step": {
3+
"maneuver": {
4+
"type": "continue",
5+
"modifier": "right"
6+
},
7+
"name": "Cool highway",
8+
"ref": "Ref1;Ref2"
9+
},
10+
"instructions": {
11+
"de": "Rechts weiterfahren auf Ref1",
12+
"en": "Continue right onto Ref1",
13+
"es": "Continua derecha en Ref1",
14+
"fr": "Continuer à droite sur Ref1",
15+
"id": "Terus kanan ke Ref1",
16+
"nl": "Ga rechts naar Ref1",
17+
"pl": "Kontynuuj prawo na Ref1",
18+
"ru": "Двигайтесь направо по Ref1",
19+
"sv": "Fortsätt höger in på Ref1",
20+
"vi": "Chạy tiếp bên phải trên Ref1",
21+
"zh-Hans": "继续向右,上Ref1"
22+
},
23+
"options": {
24+
"classes": [
25+
"motorway"
26+
]
27+
}
28+
}

0 commit comments

Comments
 (0)