Skip to content

Commit

Permalink
Add statuses and minor corrections (darkskyapp#286)
Browse files Browse the repository at this point in the history
  • Loading branch information
stanno authored and Jay LaPorte committed Jan 9, 2020
1 parent 9a7a58e commit c4a6355
Show file tree
Hide file tree
Showing 2 changed files with 29 additions and 6 deletions.
16 changes: 13 additions & 3 deletions lib/lang/cy.js
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ module.exports = {
"later-today-morning": "yn hwyrach bore yma",
"today-afternoon": "y prynhawn yma",
"later-today-afternoon": "yn hwyrach prynhawn yma",
"today-evening": "fin nos heno",
"today-evening": "gyda’r hwyr heno",
"later-today-evening": "yn hwyrach fin nos heno",
"today-night": "heno",
"later-today-night": "yn hwyrach heno",
Expand All @@ -58,7 +58,7 @@ module.exports = {
"tomorrow-night": "nos yfory",
"morning": "yn y bore",
"afternoon": "yn y prynhawn",
"evening": "fin nos",
"evening": "gyda’r hwyr",
"night": "dros nos",
"today": "heddiw",
"tomorrow": "yfory",
Expand Down Expand Up @@ -89,8 +89,12 @@ module.exports = {
return "llai na" + (/^(1|8|11|16)[\D\b]/.test(a) ? "g " : " ") + a;
},
"and": function(a, b) {
// don't repeat 'yn y'
if (a.slice(0,5) === "yn y " && b.slice(0,5) === "yn y ")
return a + " a’r " + b.slice(5);
// don't repeat 'ar'
if (a.slice(0,9) === "ar ddydd " && b.slice(0,9) === "ar ddydd ") b = b.slice(4);
if (a.slice(0,9) === "ar ddydd " && b.slice(0,9) === "ar ddydd ")
b = b.slice(4);
return a
// include comma if a list
+ (a.indexOf(",") !== -1 ? "," : "")
Expand Down Expand Up @@ -141,4 +145,10 @@ module.exports = {
str += ".";
return str;
},
"next-hour-forecast-status": "Dydi rhagolygon yr awr nesa $1 oherwydd $2.",
"unavailable": "ddim ar gael",
"temporarily-unavailable": "ddim ar gael ar hyn o bryd",
"partially-unavailable": "ddim yn gyflawn",
"station-offline": "diffyg gwybodaeth o orsafoedd radar gerllaw",
"station-incomplete": "bylchau yn narpariaeth gorsafoedd radar gerllaw",
};
19 changes: 16 additions & 3 deletions test_cases/cy.json
Original file line number Diff line number Diff line change
Expand Up @@ -57,13 +57,13 @@
"medium-snow",
["and", "later-today-evening", "tomorrow-morning"]]],

"Glaw trwm hyd at hwyrach bore yma, gan gychwyn eto fin nos heno.":
"Glaw trwm hyd at hwyrach bore yma, gan gychwyn eto gyda’r hwyr heno.":
["sentence", ["until-starting-again",
"heavy-rain",
"later-today-morning",
"today-evening"]],

"Cymylau trwchus yn cychwyn fin nos, gan barhau hyd at y nos.":
"Cymylau trwchus yn cychwyn gyda’r hwyr, gan barhau hyd at y nos.":
["sentence", ["starting-continuing-until",
"heavy-clouds",
"evening",
Expand Down Expand Up @@ -158,5 +158,18 @@
["through", "friday", "saturday"]],
["temperatures-peaking",
["fahrenheit", 100],
"monday"]]]
"monday"]]],

"Glaw ysgafn yn bosib yn y bore a’r prynhawn.":
["sentence", ["during",
"possible-light-rain", ["and",
"morning", "afternoon"]]],

"Dydi rhagolygon yr awr nesa ddim ar gael ar hyn o bryd oherwydd diffyg gwybodaeth o orsafoedd radar gerllaw.":
["sentence",["next-hour-forecast-status", "temporarily-unavailable", "station-offline"]],
"Dydi rhagolygon yr awr nesa ddim yn gyflawn oherwydd bylchau yn narpariaeth gorsafoedd radar gerllaw.":
["sentence",["next-hour-forecast-status", "partially-unavailable", "station-incomplete"]],
"Dydi rhagolygon yr awr nesa ddim ar gael oherwydd diffyg gwybodaeth o orsafoedd radar gerllaw.":
["sentence",["next-hour-forecast-status", "unavailable", "station-offline"]]

}

0 comments on commit c4a6355

Please sign in to comment.