Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
5 changes: 5 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,11 @@
# Change Log
All notable changes to this project will be documented in this file. For change log formatting, see http://keepachangelog.com/

## master

- Renamed “traffic circle” to “roundabout” in the English localization. [#256](https://github.com/Project-OSRM/osrm-text-instructions/pull/256)
- Added an American English localization that only differs from the international English localization by the use of “traffic circle” to refer to classic circular junctions. [#256](https://github.com/Project-OSRM/osrm-text-instructions/pull/256)

## 0.13.1 2018-07-19

- Updated French localization with articles and prepositions insertion using grammar rules. [#252](https://github.com/Project-OSRM/osrm-text-instructions/pull/252)
Expand Down
3 changes: 3 additions & 0 deletions languages.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
var instructionsDa = require('./languages/translations/da.json');
var instructionsDe = require('./languages/translations/de.json');
var instructionsEn = require('./languages/translations/en.json');
var instructionsEnUs = require('./languages/translations/en-US.json');
var instructionsEo = require('./languages/translations/eo.json');
var instructionsEs = require('./languages/translations/es.json');
var instructionsEsEs = require('./languages/translations/es-ES.json');
Expand Down Expand Up @@ -52,6 +53,7 @@ var instructions = {
'da': instructionsDa,
'de': instructionsDe,
'en': instructionsEn,
'en-US': instructionsEnUs,
'eo': instructionsEo,
'es': instructionsEs,
'es-ES': instructionsEsEs,
Expand Down Expand Up @@ -88,6 +90,7 @@ var abbreviations = {
'da': abbreviationsDa,
'de': ebbreviationsDe,
'en': abbreviationsEn,
'en-US': abbreviationsEn,
'es': abbreviationsEs,
'fr': abbreviationsFr,
'he': abbreviationsHe,
Expand Down
21 changes: 21 additions & 0 deletions languages/overrides/en-US.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
/**
* Recursively rename roundabouts to traffic circles like in the good old days.
*/
function iterate(values) {
Object.keys(values).forEach(function (key) {
var value = values[key];
if (typeof value === 'string') {
values[key] = value.replace(/\broundabout\b/g, 'traffic circle');
} else if (typeof value === 'object') {
iterate(value);
}
});
}

module.exports = function(content) {
// Only call classic roundabouts (i.e., rotaries) "traffic circles".
iterate(content.v5.rotary);
iterate(content.v5['exit rotary']);

return content;
};
Loading