From 91c30d3a8c0b746cafa91e09740981ed682e4fa7 Mon Sep 17 00:00:00 2001 From: Tom Hughes Date: Mon, 30 Apr 2018 22:38:43 +0100 Subject: [PATCH] Avoid using "one" and "two" as translation keys --- .../javascripts/index/directions/osrm.js | 5 +---- config/locales/en.yml | 20 +++++++++---------- 2 files changed, 11 insertions(+), 14 deletions(-) diff --git a/app/assets/javascripts/index/directions/osrm.js b/app/assets/javascripts/index/directions/osrm.js index b49d93e06..4ce2d005f 100644 --- a/app/assets/javascripts/index/directions/osrm.js +++ b/app/assets/javascripts/index/directions/osrm.js @@ -61,10 +61,7 @@ function OSRMEngine() { 'arrive': 14 }; var numToWord = function(num) { - if(num > 10) { - num = 11; - } - return ["zero", "one", "two", "three", "four", "five", "six", "seven", "eight", "nine", "ten", "gt_ten"][num]; + return ["first", "second", "third", "fourth", "fifth", "sixth", "seventh", "eighth", "ninth", "tenth"][num-1]; }; var transformed_steps = input_steps.map(function(step, idx) { var maneuver_id; diff --git a/config/locales/en.yml b/config/locales/en.yml index 4dd1762e1..15cc2dbf6 100644 --- a/config/locales/en.yml +++ b/config/locales/en.yml @@ -2386,16 +2386,16 @@ en: unnamed: "unnamed road" courtesy: "Directions courtesy of %{link}" exit_counts: - one: "1st" - two: "2nd" - three: "3rd" - four: "4th" - five: "5th" - six: "6th" - seven: "7th" - eight: "8th" - nine: "9th" - ten: "10th" + first: "1st" + second: "2nd" + third: "3rd" + fourth: "4th" + fifth: "5th" + sixth: "6th" + seventh: "7th" + eighth: "8th" + ninth: "9th" + tenth: "10th" time: "Time" query: node: Node -- 2.43.2