Add MX05, MX06 as supported, minor fix;

better Chinese conversion infrastructure
This commit is contained in:
NaitLee 2023-02-12 19:37:24 +08:00
parent 5b283969fb
commit 423a9caf49
32 changed files with 951 additions and 33 deletions

View File

@ -1,8 +1,8 @@
#!/bin/sh
cd www/lang/
echo "opencc zh-CN to zh-TW..."
./0-opencc.sh
cd ..
cd zh-conv
echo "Convert Chinese Language with OpenCC"
./0-convert.sh
cd ../www
echo "tsc bundle scripts..."
./0-transpile.sh
cd ..

View File

@ -1,4 +1,4 @@
English | [Deutsch](./readme.i18n/README.de_DE.md) | [简体中文](./readme.i18n/README.zh_CN.md)
English | [Deutsch](./readme.i18n/README.de_DE.md) | [中文(简体字)](./readme.i18n/README.zh_CN.md) | [中文(正體字)](./readme.i18n/README.zh_TW.md) | [中文(香港字)](./readme.i18n/README.zh_HK.md)
# Cat-Printer

7
TODO
View File

@ -16,13 +16,14 @@ Note: not ordered. do whatever I/you want
+ Service for other init systems (a systemd unit file is there)
+ ...
? Optimize PF2 text printing? It seems a bit slow (in algorithm).
? Use Go as part of backend? It can boost things up, and build some (essential) image manipulation in, quicker. And strip some way-too-big Python libs away (for smaller Windows/Android dist).
? Optimize PF2 text printing? It seems a bit slow (in bit processing).
? Use something else as server part of backend? This can boost things up, and build some (essential) image manipulation in, quicker. And strip some way-too-big Python libs away (for smaller Windows/Android dist).
? Built-in PostScript (Even if very basic)
? Data compression for GB03. Optional
? Data compression for GB03 alike. Optional
? Plugin, for including community features (that involves usefulness but also bloatness)
It's usually messy. Try forking in your own way, at the moment.
? Process picture with WebAssembly? (Web frontend only)
Tried, Not as efficient as pure JavaScript
? Put Android APP on F-Droid? But it needs automatic build system...
Android guys can help this!
? ... Or put to APKPure? But make frontend well before doing all of these

View File

