Skip to content

Commit

Permalink
i18n: zh-TW & chinese for README
Browse files Browse the repository at this point in the history
  • Loading branch information
jerrychan7 committed Jan 3, 2025
1 parent 60301aa commit 2a8bed6
Show file tree
Hide file tree
Showing 9 changed files with 310 additions and 16 deletions.
106 changes: 106 additions & 0 deletions README-zh.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,106 @@
# Obsidian: 显示空白字符

[![GitHub tag (Latest by date)](https://img.shields.io/github/v/tag/ebullient/obsidian-show-whitespace-cm6)](https://github.com/ebullient/obsidian-show-whitespace-cm6/releases) ![GitHub all releases](https://img.shields.io/github/downloads/ebullient/obsidian-show-whitespace-cm6/total?color=success) [![CC BY-SA 4.0][cc-by-sa-shield]][cc-by-sa]

这是一个简单的插件,用于在源码模式和实时阅览模式下启用 CodeMirror 6 扩展以突出显示空白字符。

> 译者:[jerrychan7@github](https://github.com/jerrychan7)
## 功能

- **空白字符可视化:** 显示笔记中的前导和尾随空白字符。
- **引用标志辨别:** 高亮显示引用的前导符号,使其易于区分。
- **列表标记空白:** 为列表标记(项目符号或数字)添加轻微的背景样式。

插件提供的基本 CSS 样式会在行首和行尾显示空白字符(不包括中间的空白字符),以提高可读性。

## 外观/感觉选项

插件提供了一些选项来自定义空白字符的外观和感觉。

您也可以完全禁用插件的 CSS 并使用自己的样式。

1. 使用插件设置禁用 style.css 的注册(这相当于样式设置插件的功能)
2. 将插件的 `style.css` 复制到您自己的 CSS 代码片段文件夹中
3. 根据需要更新样式。

### 示例

启用后,插件始终显示前导空白字符(因为这是最难看到的)。内部/尾随空白字符的显示取决于配置。

- 插件禁用:
<img width="337" alt="image" src="./imgs/plugin-disabled.png">

- 显示所有空白字符(优先于其他设置)、大纲列表标记:
<img width="374" alt="image" src="./imgs/show-all.png">

- 显示连续空白字符、大纲列表标记:
<img width="384" alt="image" src="./imgs/show-consecutive.png">

- 大纲列表标记:
<img width="338" alt="image" src="./imgs/outline-list-markers.png">

### 行尾

在 CSS 代码片段中重新定义 `--line-end``--line-break` 以更改这些字符的显示方式。

```css
body {
--line-end: '¬';
--line-break: '';
}
```

## 安装

安装步骤:

1. 打开 `设置` -> `第三方插件`
2. 关闭安全模式
3. 社区插件市场中 **浏览** 并搜索 "Show Whitespace"
4. 点击安装
5. 安装完成后点击启用,或者在 `设置` -> `第三方插件` -> `已安装插件` 列表中启用插件。

### 使用 Beta Reviewers Auto-update Tester (BRAT) 预览

1. **安装 BRAT:**

- 打开 `设置` -> `第三方插件`
- 关闭安全模式。
- 社区插件市场中点击 *浏览* 并搜索“BRAT”。
- 安装最新版本的 **Obsidian 42 - BRAT**

2. **配置 BRAT:**

- 打开 BRAT 设置(`设置` -> `Obsidian 42 - BRAT`)。
-`Beta Plugin List` 部分,点击 `Add Beta Plugin`
- 指定此仓库:`ebullient/obsidian-show-whitespace-cm6`

3. **启用插件:**

- 导航到 `设置` -> `第三方插件`
- 启用插件。

## 对开发者

欢迎并感谢提交 Pull Request。😀

## 支持

有兴趣支持进一步开发吗?请考虑请我喝杯咖啡!

[<img src="https://cdn.buymeacoffee.com/buttons/v2/default-blue.png" width="200px"/>](https://www.buymeacoffee.com/ebullient)

## 归属

虽然这是一个针对 CM6 的新实现,但样式和字符灵感来自 VSCode 的行为和 [death_au](https://github.com/deathau) 的原始 [Show Whitespace](https://github.com/deathau/cm-show-whitespace-obsidian) 插件。

## 许可证

本作品采用 [知识共享署名-相同方式共享 4.0 国际许可协议][cc-by-sa] 进行许可。

[![CC BY-SA 4.0](https://licensebuttons.net/l/by-sa/4.0/88x31.png)][cc-by-sa]

[cc-by-sa]: http://creativecommons.org/licenses/by-sa/4.0/
[cc-by-sa-image]: https://licensebuttons.net/l/by-sa/4.0/88x31.png
[cc-by-sa-shield]: https://img.shields.io/badge/License-CC%20BY--SA%204.0-lightgrey.svg
106 changes: 106 additions & 0 deletions README-zhTW.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,106 @@
# Obsidian: 顯示空白字元

[![GitHub tag (Latest by date)](https://img.shields.io/github/v/tag/ebullient/obsidian-show-whitespace-cm6)](https://github.com/ebullient/obsidian-show-whitespace-cm6/releases) ![GitHub all releases](https://img.shields.io/github/downloads/ebullient/obsidian-show-whitespace-cm6/total?color=success) [![CC BY-SA 4.0][cc-by-sa-shield]][cc-by-sa]

這是一個簡單的外掛,可啟用 CodeMirror 6 擴展功能以突出顯示原始碼模式和實際預覽模式中的空白字元。

> 譯者:[jerrychan7@github](https://github.com/jerrychan7)
## 特徵

- **空白字元視覺化:** 顯示筆記中的前導和尾隨空白字元。
- **區塊引言識別:** 高亮顯示引用的前導符號,使其易於區分。
- **清單標記空白:** 為有序和無序清單的標記(項目符號或數字)添加輕微的背景樣式。

外掛提供的基本 CSS 樣式會在行首和行尾(而不是中間)呈現空白字元,以提高可讀性。

## 外觀/感覺選項

外掛提供了一些選項來自訂空白字元的外觀和感覺。

您也可以完全禁用外掛的 CSS 並使用您自己的樣式。

1. 使用外掛設置禁用 style.css 的註冊(這於樣式設置外掛的功能相同)
2. 將外掛程式的 `style.css` 複製到您自己的 CSS snippets 片段資料夾中
3. 根據需要更新樣式。

### 範例

啟用後,外掛始終顯示前導空白字元(因為這是最難看到的)。內部/尾隨空白字元的顯示取決於配置。

- 外掛程式停用時:
<img width="337" alt="image" src="./imgs/plugin-disabled.png">

- 顯示所有空白字元(優先於其他設定)、大綱清單標記:
<img width="374" alt="image" src="./imgs/show-all.png">

- 顯示連續空白字元、大綱清單標記:
<img width="384" alt="image" src="./imgs/show-consecutive.png">

- 大綱清單標記:
<img width="338" alt="image" src="./imgs/outline-list-markers.png">

### 行尾

在 CSS 片段中重新定義 `--line-end``--line-break` 以變更這些字元的顯示方式。

```css
body {
--line-end: '¬';
--line-break: '';
}
```

## 安裝

安裝步驟:

1. 打開 `設置` -> `第三方外掛程式`
2. 啟用社群外掛程式
3. 在社群外掛程式中 **瀏覽** 並搜尋 "Show Whitespace"
4. 點擊安裝
5. 安裝完成后點擊啓用,或者在 `設置` -> `第三方外挂程式` -> `已安裝外挂程式` 列表中啓用。

### 使用 Beta Reviewers Auto-update Tester (BRAT) 預覽

1. **安裝 BRAT**

- 打開 `設置` -> `第三方外掛程式`
- 啟用社群外掛程式。
- 在社群外掛程式中 *瀏覽* 並搜尋“BRAT”。
- 安裝最新版本的 **Obsidian 42 - BRAT**

2. **配置 BRAT**

- 打開 BRAT 設置(`設置` -> `Obsidian 42 - BRAT`)。
-`Beta Plugin List` 部分,點擊 `Add Beta Plugin`
- 指定此儲存庫:`ebullient/obsidian-show-whitespace-cm6`

3. **啟用外掛**

- 導航至 `設置` -> `第三方外掛程式`
- 啟用外掛。

## 對於開發者

歡迎並感謝提交 Pull Request。😀

## 支援

有興趣支持進一步開發嗎?考慮給我買杯咖啡吧!

[<img src="https://cdn.buymeacoffee.com/buttons/v2/default-blue.png" width="200px"/>](https://www.buymeacoffee.com/ebullient)

## 歸屬

雖然這是針對 CM6 的新實現,但樣式和字元的靈感來自 VSCode 的行為和 [death_au](https://github.com/deathau) 的原始 [Show Whitespace](https://github.com/deathau/cm-show-whitespace-obsidian) 外掛程式。

## 執照

本作品採用 [創用 CC 姓名標示-相同方式分享 4.0 國際 授權條款][cc-by-sa] 進行授權。

[![CC BY-SA 4.0](https://licensebuttons.net/l/by-sa/4.0/88x31.png)][cc-by-sa]

[cc-by-sa]: http://creativecommons.org/licenses/by-sa/4.0/
[cc-by-sa-image]: https://licensebuttons.net/l/by-sa/4.0/88x31.png
[cc-by-sa-shield]: https://img.shields.io/badge/License-CC%20BY--SA%204.0-lightgrey.svg
42 changes: 26 additions & 16 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,21 +1,25 @@
# Obsidian: Show Whitespace

[![GitHub tag (Latest by date)](https://img.shields.io/github/v/tag/ebullient/obsidian-show-whitespace-cm6)](https://github.com/ebullient/obsidian-show-whitespace-cm6/releases) ![GitHub all releases](https://img.shields.io/github/downloads/ebullient/obsidian-show-whitespace-cm6/total?color=success) [![CC BY-SA 4.0][cc-by-sa-shield]][cc-by-sa]

This is a simple plugin to enable CodeMirror 6 extensions to highlight whitespace in both Source and Live Preview modes.
Translate: [简体中文](./README-zh.md)[繁體中文](./README-zhTW.md)

This is a simple plugin to enable CodeMirror 6 extensions to highlight whitespace in both Source and Live Preview modes.

## Features

- **Whitespace Visualization:** Displays leading and trailing whitespace in your notes.
- **Blockquote Identification:** Highlights the leading caret for blockquotes, making them easily distinguishable.
- **List marker whitespace:** Slight background applied to whitespace assigned to list markers (bullets or numbers)

Basic CSS styling provided by the plugin renders characters for whitespace at the beginning and ending of lines (not in the middle) for readability.
Basic CSS styling provided by the plugin renders characters for whitespace at the beginning and ending of lines (not in the middle) for readability.

## Look / Feel options

The plugin provides a few options to customize the look and feel of whitespace characters.

You can also completely disable the plugin's CSS and use your own.

1. Use the plugin setting to disable registration of style.css (this functions as a style settings plugin would)
2. Copy the plugin `style.css` into your own CSS snippet
3. Update styles as desired.
Expand All @@ -26,20 +30,20 @@ Once enabled, the plugin always shows leading space (as that is the hardest to s
Display of inner/trailing spaces depends on configuration.

- Plugin disabled:
<img width="337" alt="image" src="https://github.com/user-attachments/assets/0b7f3026-106b-4692-a791-2fb37c6d974c">
<img width="337" alt="image" src="./imgs/plugin-disabled.png">

- Show all whitespace (preempts other settings), outline list markers:
<img width="374" alt="image" src="https://github.com/user-attachments/assets/2e102973-e432-4885-a904-362d12604e98">
<img width="374" alt="image" src="./imgs/show-all.png">

- Show consecutive whitespace, outline list markers:
<img width="384" alt="image" src="https://github.com/user-attachments/assets/e91cb05d-387d-453d-bcb7-f08075a6ccb2">
<img width="384" alt="image" src="./imgs/show-consecutive.png">

- Outline list markers:
<img width="338" alt="image" src="https://github.com/user-attachments/assets/b25dc1b3-5238-4fd4-b41a-f69935864098">
<img width="338" alt="image" src="./imgs/outline-list-markers.png">

### Line endings

Redefine `--line-end` or `--line-break` to change how those characters appear in a snippet.
Redefine `--line-end` or `--line-break` to change how those characters appear in a snippet.

```css
body {
Expand All @@ -51,6 +55,7 @@ body {
## Installation

To install:

1. Open `Settings` -> `Community Plugins`
2. Disable safe mode
3. **Browse** and search for "Show Whitespace"
Expand All @@ -60,17 +65,22 @@ To install:
### Preview with Beta Reviewers Auto-update Tester (BRAT)

1. **Install BRAT**:
- Open `Settings` -> `Community Plugins`.
- Disable safe mode.
- *Browse*, and search for "BRAT."
- Install the latest version of **Obsidian 42 - BRAT**.

- Open `Settings` -> `Community Plugins`.
- Disable safe mode.
- *Browse*, and search for "BRAT."
- Install the latest version of **Obsidian 42 - BRAT**.

2. **Configure BRAT**:
- Open BRAT settings (`Settings` -> `Obsidian 42 - BRAT`).
- In the `Beta Plugin List` section, click `Add Beta Plugin`.
- Specify this repository: `ebullient/obsidian-show-whitespace-cm6`.

- Open BRAT settings (`Settings` -> `Obsidian 42 - BRAT`).
- In the `Beta Plugin List` section, click `Add Beta Plugin`.
- Specify this repository: `ebullient/obsidian-show-whitespace-cm6`.

3. **Enable the Plugin**:
- Navigate to `Settings` -> `Community Plugins`.
- Enable the plugin.

- Navigate to `Settings` -> `Community Plugins`.
- Enable the plugin.

## For developers

Expand Down
Binary file added imgs/outline-list-markers.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added imgs/plugin-disabled.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added imgs/show-all.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added imgs/show-consecutive.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 2 additions & 0 deletions src/i18n/index.ts
Original file line number Diff line number Diff line change
@@ -1,10 +1,12 @@

import { en } from './en';
import { zh } from './zh';
import { zhTW } from './zhTW';

export const allTranslate = {
en,
zh,
"zh-TW": zhTW,
};

export const getTranslate = (lang: string) =>
Expand Down
70 changes: 70 additions & 0 deletions src/i18n/zhTW.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,70 @@
export const zhTW = {
manifestName: "顯示空白字元",

block1: {
name: "顯示空白字元",
},
saveSettings: {
name: "儲存設定",
resetBtn: {
tooltip: "重設為先前儲存(或生成)的值"
},
saveBtn: {
tooltip: "儲存當前值"
},
},
suppressPluginStyles: {
name: "禁用插件樣式",
desc: "禁用插件的預設樣式。" +
"您需要提供自己的 CSS 代碼片段來自訂空白字元的外觀。",
},
showBlockquoteMarkers: {
name: "顯示引用標記",
desc: "在實際預覽模式下始終顯示引用的前導 '>'。",
},
highlightListMarkers: {
name: "高亮清单標記",
desc: "為清单標記(例如 '-', '1.')預留的空間添加視覺樣式。",
},

block2: {
name: "空白字元",
desc: "預設情況下,此插件將顯示前導和尾隨空白字元," +
"包括行尾、硬換行和製表符的標記。",
},
showAllWhitespace: {
name: "顯示所有空白字元",
desc: "顯示所有空白字元的標記,包括單詞之間的空白字元。",
},
showConsecutiveWhitespace: {
name: "顯示連續空白字元",
desc: "僅顯示單詞之間多個連續空白字元的標記(包含在“顯示所有空白字元”中)。",
},
showLineEndings: {
name: "顯示行尾",
desc: "顯示行尾的標記(不同於硬換行)。",
},

block3: {
name: "內容類型",
desc: "以下設定允許您啟用或禁用文件中空白字元的顯示。" +
"除非另有說明,否則空白字元的外觀遵循上述設定。",
},
showFrontmatterWhitespace: {
name: "顯示前言空白字元",
desc: "在 YAML 前言(屬性)中顯示空白字元。",
},
showTableWhitespace: {
name: "顯示表格空白字元",
desc: "在表格中顯示前導或尾隨空白字元。",
},
showCodeBlockWhitespace: {
name: "顯示程式碼區塊空白字元",
desc: "在程式碼區塊中顯示前導/尾隨空白字元(包含在“顯示所有程式碼區塊空白字元”中)。",
},
showAllCodeBlockWhitespace: {
name: "顯示所有程式碼區塊空白字元",
desc: "顯示程式碼區塊中的所有空白字元,使其看起來更像程式碼編輯器。" +
"這將覆蓋上述設定。",
},
};

0 comments on commit 2a8bed6

Please sign in to comment.