From 7387dfb7dae89550d5d6c3146142851e6fbb5900 Mon Sep 17 00:00:00 2001 From: Toby Zerner Date: Sun, 11 Oct 2015 10:09:22 +1030 Subject: [PATCH] Concatenate items in {second}, not {first} --- js/lib/helpers/punctuateSeries.js | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/js/lib/helpers/punctuateSeries.js b/js/lib/helpers/punctuateSeries.js index eff9c64a2..219e311fa 100644 --- a/js/lib/helpers/punctuateSeries.js +++ b/js/lib/helpers/punctuateSeries.js @@ -16,17 +16,17 @@ export default function punctuateSeries(items) { second: items[1] }); } else if (items.length >= 3) { - // If there are three or more items, we will join all of the items up until - // the second-to-last one with the equivalent of a comma, and then we will - // feed that into the translator along with the last two items. - const first = items - .slice(0, items.length - 2) + // If there are three or more items, we will join all but the first and + // last items with the equivalent of a comma, and then we will feed that + // into the translator along with the first and last item. + const second = items + .slice(1, items.length - 1) .reduce((list, item) => list.concat([item, app.trans('core.lib.series_glue_text')]), []) .slice(0, -1); return app.trans('core.lib.series_three_text', { - first, - second: items[items.length - 2], + first: items[0], + second, third: items[items.length - 1] }); }