diff --git a/index.js b/index.js index f639903a..1b52ab83 100644 --- a/index.js +++ b/index.js @@ -1,11 +1,11 @@ "use strict"; -const fs = require("fs"), - path = require("path"); +const fs = require("fs"); +const path = require("path"); -fs.readdirSync(path.join(__dirname, "lib/lang")).forEach(pathname => { +for(const pathname of fs.readdirSync(path.join(__dirname, "lib/lang"))) { const match = /^([^\.].*)\.js$/.exec(pathname); if(match) { exports[match[1]] = require("./lib/lang/" + pathname); } -}); +} diff --git a/lib/lang/zh-tw.js b/lib/lang/zh-tw.js index 84463c55..d76db89c 100644 --- a/lib/lang/zh-tw.js +++ b/lib/lang/zh-tw.js @@ -27,6 +27,8 @@ module.exports = require("../template")({ "light-snow": "小雪", "medium-snow": "降雪", "heavy-snow": "鵝毛大雪", + "possible-thunderstorm": "可能有雷暴", + "thunderstorm": "雷暴", "light-wind": "微風", "medium-wind": "有風", "heavy-wind": "推人大風", @@ -61,6 +63,13 @@ module.exports = require("../template")({ "thursday": "周四", "friday": "周五", "saturday": "周六", + "next-sunday": "下周日", + "next-monday": "下周一", + "next-tuesday": "下周二", + "next-wednesday": "下周三", + "next-thursday": "下周四", + "next-friday": "下周五", + "next-saturday": "下周六", "minutes": "$1分鐘", "fahrenheit": "$1\u00B0F", "celsius": "$1\u00B0C", diff --git a/package.json b/package.json index 41d8372d..06963b54 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "forecast-io-translations", - "version": "1.41.5", + "version": "1.42.0", "description": "translate the Dark Sky API into any language", "author": { "name": "The Dark Sky Company", diff --git a/test_cases/zh-tw.json b/test_cases/zh-tw.json index b4e35f7e..69fcf5c9 100644 --- a/test_cases/zh-tw.json +++ b/test_cases/zh-tw.json @@ -98,6 +98,11 @@ "潮濕,局部多雲": ["title", ["and", "high-humidity", "light-clouds"]], + "多雲,可能有雷暴": + ["title", ["and", "medium-clouds", "possible-thunderstorm"]], + + "多雲,雷暴": + ["title", ["and", "medium-clouds", "thunderstorm"]], "在接下來一個小時內晴朗。": ["sentence", ["for-hour", "clear"]], @@ -135,6 +140,9 @@ "大量降水將持續至下午。": ["sentence", ["until", "heavy-precipitation", "afternoon"]], + "雷暴將持續至下周一。": + ["sentence", ["until", "thunderstorm", "next-monday"]], + "微風持續至下午。": ["sentence", ["during", "light-wind", "afternoon"]],