From a80e4ad32744e8a1cfb66bf106f08cfbeed71ec2 Mon Sep 17 00:00:00 2001 From: Peter Chen Date: Sun, 5 Sep 2021 14:56:04 +0800 Subject: [PATCH 1/3] add zh-TW localization and move file name for zh-CN --- src/localize.js | 6 ++-- src/translations/{zh.json => zh-CN.json} | 0 src/translations/zh-TW.json | 38 ++++++++++++++++++++++++ 3 files changed, 42 insertions(+), 2 deletions(-) rename src/translations/{zh.json => zh-CN.json} (100%) create mode 100644 src/translations/zh-TW.json diff --git a/src/localize.js b/src/localize.js index 540e072..80acc88 100644 --- a/src/localize.js +++ b/src/localize.js @@ -8,7 +8,8 @@ import * as fr from './translations/fr.json'; import * as nb from './translations/nb.json'; import * as pl from './translations/pl.json'; import * as bg from './translations/bg.json'; -import * as zh from './translations/zh.json'; +import * as zh_CN from './translations/zh-CN.json'; +import * as zh_TW from './translations/zh-TW.json'; import * as de from './translations/de.json'; import * as ca from './translations/ca.json'; import * as ru from './translations/ru.json'; @@ -22,7 +23,8 @@ var languages = { nb, pl, bg, - zh, + zh_CN, + zh_TW, de, ca, ru, diff --git a/src/translations/zh.json b/src/translations/zh-CN.json similarity index 100% rename from src/translations/zh.json rename to src/translations/zh-CN.json diff --git a/src/translations/zh-TW.json b/src/translations/zh-TW.json new file mode 100644 index 0000000..fefc446 --- /dev/null +++ b/src/translations/zh-TW.json @@ -0,0 +1,38 @@ +{ + "common": { + "name": "Purifier Card", + "description": "讓您用更輕鬆的方式控制智慧空氣清淨機的卡片。", + "not_available": "實體無法使用", + "toggle_power": "開關" + }, + "state": { + "on": "開", + "off": "關" + }, + "speed": { + "Auto": "自動", + "Silent": "靜音", + "Favorite": "最愛", + "Fan": "送風" + }, + "error": { + "missing_entity": "必須指定實體名稱!", + "xiaomi_miio_level_without_speed": "設定 xiaomi_miio_favorite_level 屬性時必須包含 speed 屬性!" + }, + "editor": { + "entity": "實體名稱(必填)", + "compact_view": "精簡卡片", + "compact_view_aria_label_on": "開啟精簡卡片", + "compact_view_aria_label_off": "關閉精簡卡片", + "show_name": "顯示裝置名稱", + "show_name_aria_label_on": "顯示裝置名稱", + "show_name_aria_label_off": "隱藏裝置名稱", + "show_state": "顯示裝置狀態", + "show_state_aria_label_on": "顯示裝置狀態", + "show_state_aria_label_off": "隱藏裝置狀態", + "show_toolbar": "顯示工具列", + "show_toolbar_aria_label_on": "顯示工具列", + "show_toolbar_aria_label_off": "隱藏工具列", + "code_only_note": "註:必須使用編碼編輯器編輯 actions 與 stats 選項。" + } +} From b0ae73183124b9e02b3fae5ffb8cb6d19e03520e Mon Sep 17 00:00:00 2001 From: Peter Chen Date: Sun, 5 Sep 2021 16:06:25 +0800 Subject: [PATCH 2/3] Update README.md for zh-TW translation --- README.md | 29 +++++++++++++++-------------- 1 file changed, 15 insertions(+), 14 deletions(-) diff --git a/README.md b/README.md index 55ebe69..31b34cf 100644 --- a/README.md +++ b/README.md @@ -102,19 +102,19 @@ compact_view: false Here is what every option means: -| Name | Type | Default | Description | -| ----------------- | :-------: | ------------ | ------------------------------------------------ | -| `type` | `string` | **Required** | `custom:purifier-card` | -| `entity` | `string` | **Required** | An entity_id within the `fan` domain. | -| `show_name` | `boolean` | `true` | Show friendly name of the purifier. | -| `show_status` | `boolean` | `true` | Show status of the purifier. | -| `show_speed` | `boolean` | `false` | Show speed of the purifier in the header. | -| `show_preset_mode`| `boolean` | `true` | Show preset mode of the purifier in the header. | -| `show_toolbar` | `boolean` | `true` | Show toolbar with actions. | -| `compact_view` | `boolean` | `false` | Compact view without image. | -| `aqi` | `object` | Optional | Custom entity or attribute for AQI value. | -| `stats` | `object` | Optional | Custom per state stats for your purifier cleaner | -| `actions` | `object` | Optional | Custom actions for your purifier cleaner. | +| Name | Type | Default | Description | +| ------------------ | :-------: | ------------ | ------------------------------------------------ | +| `type` | `string` | **Required** | `custom:purifier-card` | +| `entity` | `string` | **Required** | An entity_id within the `fan` domain. | +| `show_name` | `boolean` | `true` | Show friendly name of the purifier. | +| `show_status` | `boolean` | `true` | Show status of the purifier. | +| `show_speed` | `boolean` | `false` | Show speed of the purifier in the header. | +| `show_preset_mode` | `boolean` | `true` | Show preset mode of the purifier in the header. | +| `show_toolbar` | `boolean` | `true` | Show toolbar with actions. | +| `compact_view` | `boolean` | `false` | Compact view without image. | +| `aqi` | `object` | Optional | Custom entity or attribute for AQI value. | +| `stats` | `object` | Optional | Custom per state stats for your purifier cleaner | +| `actions` | `object` | Optional | Custom actions for your purifier cleaner. | ### `aqi` object @@ -189,6 +189,7 @@ This card supports translations. Please, help to add more translations and impro - Català (Catalan) - Русский (Russian) - Italiano (Italian) +- 繁體中文 (Traditional Chinese) - [_Your language?_][add-translation] ## Supported models @@ -203,7 +204,7 @@ If this card works with your air purifier, please open a PR and your model to th - Coway Airmega 300S/400S ([using IoCare custom component](https://github.com/sarahhenkens/home-assistant-iocare)) - Dyson Pure Humidify+Cool ([using Dyson integration](https://www.home-assistant.io/integrations/dyson/)) - Winix AM90 Wi-Fi Air Purifier -- Philips AirPurifier AC3858/50 (partially) +- Philips AirPurifier AC3858/50 (partially) - [_Your purifier?_][edit-readme] - SmartMI Air Purifier From 550fdf3f69e79eb1584d7d2d385dbe19489787b7 Mon Sep 17 00:00:00 2001 From: Peter Chen Date: Sun, 5 Sep 2021 16:08:49 +0800 Subject: [PATCH 3/3] en translation: tiny typo fix --- src/translations/en.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/translations/en.json b/src/translations/en.json index f65e563..be30531 100644 --- a/src/translations/en.json +++ b/src/translations/en.json @@ -2,7 +2,7 @@ "common": { "name": "Purifier Card", "description": "Purifier card allows you to control your smart purifier.", - "not_available": "Entity is not avaialable", + "not_available": "Entity is not available", "toggle_power": "Turn on/off" }, "state": {