@ -1,8 +1,14 @@
'Printer model specifications. License CC0-1.0-only'
'''
Printer model specifications.
No rights reserved.
License CC0-1.0-only: https://directory.fsf.org/wiki/License:CC0
'''
class Model():
''' A printer model
Note: these currently make no obvious sense
`paper_width`: pixels per line for the model/paper
`is_new`: some models can use compressed data. the algorithm isn't implemented in Cat-Printer yet, but should be no harm.
'''
paper_width: int
is_new_kind: bool
@ -12,6 +18,8 @@ class Model():
Models = {
'YT01': Model(384, False),
'MX05': Model(384, False),
'MX06': Model(384, False),
'GB01': Model(384, False),
'GB02': Model(384, False),
'GB03': Model(384, True),

View File

@ -1,5 +1,5 @@
'''
Python lib for reading PF2 font files: http://grub.gibibit.com/New_font_format
Python snippet for reading PF2 font files: http://grub.gibibit.com/New_font_format
No rights reserved.
License CC0-1.0-only: https://directory.fsf.org/wiki/License:CC0

View File

@ -14,6 +14,8 @@
## 特性
[跳到安装向导](#现在开始)
*当前仍在继续开发。以后会有更多!*
- 简易!
@ -133,9 +135,8 @@ Copyright © 2021-2022 NaitLee Soft. 保留一些权利。
您可能对翻译工作感兴趣。可于目录 `www/lang``readme.i18n/` 中查看翻译文件!
注:
1. 通常英语与简体中文同时更新。请考虑其他,如繁体中文(需注意在繁体中与简体的用字、技术术语差别)。
2. 目前使用 [OpenCC](https://github.com/BYVoid/OpenCC) 转换简体到繁体(臺灣正體)。若有不当之处,请指出。
当前仅转换程序界面语言、暂不转换文档。
1. 通常英语与中文同时更新。请考虑其他。
2. 目前使用 [OpenCC](https://github.com/BYVoid/OpenCC) 从传统字转换到简体、正体、香港字。若有不当之处,请指出。
3. 如果(真的)有能力,您也可以纠正/改善某些翻译!
还想写代码?看看 [development.md](development.md)!(英文)

159
readme.i18n/README.zh-HK.md Normal file
View File

@ -0,0 +1,159 @@
# Cat-Printer
🐱🖨 貓咪打印機:此應用*跨平台地*對一些藍牙“喵喵機”提供支持!
[![cat-printer-poster](https://repository-images.githubusercontent.com/403563361/93e32942-856c-4552-a8b0-b03c0976a3a7)](https://repository-images.githubusercontent.com/403563361/93e32942-856c-4552-a8b0-b03c0976a3a7)
## 型號
已知支持:`GB0X, GT01, YT01` `X` 表示任意數字)
可在 Web 界面測試未列出的型號。在 `設置 -> 測試未知設備`
有概率成功!
## 特性
[跳到安裝嚮導](#現在開始)
*當前仍在繼續開發。以後會有更多!*
- 簡易!
- 在網頁界面進行操作,
- 或者獲取安卓應用!
- 友好!
- 語言支持!您可參與翻譯!
- 良好的用户界面,可適應桌面/移動端/明暗主題!
- 無障礙功能,考慮到每一個人!
- 功能豐富!
- 網頁界面,所有人都可以用!
- 控制打印機配置
- 打印照片,或單純地進行測試
- 命令行,技術愛好者必備!
- 使用一些參數控制打印機
- 簡易、簡化的圖片或文字打印
- 讓程序的每一部分發揮作用
- 其他一些好東西!
- 服務器也具有 CUPS/IPP 能力
- 跨平台!
- 較新的 Windows 10 及以上
- GNU/Linux
- MacOS
- 還有安卓!
- 是[自由軟件](https://www.gnu.org/philosophy/free-sw.html)
- 不像那些專有應用,此作品為在乎*開放思想與計算自由*的人而生!
- 有意思!
- 做什麼都可以!
## 現在開始
### 安卓
獲取並安裝最新版安卓 apk 包,完成!
應用可能請求“後台位置”權限,您可以拒絕它。
(前台)位置權限是較新版安卓系統掃描藍牙設備所需要的。
建議將掃描時間設為 1 秒。
### Windows
獲取名稱中有 "windows" 的版本,
解壓並運行 `start.bat`
Windows 通常需要較長的掃描時間。默認為 4 秒,可按需調整。
### GNU/Linux
您可以獲取“純淨(pure)”版,解壓、在其中打開終端並輸入:
```bash
python3 server.py
```
建議將掃描時間設為 2 秒。
在 Arch Linux 等發行版您可能需要首先安裝 `bluez`
```bash
sudo pacman -S bluez bluez-utils
```
*以後將有軟件包!*
### MacOS
MacOS 用户請首先安裝 [Python 3](https://www.python.org/)
然後在終端使用 `pip` 安裝 `pyobjc``bleak`
```bash
pip3 install pyobjc bleak
```
然後獲取並使用“單一(bare)”版:
```bash
python3 server.py
```
### 值得注意
對於所有支持的平台,
當已安裝 [Python 3](https://www.python.org/) 時,您可以直接獲取“純淨(pure)”版,
或在已使用 `pip` 安裝 `bleak` 時使用“單一(bare)”版。
如果您喜歡命令行,安裝 [ImageMagick](https://imagemagick.org/) 和 [Ghostscript](https://ghostscript.com/) 會很有幫助。
查看所有[發佈版本](https://github.com/NaitLee/Cat-Printer/releases)
## 有問題?
有想法?用 Issue 或去 Discussion 討論!
如果能行Pull Request 也可以!
## 許可證
Copyright © 2021-2022 NaitLee Soft. 保留一些權利。
```
本程序是自由軟件:你可以再分發之和/或依照由自由軟件基金會發布的 GNU 通用公共許可證修改之,無論是版本 3 許可證,還是(按你的決定)任何以後版都可以。
發佈該程序是希望它能有用,但是並無保障;甚至連可銷售和符合某個特定的目的都不保證。請參看 GNU 通用公共許可證,瞭解詳情。
你應該隨程序獲得一份 GNU 通用公共許可證的複本。如果沒有,請看 <https://www.gnu.org/licenses/>
```
敬請查看文件 `LICENSE`,以及在 `www/jslicense.html` 中有關 JavaScript 許可的詳細內容。
具體地,`printer.py``server.py``main.js` 以 GNU GPL 3 發佈(`GPL-3.0-or-later`)。
其餘所有部分,若無特殊聲明,均在公有領域(`CC0-1.0-only`)。
--------
## 開發
您可能對翻譯工作感興趣。可於目錄 `www/lang``readme.i18n/` 中查看翻譯文件!
注:
1. 通常英語與中文同時更新。請考慮其他。
2. 目前使用 [OpenCC](https://github.com/BYVoid/OpenCC) 從傳統字轉換到簡體、正體、香港字。若有不當之處,請指出。
3. 如果(真的)有能力,您也可以糾正/改善某些翻譯!
還想寫代碼?看看 [development.md](development.md)!(英文)
那之後,可以將您的貢獻概括添加至 `www/about.html`
### 鳴謝
- 當然不能沒有 Python 和 Web 技術!
- [Bleak](https://bleak.readthedocs.io/en/latest/) 跨平台藍牙低功耗庫,牛!
- [roddeh-i18n](https://github.com/roddeh/i18njs),當前內置的國際化功能受此啓發
- [PF2 font](http://grub.gibibit.com/New_font_format),很好的簡易像素字體格式
- ImageMagick 和 Ghostscript有用的東西已經在系統裏就當然不用考慮別的了
- [python-for-android](https://python-for-android.readthedocs.io/en/latest/),雖然有些麻煩的地方
- [AdvancedWebView](https://github.com/delight-im/Android-AdvancedWebView) 從 Java 拯救了我的生命
- Stack Overflow 和整個互聯網,你們讓我從零開始瞭解了安卓“活動” `Activity`
……當然還有其他方面的幫助
- 每一位貢獻於 Issue/Pull Request/Discussion 的人
- 每一位使用此作品並關心軟件自由的人
- ……每個人都是好樣的!

View File

@ -0,0 +1,159 @@
# Cat-Printer
🐱🖨 貓咪打印機:此應用*跨平臺地*對一些藍牙「喵喵機」提供支持!
[![cat-printer-poster](https://repository-images.githubusercontent.com/403563361/93e32942-856c-4552-a8b0-b03c0976a3a7)](https://repository-images.githubusercontent.com/403563361/93e32942-856c-4552-a8b0-b03c0976a3a7)
## 型號
已知支持:`GB0X, GT01, YT01` `X` 表示任意數字)
可在 Web 界面測試未列出的型號。在 `設置 -> 測試未知設備`
有概率成功!
## 特性
[跳到安裝嚮導](#現在開始)
*當前仍在繼續開發。以後會有更多!*
- 簡易!
- 在網頁界面進行操作,
- 或者獲取安卓應用!
- 友好!
- 語言支持!您可參與翻譯!
- 良好的用戶界面,可適應桌面/移動端/明暗主題!
- 無障礙功能,考慮到每一個人!
- 功能豐富!
- 網頁界面,所有人都可以用!
- 控制打印機配置
- 打印照片,或單純地進行測試
- 命令行,技術愛好者必備!
- 使用一些參數控制打印機
- 簡易、簡化的圖片或文字打印
- 讓程序的每一部分發揮作用
- 其他一些好東西!
- 服務器也具有 CUPS/IPP 能力
- 跨平臺!
- 較新的 Windows 10 及以上
- GNU/Linux
- MacOS
- 還有安卓!
- 是[自由軟件](https://www.gnu.org/philosophy/free-sw.html)
- 不像那些專有應用,此作品爲在乎*開放思想與計算自由*的人而生!
- 有意思!
- 做什麼都可以!
## 現在開始
### 安卓
獲取並安裝最新版安卓 apk 包,完成!
應用可能請求「後臺位置」權限,您可以拒絕它。
(前臺)位置權限是較新版安卓系統掃描藍牙設備所需要的。
建議將掃描時間設爲 1 秒。
### Windows
獲取名稱中有 "windows" 的版本,
解壓並運行 `start.bat`
Windows 通常需要較長的掃描時間。默認爲 4 秒,可按需調整。
### GNU/Linux
您可以獲取「純淨(pure)」版,解壓、在其中打開終端並輸入:
```bash
python3 server.py
```
建議將掃描時間設爲 2 秒。
在 Arch Linux 等發行版您可能需要首先安裝 `bluez`
```bash
sudo pacman -S bluez bluez-utils
```
*以後將有軟件包!*
### MacOS
MacOS 用戶請首先安裝 [Python 3](https://www.python.org/)
然後在終端使用 `pip` 安裝 `pyobjc``bleak`
```bash
pip3 install pyobjc bleak
```
然後獲取並使用「單一(bare)」版:
```bash
python3 server.py
```
### 值得注意
對於所有支持的平臺,
當已安裝 [Python 3](https://www.python.org/) 時,您可以直接獲取「純淨(pure)」版,
或在已使用 `pip` 安裝 `bleak` 時使用「單一(bare)」版。
如果您喜歡命令行,安裝 [ImageMagick](https://imagemagick.org/) 和 [Ghostscript](https://ghostscript.com/) 會很有幫助。
查看所有[發佈版本](https://github.com/NaitLee/Cat-Printer/releases)
## 有問題?
有想法?用 Issue 或去 Discussion 討論!
如果能行Pull Request 也可以!
## 許可證
Copyright © 2021-2022 NaitLee Soft. 保留一些權利。
```
本程序是自由軟件:你可以再分發之和/或依照由自由軟件基金會發布的 GNU 通用公共許可證修改之,無論是版本 3 許可證,還是(按你的決定)任何以後版都可以。
發佈該程序是希望它能有用,但是並無保障;甚至連可銷售和符合某個特定的目的都不保證。請參看 GNU 通用公共許可證,瞭解詳情。
你應該隨程序獲得一份 GNU 通用公共許可證的複本。如果沒有,請看 <https://www.gnu.org/licenses/>
```
敬請查看文件 `LICENSE`,以及在 `www/jslicense.html` 中有關 JavaScript 許可的詳細內容。
具體地,`printer.py``server.py``main.js` 以 GNU GPL 3 發佈(`GPL-3.0-or-later`)。
其餘所有部分,若無特殊聲明,均在公有領域(`CC0-1.0-only`)。
--------
## 開發
您可能對翻譯工作感興趣。可於目錄 `www/lang``readme.i18n/` 中查看翻譯文件!
注:
1. 通常英語與中文同時更新。請考慮其他。
2. 目前使用 [OpenCC](https://github.com/BYVoid/OpenCC) 從傳統字轉換到簡體、正體、香港字。若有不當之處,請指出。
3. 如果(真的)有能力,您也可以糾正/改善某些翻譯!
還想寫代碼?看看 [development.md](development.md)!(英文)
那之後,可以將您的貢獻概括添加至 `www/about.html`
### 鳴謝
- 當然不能沒有 Python 和 Web 技術!
- [Bleak](https://bleak.readthedocs.io/en/latest/) 跨平臺藍牙低功耗庫,牛!
- [roddeh-i18n](https://github.com/roddeh/i18njs),當前內置的國際化功能受此啓發
- [PF2 font](http://grub.gibibit.com/New_font_format),很好的簡易像素字體格式
- ImageMagick 和 Ghostscript有用的東西已經在系統裏就當然不用考慮別的了
- [python-for-android](https://python-for-android.readthedocs.io/en/latest/),雖然有些麻煩的地方
- [AdvancedWebView](https://github.com/delight-im/Android-AdvancedWebView) 從 Java 拯救了我的生命
- Stack Overflow 和整個互聯網,你們讓我從零開始瞭解了安卓「活動」 `Activity`
……當然還有其他方面的幫助
- 每一位貢獻於 Issue/Pull Request/Discussion 的人
- 每一位使用此作品並關心軟件自由的人
- ……每個人都是好樣的!

159
readme.i18n/README.zh-TW.md Normal file
View File

@ -0,0 +1,159 @@
# Cat-Printer
🐱🖨 貓咪印表機:此應用*跨平臺地*對一些藍芽「喵喵機」提供支援!
[![cat-printer-poster](https://repository-images.githubusercontent.com/403563361/93e32942-856c-4552-a8b0-b03c0976a3a7)](https://repository-images.githubusercontent.com/403563361/93e32942-856c-4552-a8b0-b03c0976a3a7)
## 型號
已知支援:`GB0X, GT01, YT01` `X` 表示任意數字)
可在 Web 介面測試未列出的型號。在 `設定 -> 測試未知裝置`
有機率成功!
## 特性
[跳到安裝嚮導](#現在開始)
*當前仍在繼續開發。以後會有更多!*
- 簡易!
- 在網頁介面進行操作,
- 或者獲取安卓應用!
- 友好!
- 語言支援!您可參與翻譯!
- 良好的用家介面,可適應桌面/移動端/明暗主題!
- 無障礙功能,考慮到每一個人!
- 功能豐富!
- 網頁介面,所有人都可以用!
- 控制印表機配置
- 列印照片,或單純地進行測試
- 命令列,技術愛好者必備!
- 使用一些引數控制印表機
- 簡易、簡化的圖片或文字列印
- 讓程式的每一部分發揮作用
- 其他一些好東西!
- 伺服器也具有 CUPS/IPP 能力
- 跨平臺!
- 較新的 Windows 10 及以上
- GNU/Linux
- MacOS
- 還有安卓!
- 是[自由軟體](https://www.gnu.org/philosophy/free-sw.html)
- 不像那些專有應用,此作品為在乎*開放思想與計算自由*的人而生!
- 有意思!
- 做什麼都可以!
## 現在開始
### 安卓
獲取並安裝最新版安卓 apk 包,完成!
應用可能請求「後臺位置」許可權,您可以拒絕它。
(前臺)位置許可權是較新版安卓系統掃描藍芽裝置所需要的。
建議將掃描時間設為 1 秒。
### Windows
獲取名稱中有 "windows" 的版本,
解壓並執行 `start.bat`
Windows 通常需要較長的掃描時間。預設為 4 秒,可按需調整。
### GNU/Linux
您可以獲取「純淨(pure)」版,解壓、在其中開啟終端並輸入:
```bash
python3 server.py
```
建議將掃描時間設為 2 秒。
在 Arch Linux 等發行版您可能需要首先安裝 `bluez`
```bash
sudo pacman -S bluez bluez-utils
```
*以後將有軟體包!*
### MacOS
MacOS 用家請首先安裝 [Python 3](https://www.python.org/)
然後在終端使用 `pip` 安裝 `pyobjc``bleak`
```bash
pip3 install pyobjc bleak
```
然後獲取並使用「單一(bare)」版:
```bash
python3 server.py
```
### 值得注意
對於所有支援的平臺,
當已安裝 [Python 3](https://www.python.org/) 時,您可以直接獲取「純淨(pure)」版,
或在已使用 `pip` 安裝 `bleak` 時使用「單一(bare)」版。
如果您喜歡命令列,安裝 [ImageMagick](https://imagemagick.org/) 和 [Ghostscript](https://ghostscript.com/) 會很有幫助。
檢視所有[釋出版本](https://github.com/NaitLee/Cat-Printer/releases)
## 有問題?
有想法?用 Issue 或去 Discussion 討論!
如果能行Pull Request 也可以!
## 許可證
Copyright © 2021-2022 NaitLee Soft. 保留一些權利。
```
本程式是自由軟體:你可以再分發之和/或依照由自由軟體基金會發布的 GNU 通用公共許可證修改之,無論是版本 3 許可證,還是(按你的決定)任何以後版都可以。
釋出該程式是希望它能有用,但是並無保障;甚至連可銷售和符合某個特定的目的都不保證。請參看 GNU 通用公共許可證,瞭解詳情。
你應該隨程式獲得一份 GNU 通用公共許可證的複本。如果沒有,請看 <https://www.gnu.org/licenses/>
```
敬請檢視檔案 `LICENSE`,以及在 `www/jslicense.html` 中有關 JavaScript 許可的詳細內容。
具體地,`printer.py``server.py``main.js` 以 GNU GPL 3 釋出(`GPL-3.0-or-later`)。
其餘所有部分,若無特殊宣告,均在公有領域(`CC0-1.0-only`)。
--------
## 開發
您可能對翻譯工作感興趣。可於目錄 `www/lang``readme.i18n/` 中檢視翻譯檔案!
注:
1. 通常英語與中文同時更新。請考慮其他。
2. 目前使用 [OpenCC](https://github.com/BYVoid/OpenCC) 從傳統字轉換到簡體、正體、香港字。若有不當之處,請指出。
3. 如果(真的)有能力,您也可以糾正/改善某些翻譯!
還想寫程式碼?看看 [development.md](development.md)!(英文)
那之後,可以將您的貢獻概括新增至 `www/about.html`
### 鳴謝
- 當然不能沒有 Python 和 Web 技術!
- [Bleak](https://bleak.readthedocs.io/en/latest/) 跨平臺藍芽低功耗庫,牛!
- [roddeh-i18n](https://github.com/roddeh/i18njs),當前內建的國際化功能受此啟發
- [PF2 font](http://grub.gibibit.com/New_font_format),很好的簡易畫素字型格式
- ImageMagick 和 Ghostscript有用的東西已經在系統裡就當然不用考慮別的了
- [python-for-android](https://python-for-android.readthedocs.io/en/latest/),雖然有些麻煩的地方
- [AdvancedWebView](https://github.com/delight-im/Android-AdvancedWebView) 從 Java 拯救了我的生命
- Stack Overflow 和整個網際網路,你們讓我從零開始瞭解了安卓「活動」 `Activity`
……當然還有其他方面的幫助
- 每一位貢獻於 Issue/Pull Request/Discussion 的人
- 每一位使用此作品並關心軟體自由的人
- ……每個人都是好樣的!

View File

@ -182,6 +182,10 @@ class PrinterServerHandler(BaseHTTPRequestHandler):
for key in settings:
self.settings[key] = settings[key]
else:
if IsAndroid:
self.settings['scan_time'] = 1.0
elif os.name in ('posix',):
self.settings['scan_time'] = 2.0
self.save_config()
def save_config(self):
@ -349,7 +353,10 @@ def serve():
# Request required bluetooth permissions (Android 12+)
if IsAndroid:
from android.permissions import request_permissions, Permission
request_permissions([Permission.BLUETOOTH_SCAN, Permission.BLUETOOTH_CONNECT])
try:
request_permissions([Permission.BLUETOOTH_SCAN, Permission.BLUETOOTH_CONNECT])
except Exception:
pass
try:
server.serve_forever()

View File

@ -1 +1 @@
0.6.1
0.6.2.0

View File

@ -29,7 +29,7 @@
<dt>
<a target="_blank" href="https://github.com/frankenstein91">frankenstein91</a>
</dt>
<dd data-i18n="developer">Developer</dd>
<dd data-i18n="collaborator">Collaborator</dd>
<dd data-i18n="translator">Translator</dd>
</dl>
<dl>
@ -42,7 +42,7 @@
<dt>
<a target="_blank" href="https://github.com/sync1211">sync1211</a>
</dt>
<dd data-i18n="developer">Developer</dd>
<dd data-i18n="collaborator">Collaborator</dd>
<dd data-i18n="translator">Translator</dd>
</dl>
<dl>

View File

@ -1,3 +0,0 @@
#!/bin/sh
# convert with OpenCC: https://github.com/BYVoid/OpenCC
sed 's/中文(简体)/中文(臺灣正體)/' < zh-CN.json | opencc -c s2twp.json > zh-TW.json

View File

@ -94,6 +94,7 @@
"home-page-": "Homepage:",
"contributors": "Mitwirkende",
"developer": "Entwickler",
"collaborator": "Collaborator",
"translator": "Übersetzer",
"all-users-and-developers": "Alle Tester & Benutzer",
"everyone-is-awesome": "Ihr seid alle fantastisch",

View File

@ -90,6 +90,7 @@
"home-page-": "Home Page:",
"contributors": "Contributors",
"developer": "Developer",
"collaborator": "Collaborator",
"translator": "Translator",
"all-users-and-developers": "All users & developers",
"everyone-is-awesome": "Everyone is awesome!",

View File

@ -1,7 +1,9 @@
{
"en-US": "English (US)",
"zh-CN": "中文(简体)",
"zh-TW": "中文(臺灣正體)",
"de-DE": "Deutsch",
"lolcat": "LOLCAT"
"zh-CN": "中文(简体字)",
"zh-TW": "中文(正體字)",
"zh-HK": "中文(香港字)",
"lolcat": "LOLCAT",
"zh-Hant-CN": "中文(傳統字)"
}

View File

@ -85,6 +85,7 @@
"home-page-": "CAT HOME>",
"contributors": "GOOD PEEPL",
"developer": "H4CKR",
"collaborator": "FRIENZ",
"translator": "LOLCAT",
"all-users-and-developers": "ALL LITL N BIG CATS",
"everyone-is-awesome": "YA LL AWSOM!!",

View File

@ -1,5 +1,5 @@
{
"$language": "中文(简体",
"$language": "中文(简体",
"cat-printer": "猫咪打印机",
"printer": "打印机",
"device-": "设备:",
@ -81,10 +81,11 @@
"home-page-": "主页:",
"contributors": "贡献者",
"developer": "开发者",
"collaborator": "合作",
"translator": "翻译",
"all-users-and-developers": "每位用户及开发者",
"everyone-is-awesome": "每个人都是好样的!",
"license": "许可证",
"license": "授权",
"exiting": "退出中……",
"dark-theme": "深色主题",
@ -123,7 +124,7 @@
"text-font": "字体",
"text-size": "大小",
"enter-text": "在此处输入文本",
"wrap-words-by-spaces": "空格处换行(不建议用于汉语",
"wrap-words-by-spaces": "空格处换行(不建议用于中文",
"minor-tweaks": "细节调整",
"serif": "衬线字体",
"sans-serif": "无衬线字体",

152
www/lang/zh-HK.json Normal file
View File

@ -0,0 +1,152 @@
{
"$language": "中文(香港字)",
"cat-printer": "貓咪打印機",
"printer": "打印機",
"device-": "設備:",
"refresh": "刷新",
"mode-": "模式:",
"canvas": "畫布",
"document": "文檔",
"insert-picture": "插入圖片",
"insert-text": "輸入文本",
"help": "幫助",
"javascript-license-information": "JavaScript 許可證信息",
"settings": "設置",
"image": "圖像",
"threshold-": "閾值:",
"transparent-as-white": "透明為白色",
"misc": "雜項",
"system": "系統",
"disable-animation": "禁用動畫",
"exit": "退出",
"error-message": "錯誤消息",
"preview": "預覽",
"print": "打印",
"expand": "擴大",
"crop": "裁減",
"scanning-for-devices": "正在掃描設備……",
"scan-time-": "掃描時間:",
"-seconds": "秒",
"no-available-devices-found": "未發現可用設備",
"found-0-available-devices": "發現 {0} 個可用設備",
"please-check-if-the-printer-is-down": "請檢查打印機是否已關閉",
"printing": "打印中……",
"finished": "完成",
"coming-soon": "即將到來……",
"dry-run": "乾運行",
"dry-run-test-print-process-only": "乾運行:僅測試打印流程",
"you-can-close-this-page-manually": "您可手動關閉此頁面",
"please-enable-bluetooth": "請啓用藍牙",
"error-happened-please-check-error-message": "發生錯誤,請檢查錯誤消息",
"you-can-seek-for-help-with-detailed-info-below": "您可以使用以下詳細信息尋求幫助",
"or-try-to-scan-longer": "或者嘗試延長掃描時間",
"print-to-cat-printer": "打印到貓咪打印機。",
"supported-models-": "支持的型號:",
"path-to-input-file-dash-for-stdin": "輸入文件的位置。使用 '-' 作為標準輸入",
"please-install-pyobjc-via-pip": "請從 pip 安裝 `pyobjc`",
"please-install-bleak-via-pip": "請從 pip 安裝 `bleak`",
"folder-printer_lib-is-incomplete-or-missing-please-check": "文件夾 `printer_lib` 不完整或丟失,請檢查",
"input-is-not-pbm-image": "輸入不是 PBM 圖像",
"unsuitable-image-width-expected-0-got-1": "不適合的圖像寬度,需要 {0}, 輸入為 {1}",
"broken-pbm-image": "損壞的 PBM 圖像",
"input-is-not-text-file": "輸入不是文本文件",
"match-printer-with-this-name-or-address": "使用符合此名稱或地址的打印機",
"virtual-run-on-specified-model": "在指定的型號模擬運行",
"font-size-0": "字體大小 {0}",
"stopping": "停止中",
"connecting": "正在連接",
"model-0-is-not-supported-yet": "型號 '{0}' 仍未支持",
"invalid-address-0": "無效的地址:'{0}'",
"will-listen-on-all-addresses": "將接受所有地址的連接",
"serving-at-0": "服務器在 {0}",
"disconnecting-from-printer": "正在從打印機斷開連接",
"flip-horizontally": "水平翻轉",
"flip-vertically": "垂直翻轉",
"dump-traffic": "轉儲數據",
"right-to-left-text-order": "從右到左的文字順序",
"auto-wrap-line": "自動折行",
"process-as-": "處理方式:",
"text": "文本",
"picture": "照片",
"pattern": "圖案",
"large-font": "大字體",
"accessibility": "無障礙",
"language": "語言",
"layout": "佈局",
"ok": "確定",
"cancel": "取消",
"yes": "是",
"no": "否",
"about": "關於",
"home-page-": "主頁:",
"contributors": "貢獻者",
"developer": "開發者",
"collaborator": "合作",
"translator": "翻譯",
"all-users-and-developers": "每位用户及開發者",
"everyone-is-awesome": "每個人都是好樣的!",
"license": "授權",
"exiting": "退出中……",
"dark-theme": "深色主題",
"high-contrast": "高對比度",
"welcome": "歡迎!",
"copyright-and-license": "版權與許可",
"some-rights-reserved": "保留一些權利。",
"ENTER": "回車",
"SPACE": "空格",
"ESCAPE": "ESC",
"TAB": "Tab",
"COMMA": "逗號",
"DOT": "句號",
"to-enter-keyboard-mode-press-tab": "要進入鍵盤模式,請按 Tab",
"usage-": "用法:",
"positional-arguments-": "參數:",
"options-": "選項:",
"show-this-help-message": "顯示此幫助信息",
"do-nothing": "什麼也不做",
"scan-for-a-printer": "掃描打印機",
"text-printing-mode-with-options": "啓用文字打印並指定選項",
"image-printing-options": "圖片打印選項",
"convert-input-image-with-imagemagick": "使用 ImageMagick 轉換輸入圖片",
"reset-configuration-": "要重置配置嗎?",
"brightness-": "亮度:",
"text-printing-mode": "文字打印模式",
"internal-error-please-see-terminal": "內部錯誤,請檢查終端",
"control-printer-thermal-strength": "控制打印力度",
"strength-": "力度:",
"or-drag-file-to-below": "或拖拽文件至下方",
"reset": "重置",
"cat-face-toward": "貓臉朝上",
"quality-": "質量:",
"print-quality": "打印質量",
"show-more-options": "顯示更多選項",
"text-font": "字體",
"text-size": "大小",
"enter-text": "在此處輸入文本",
"wrap-words-by-spaces": "空格處換行(不建議用於中文)",
"minor-tweaks": "細節調整",
"serif": "襯線字體",
"sans-serif": "無襯線字體",
"monospace": "等寬字體",
"rotate-image": "旋轉圖像",
"test-unknown-device": "測試未知設備",
"now-will-scan-for-all-bluetooth-devices-nearby": "現在將搜索附近所有設備。",
"scan": "掃描",
"you-can-see-all-javascript-programs-used": "您可以看到此程序使用的 JavaScript 腳本均為自由軟件。",
"javascript-resource": "資源",
"javascript-license": "許可",
"javascript-source": "源",
"javascript-description": "詳述",
"javascript-everyjs-description": "所有開發腳本的動態聯接",
"javascript-maincompjs-description": "經過轉譯的所有以下開發腳本包,起兼容作用",
"javascript-loaderjs-description": "動態加載其餘腳本,並在出現問題時回退",
"javascript-polyfilljs-description": "添加不被舊瀏覽器支持的功能",
"javascript-i18nextjs-description": "國際化 (i18n)“擴展”",
"javascript-i18njs-description": "用於國際化(語言支持)",
"javascript-imagejs-description": "用於畫布 (canvas) 上的圖像處理",
"javascript-accessibilityjs-description": "一些無障礙功能",
"javascript-catprinter-description": "貓咪打印機 (Cat-Printer) 主腳本",
"free-software": "自由軟件",
"free-software-description": "尊重您計算自由的軟件。"
}

View File

@ -0,0 +1,10 @@
{
"$language": "中文國際化樣例",
//
"0-apples": "{0} 個蘋果",
"0th-apple": "第 {0} 個蘋果",
//
"there-is-a-0": {
"measure": "有一{0}"
}
}

152
www/lang/zh-Hant-CN.json Normal file
View File

@ -0,0 +1,152 @@
{
"$language": "中文(傳統字)",
"cat-printer": "貓咪打印機",
"printer": "打印機",
"device-": "設備:",
"refresh": "刷新",
"mode-": "模式:",
"canvas": "畫布",
"document": "文檔",
"insert-picture": "插入圖片",
"insert-text": "輸入文本",
"help": "幫助",
"javascript-license-information": "JavaScript 許可證信息",
"settings": "設置",
"image": "圖像",
"threshold-": "閾值:",
"transparent-as-white": "透明爲白色",
"misc": "雜項",
"system": "系統",
"disable-animation": "禁用動畫",
"exit": "退出",
"error-message": "錯誤消息",
"preview": "預覽",
"print": "打印",
"expand": "擴大",
"crop": "裁減",
"scanning-for-devices": "正在掃描設備……",
"scan-time-": "掃描時間:",
"-seconds": "秒",
"no-available-devices-found": "未發現可用設備",
"found-0-available-devices": "發現 {0} 個可用設備",
"please-check-if-the-printer-is-down": "請檢查打印機是否已關閉",
"printing": "打印中……",
"finished": "完成",
"coming-soon": "即將到來……",
"dry-run": "乾運行",
"dry-run-test-print-process-only": "乾運行:僅測試打印流程",
"you-can-close-this-page-manually": "您可手動關閉此頁面",
"please-enable-bluetooth": "請啓用藍牙",
"error-happened-please-check-error-message": "發生錯誤,請檢查錯誤消息",
"you-can-seek-for-help-with-detailed-info-below": "您可以使用以下詳細信息尋求幫助",
"or-try-to-scan-longer": "或者嘗試延長掃描時間",
"print-to-cat-printer": "打印到貓咪打印機。",
"supported-models-": "支持的型號:",
"path-to-input-file-dash-for-stdin": "輸入文件的位置。使用 '-' 作爲標準輸入",
"please-install-pyobjc-via-pip": "請從 pip 安裝 `pyobjc`",
"please-install-bleak-via-pip": "請從 pip 安裝 `bleak`",
"folder-printer_lib-is-incomplete-or-missing-please-check": "文件夾 `printer_lib` 不完整或丟失,請檢查",
"input-is-not-pbm-image": "輸入不是 PBM 圖像",
"unsuitable-image-width-expected-0-got-1": "不適合的圖像寬度,需要 {0}, 輸入爲 {1}",
"broken-pbm-image": "損壞的 PBM 圖像",
"input-is-not-text-file": "輸入不是文本文件",
"match-printer-with-this-name-or-address": "使用符合此名稱或地址的打印機",
"virtual-run-on-specified-model": "在指定的型號模擬運行",
"font-size-0": "字體大小 {0}",
"stopping": "停止中",
"connecting": "正在連接",
"model-0-is-not-supported-yet": "型號 '{0}' 仍未支持",
"invalid-address-0": "無效的地址:'{0}'",
"will-listen-on-all-addresses": "將接受所有地址的連接",
"serving-at-0": "服務器在 {0}",
"disconnecting-from-printer": "正在從打印機斷開連接",
"flip-horizontally": "水平翻轉",
"flip-vertically": "垂直翻轉",
"dump-traffic": "轉儲數據",
"right-to-left-text-order": "從右到左的文字順序",
"auto-wrap-line": "自動折行",
"process-as-": "處理方式:",
"text": "文本",
"picture": "照片",
"pattern": "圖案",
"large-font": "大字體",
"accessibility": "無障礙",
"language": "語言",
"layout": "佈局",
"ok": "確定",
"cancel": "取消",
"yes": "是",
"no": "否",
"about": "關於",
"home-page-": "主頁:",
"contributors": "貢獻者",
"developer": "開發者",
"collaborator": "合作",
"translator": "翻譯",
"all-users-and-developers": "每位用戶及開發者",
"everyone-is-awesome": "每個人都是好樣的!",
"license": "授權",
"exiting": "退出中……",
"dark-theme": "深色主題",
"high-contrast": "高對比度",
"welcome": "歡迎!",
"copyright-and-license": "版權與許可",
"some-rights-reserved": "保留一些權利。",
"ENTER": "回車",
"SPACE": "空格",
"ESCAPE": "ESC",
"TAB": "Tab",
"COMMA": "逗號",
"DOT": "句號",
"to-enter-keyboard-mode-press-tab": "要進入鍵盤模式,請按 Tab",
"usage-": "用法:",
"positional-arguments-": "參數:",
"options-": "選項:",
"show-this-help-message": "顯示此幫助信息",
"do-nothing": "什麼也不做",
"scan-for-a-printer": "掃描打印機",
"text-printing-mode-with-options": "啓用文字打印並指定選項",
"image-printing-options": "圖片打印選項",
"convert-input-image-with-imagemagick": "使用 ImageMagick 轉換輸入圖片",
"reset-configuration-": "要重置配置嗎?",
"brightness-": "亮度:",
"text-printing-mode": "文字打印模式",
"internal-error-please-see-terminal": "內部錯誤,請檢查終端",
"control-printer-thermal-strength": "控制打印力度",
"strength-": "力度:",
"or-drag-file-to-below": "或拖拽文件至下方",
"reset": "重置",
"cat-face-toward": "貓臉朝上",
"quality-": "質量:",
"print-quality": "打印質量",
"show-more-options": "顯示更多選項",
"text-font": "字體",
"text-size": "大小",
"enter-text": "在此處輸入文本",
"wrap-words-by-spaces": "空格處換行(不建議用於中文)",
"minor-tweaks": "細節調整",
"serif": "襯線字體",
"sans-serif": "無襯線字體",
"monospace": "等寬字體",
"rotate-image": "旋轉圖像",
"test-unknown-device": "測試未知設備",
"now-will-scan-for-all-bluetooth-devices-nearby": "現在將搜索附近所有設備。",
"scan": "掃描",
"you-can-see-all-javascript-programs-used": "您可以看到此程序使用的 JavaScript 腳本均爲自由軟件。",
"javascript-resource": "資源",
"javascript-license": "許可",
"javascript-source": "源",
"javascript-description": "詳述",
"javascript-everyjs-description": "所有開發腳本的動態聯接",
"javascript-maincompjs-description": "經過轉譯的所有以下開發腳本包,起兼容作用",
"javascript-loaderjs-description": "動態加載其餘腳本,並在出現問題時回退",
"javascript-polyfilljs-description": "添加不被舊瀏覽器支持的功能",
"javascript-i18nextjs-description": "國際化 (i18n)“擴展”",
"javascript-i18njs-description": "用於國際化(語言支持)",
"javascript-imagejs-description": "用於畫布 (canvas) 上的圖像處理",
"javascript-accessibilityjs-description": "一些無障礙功能",
"javascript-catprinter-description": "貓咪打印機 (Cat-Printer) 主腳本",
"free-software": "自由軟件",
"free-software-description": "尊重您計算自由的軟件。"
}

View File

@ -1,5 +1,5 @@
{
"$language": "中文(臺灣正體)",
"$language": "中文(正體",
"cat-printer": "貓咪印表機",
"printer": "印表機",
"device-": "裝置:",
@ -33,8 +33,8 @@
"printing": "列印中……",
"finished": "完成",
"coming-soon": "即將到來……",
"dry-run": "執行",
"dry-run-test-print-process-only": "執行:僅測試列印流程",
"dry-run": "執行",
"dry-run-test-print-process-only": "執行:僅測試列印流程",
"you-can-close-this-page-manually": "您可手動關閉此頁面",
"please-enable-bluetooth": "請啟用藍芽",
"error-happened-please-check-error-message": "發生錯誤,請檢查錯誤訊息",
@ -81,10 +81,11 @@
"home-page-": "主頁:",
"contributors": "貢獻者",
"developer": "開發者",
"collaborator": "合作",
"translator": "翻譯",
"all-users-and-developers": "每位使用者及開發者",
"all-users-and-developers": "每位用家及開發者",
"everyone-is-awesome": "每個人都是好樣的!",
"license": "許可證",
"license": "授權",
"exiting": "退出中……",
"dark-theme": "深色主題",
@ -123,7 +124,7 @@
"text-font": "字型",
"text-size": "大小",
"enter-text": "在此處輸入文字",
"wrap-words-by-spaces": "空格處換行(不建議用於漢語",
"wrap-words-by-spaces": "空格處換行(不建議用於中文",
"minor-tweaks": "細節調整",
"serif": "襯線字型",
"sans-serif": "無襯線字型",

View File

@ -451,6 +451,7 @@ iframe#frame {
border: var(--border) solid var(--fore-color);
padding: var(--span);
margin: 0 var(--span);
overflow: auto;
}
#select-language option {
cursor: pointer;

View File

@ -1,6 +1,7 @@
`
Cat-Printer: Web Frontend
Use together with 'index.html'
Copyright © 2021-2022 NaitLee Soft. All rights reserved.

12
zh-conv/0-convert.sh Executable file
View File

@ -0,0 +1,12 @@
#!/bin/sh
convert() {
lang=${1}
langname=${2}
conf=$lang.json
opencc -c $conf -i ../readme.i18n/README.zh-Hant-CN.md -o ../readme.i18n/README.$lang.md
sed "s/中文(傳統字)/$langname/g" ../www/lang/zh-Hant-CN.json | opencc -c $conf >../www/lang/$lang.json
}
convert zh-CN 中文(简体字)
convert zh-HK 中文(香港字)
convert zh-TW 中文(正體字)

0
zh-conv/patch-cn.txt Normal file
View File

View File

@ -0,0 +1,2 @@
「 “
」 ”

1
zh-conv/patch-twp.txt Normal file
View File

@ -0,0 +1 @@
用戶 用家

32
zh-conv/zh-CN.json Normal file
View File

@ -0,0 +1,32 @@
{
"name": "To Simplified Chinese",
"segmentation": {
"type": "mmseg",
"dict": {
"type": "ocd2",
"file": "TSPhrases.ocd2"
}
},
"conversion_chain": [
{
"dict": {
"type": "group",
"dicts": [
{
"type": "ocd2",
"file": "TSPhrases.ocd2"
}, {
"type": "ocd2",
"file": "TSCharacters.ocd2"
}, {
"type": "text",
"file": "patch-cn.txt"
}, {
"type": "text",
"file": "patch-quotation.txt"
}
]
}
}
]
}

26
zh-conv/zh-HK.json Normal file
View File

@ -0,0 +1,26 @@
{
"name": "To Traditional Chinese (Hong Kong variant)",
"segmentation": {
"type": "mmseg",
"dict": {
"type": "ocd2",
"file": "HKVariants.ocd2"
}
},
"conversion_chain": [
{
"dict": {
"type": "group",
"dicts": [
{
"type": "ocd2",
"file": "HKVariants.ocd2"
}, {
"type": "text",
"file": "patch-quotation.txt"
}
]
}
}
]
}

31
zh-conv/zh-TW.json Normal file
View File

@ -0,0 +1,31 @@
{
"name": "To Traditional Chinese (Taiwan standard, with phrases)",
"segmentation": {
"type": "mmseg",
"dict": {
"type": "ocd2",
"file": "STPhrases.ocd2"
}
},
"conversion_chain": [
{
"dict": {
"type": "group",
"dicts": [
{
"type": "text",
"file": "patch-twp.txt"
}, {
"type": "ocd2",
"file": "TWPhrases.ocd2"
}
]
}
}, {
"dict": {
"type": "ocd2",
"file": "TWVariants.ocd2"
}
}
]
}