From 73a80df38ba4465f3a8fe85c7bc7a2dd196ca0a2 Mon Sep 17 00:00:00 2001 From: steronydh <4245329+steronydh@users.noreply.github.com> Date: Thu, 9 Jan 2020 21:22:51 +0000 Subject: [PATCH] Add status messages in Cornish (#290) * Cornish test cases updated * Offline radar station message added to Cornish * Cornish translation of offline radar stations * Add Status message in Cornish --- lib/lang/kw.js | 21 +++++++++++++-------- test_cases/kw.json | 9 ++++++++- 2 files changed, 21 insertions(+), 9 deletions(-) diff --git a/lib/lang/kw.js b/lib/lang/kw.js index 5122c311..cbf7e25c 100644 --- a/lib/lang/kw.js +++ b/lib/lang/kw.js @@ -1,23 +1,23 @@ "use strict"; function in_the(period) { - if(period === "myttin" || period === "dohajydh" || period === "gorthugher" || period === "nos") { + if (period === "myttin" || period === "dohajydh" || period === "gorthugher" || period === "nos") { return " y'n " + period; } - if(period === "an dohajydh ma" || period === "an nos ma") { + if (period === "an dohajydh ma" || period === "an nos ma") { return " y'n " + period.slice(3); } - if("123456789".indexOf(period.charAt(0)) !== -1) { + if ("123456789".indexOf(period.charAt(0)) !== -1) { return " yn " + period; } return " " + period; } function until_the(period) { - if(period === "myttin" || period === "dohajydh" || period === "gorthugher" || period === "nos") { + if (period === "myttin" || period === "dohajydh" || period === "gorthugher" || period === "nos") { return " bys y'n " + period; } - if(period === "an dohajydh ma" || period === "an nos ma") { + if (period === "an dohajydh ma" || period === "an nos ma") { return " bys y'n " + period.slice(3); } return " bys yn " + period; @@ -102,7 +102,7 @@ module.exports = { "less-than": "le ages $1", "and": function(a, b) { let andy = a.indexOf(",") !== -1 ? ", ha" : " ha"; - if(b.charAt(0) === "a" || b.charAt(0) === "e" || b.charAt(0) === "i" || b.charAt(0) === "o" || b.charAt(0) === "u") { + if (b.charAt(0) === "a" || b.charAt(0) === "e" || b.charAt(0) === "i" || b.charAt(0) === "o" || b.charAt(0) === "u") { andy = andy + "g"; } @@ -144,7 +144,6 @@ module.exports = { }, "during": function(condition, period) { return condition + in_the(period); - // "$1 y\'n $2" }, "for-week": "$1 dres oll an seythun", "over-weekend": "$1 dres an bennseythun", @@ -169,9 +168,15 @@ module.exports = { str = str.charAt(0).toUpperCase() + str.slice(1); /* Add a period if there isn't already one. */ - if(str.charAt(str.length - 1) !== ".") + if (str.charAt(str.length - 1) !== ".") str += "."; return str; }, + "next-hour-forecast-status": "Darganow herwydh an our yw $1 drefen bos $2.", + "unavailable": "ankavadow", + "temporarily-unavailable": "ankavadow dres pols", + "partially-unavailable": "ankavadow yn rann", + "station-offline": "pub gorsav radar y'n ranndir dhywarlinen", + "station-incomplete": "aswaow y'n gorherans dhyworth gorsavow radar y'n ranndir", }; diff --git a/test_cases/kw.json b/test_cases/kw.json index ef4b8fc6..49682e1f 100644 --- a/test_cases/kw.json +++ b/test_cases/kw.json @@ -257,5 +257,12 @@ "Glaw pur skav ow talleth le ages 1 myn.": ["sentence", - ["starting-in", "very-light-rain", ["less-than", ["minutes", 1]]]] + ["starting-in", "very-light-rain", ["less-than", ["minutes", 1]]]], + + "Darganow herwydh an our yw ankavadow dres pols drefen bos pub gorsav radar y'n ranndir dhywarlinen.": + ["sentence",["next-hour-forecast-status", "temporarily-unavailable", "station-offline"]], + "Darganow herwydh an our yw ankavadow yn rann drefen bos aswaow y'n gorherans dhyworth gorsavow radar y'n ranndir.": + ["sentence",["next-hour-forecast-status", "partially-unavailable", "station-incomplete"]], + "Darganow herwydh an our yw ankavadow drefen bos pub gorsav radar y'n ranndir dhywarlinen.": + ["sentence",["next-hour-forecast-status", "unavailable", "station-offline"]] }