Skip to content

Commit

Permalink
refactor: 将项目名称改为小写
Browse files Browse the repository at this point in the history
- 修改了多个文件中的 "Saladict" 为 "saladict"(tauri 1,linux二进制文件是小写,tauri 2有变化,二进制和app显示名称分开了)
  • Loading branch information
allentown521 committed Jan 23, 2025
1 parent da3baa6 commit 2f1d1a4
Show file tree
Hide file tree
Showing 8 changed files with 116 additions and 116 deletions.
16 changes: 8 additions & 8 deletions .github/workflows/package.yml
Original file line number Diff line number Diff line change
Expand Up @@ -157,7 +157,7 @@ jobs:
run: |
# Set paths
app_path="src-tauri/target/${{ matrix.target }}/release/bundle/macos/Saladict.app"
dmg_path="src-tauri/target/${{ matrix.target }}/release/bundle/dmg/Saladict_${{needs.change-version.outputs.version}}_${{ contains(matrix.target, 'aarch64') && 'aarch64' || 'x86_64' }}.dmg"
dmg_path="src-tauri/target/${{ matrix.target }}/release/bundle/dmg/saladict_${{needs.change-version.outputs.version}}_${{ contains(matrix.target, 'aarch64') && 'aarch64' || 'x86_64' }}.dmg"
ocr_arm64_path="${app_path}/Contents/Resources/resources/ocr-aarch64-apple-darwin"
ocr_x86_path="${app_path}/Contents/Resources/resources/ocr-x86_64-apple-darwin"
Expand Down Expand Up @@ -221,8 +221,8 @@ jobs:
run: |
cd src-tauri/target/aarch64-apple-darwin/release/bundle/macos
rm -f Saladict.app.tar.gz Saladict.app.tar.gz.sig
tar -czf Saladict_${{needs.change-version.outputs.version}}_aarch64.app.tar.gz Saladict.app
pnpm tauri signer sign -k "$TAURI_PRIVATE_KEY" -p "$TAURI_KEY_PASSWORD" "$PWD/Saladict_${{needs.change-version.outputs.version}}_aarch64.app.tar.gz"
tar -czf saladict_${{needs.change-version.outputs.version}}_aarch64.app.tar.gz Saladict.app
pnpm tauri signer sign -k "$TAURI_PRIVATE_KEY" -p "$TAURI_KEY_PASSWORD" "$PWD/saladict_${{needs.change-version.outputs.version}}_aarch64.app.tar.gz"
- name: Change File Name
if: matrix.target == 'x86_64-apple-darwin'
Expand All @@ -232,8 +232,8 @@ jobs:
run: |
cd src-tauri/target/x86_64-apple-darwin/release/bundle/macos
rm -f Saladict.app.tar.gz Saladict.app.tar.gz.sig
tar -czf Saladict_${{needs.change-version.outputs.version}}_x64.app.tar.gz Saladict.app
pnpm tauri signer sign -k "$TAURI_PRIVATE_KEY" -p "$TAURI_KEY_PASSWORD" "$PWD/Saladict_${{needs.change-version.outputs.version}}_x64.app.tar.gz"
tar -czf saladict_${{needs.change-version.outputs.version}}_x64.app.tar.gz Saladict.app
pnpm tauri signer sign -k "$TAURI_PRIVATE_KEY" -p "$TAURI_KEY_PASSWORD" "$PWD/saladict_${{needs.change-version.outputs.version}}_x64.app.tar.gz"
- name: Upload Artifacts
uses: actions/upload-artifact@v4
Expand Down Expand Up @@ -378,9 +378,9 @@ jobs:
$env:TAURI_PRIVATE_KEY="${{ secrets.TAURI_PRIVATE_KEY }}"
$env:TAURI_KEY_PASSWORD="${{ secrets.TAURI_KEY_PASSWORD }}"
pnpm tauri build -b nsis,updater --target ${{ matrix.target }}
Rename-Item .\src-tauri\target\${{ matrix.target }}\release\bundle\nsis\Saladict_${{needs.change-version.outputs.version}}_${{ matrix.arch }}-setup.exe Saladict_${{needs.change-version.outputs.version}}_${{ matrix.arch }}_fix_webview2_runtime-setup.exe
Rename-Item .\src-tauri\target\${{ matrix.target }}\release\bundle\nsis\Saladict_${{needs.change-version.outputs.version}}_${{ matrix.arch }}-setup.nsis.zip Saladict_${{needs.change-version.outputs.version}}_${{ matrix.arch }}_fix_webview2_runtime-setup.nsis.zip
Rename-Item .\src-tauri\target\${{ matrix.target }}\release\bundle\nsis\Saladict_${{needs.change-version.outputs.version}}_${{ matrix.arch }}-setup.nsis.zip.sig Saladict_${{needs.change-version.outputs.version}}_${{ matrix.arch }}_fix_webview2_runtime-setup.nsis.zip.sig
Rename-Item .\src-tauri\target\${{ matrix.target }}\release\bundle\nsis\saladict_${{needs.change-version.outputs.version}}_${{ matrix.arch }}-setup.exe saladict_${{needs.change-version.outputs.version}}_${{ matrix.arch }}_fix_webview2_runtime-setup.exe
Rename-Item .\src-tauri\target\${{ matrix.target }}\release\bundle\nsis\saladict_${{needs.change-version.outputs.version}}_${{ matrix.arch }}-setup.nsis.zip saladict_${{needs.change-version.outputs.version}}_${{ matrix.arch }}_fix_webview2_runtime-setup.nsis.zip
Rename-Item .\src-tauri\target\${{ matrix.target }}\release\bundle\nsis\saladict_${{needs.change-version.outputs.version}}_${{ matrix.arch }}-setup.nsis.zip.sig saladict_${{needs.change-version.outputs.version}}_${{ matrix.arch }}_fix_webview2_runtime-setup.nsis.zip.sig
- name: Upload Artifacts
uses: actions/upload-artifact@v4
with:
Expand Down
16 changes: 8 additions & 8 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -184,9 +184,9 @@ winget install allentown521.Saladict

1.[Release](https://github.com/allentown521/saladict/releases/latest) 页面下载最新 `exe` 安装包。

- 64 位机器下载 `Saladict_{version}_x64-setup.exe`
- 32 位机器下载 `Saladict_{version}_x86-setup.exe`
- arm64 机器下载 `Saladict_{version}_arm64-setup.exe`
- 64 位机器下载 `saladict_{version}_x64-setup.exe`
- 32 位机器下载 `saladict_{version}_x86-setup.exe`
- arm64 机器下载 `saladict_{version}_arm64-setup.exe`

2. 双击安装包进行安装。

Expand All @@ -196,7 +196,7 @@ winget install allentown521.Saladict

检查是否卸载/禁用了 WebView2,如果卸载/禁用了 WebView2,请手动安装 WebView2 或将其恢复。

如果是企业版系统不方便安装或无法安装 WebView2,请尝试在 [Release](https://github.com/allentown521/saladict/releases/latest) 下载内置 WebView2 的版本 `Saladict_{version}_{arch}_fix_webview2_runtime-setup.exe`
如果是企业版系统不方便安装或无法安装 WebView2,请尝试在 [Release](https://github.com/allentown521/saladict/releases/latest) 下载内置 WebView2 的版本 `saladict_{version}_{arch}_fix_webview2_runtime-setup.exe`

若问题仍然存在请尝试使用 Windows7 兼容模式启动。

Expand All @@ -215,7 +215,7 @@ M-series Macs 用户可以从 Mac App Store 安装。

### 手动安装

1.[Release](https://github.com/allentown521/saladict/releases/latest) 页面下载最新的 `dmg` 安装包。(如果您使用的是 M1 芯片,请下载名为`Saladict_{version}_aarch64.dmg`的安装包,否则请下载名为`Saladict_{version}_x64.dmg`的安装包)
1.[Release](https://github.com/allentown521/saladict/releases/latest) 页面下载最新的 `dmg` 安装包。(如果您使用的是 M1 芯片,请下载名为`saladict_{version}_aarch64.dmg`的安装包,否则请下载名为`saladict_{version}_x64.dmg`的安装包)
2. 双击下载的文件后将 沙拉翻译 拖入 Applications 文件夹即可完成安装。

### 通过 Brew 安装
Expand Down Expand Up @@ -289,7 +289,7 @@ GET "/ocr_translate?screenshot=true" => 截图翻译,
### 调用流程

1. 使用其他截图工具截图
2. 将截图保存在 `$CACHE/allen.town.focus.saladict/pot_screenshot_cut.png`
2. 将截图保存在 `$CACHE/allen.town.focus.saladict/Saladict_screenshot_cut.png`
3. 向`127.0.0.1:port/ocr_recognize?screenshot=false`发送请求即可调用成功

> `$CACHE`为系统缓存目录,例如在 Windows 上为`C:\Users\{用户名}\AppData\Local\allen.town.focus.saladict\pot_screenshot_cut.png`
Expand Down Expand Up @@ -357,8 +357,8 @@ bind = ALT, C, exec, grim -g "$(slurp)" ~/.cache/allen.town.focus.saladict/pot_s
由于目前 沙拉翻译 在 Wayland 下还无法获取到正确的鼠标坐标,所以内部的实现无法工作。 对于某些桌面环境/窗口管理器,可以通过设置窗口规则来实现窗口跟随鼠标位置,这里以 Hyprland 为例:

```conf
windowrulev2 = float, class:(pot), title:(Translator|OCR|PopClip|Screenshot Translate) # Translation window floating
windowrulev2 = move cursor 0 0, class:(pot), title:(Translator|PopClip|Screenshot Translate) # Translation window follows the mouse position.
windowrulev2 = float, class:(saladict), title:(Translator|OCR|PopClip|Screenshot Translate) # Translation window floating
windowrulev2 = move cursor 0 0, class:(saladict), title:(Translator|PopClip|Screenshot Translate) # Translation window follows the mouse position.
```

<div align="center">
Expand Down
48 changes: 24 additions & 24 deletions README_EN.md
Original file line number Diff line number Diff line change
Expand Up @@ -151,7 +151,7 @@ The built-in services are limited. But you can expand the app's functionality th

You can find plugins you need in the [Plugin List](https://saladict-app.aichatone.com/plugin.html), and then go to the plugin repo to download it.

The file extension of pot plugin is `.potext`. After downloading the `.potext` file, go to Preferences - Service Settings - Add External Plugin - Install External Plugin to select the corresponding `.potext` to install it. It will then be added to the service list and can be used like a built-in service.
The file extension of Saladict plugin is `.potext`. After downloading the `.potext` file, go to Preferences - Service Settings - Add External Plugin - Install External Plugin to select the corresponding `.potext` to install it. It will then be added to the service list and can be used like a built-in service.

### Troubleshooting

Expand Down Expand Up @@ -185,9 +185,9 @@ winget install allentown521.Saladict

1. Download the installation package ending in `.exe` from the Latest [Release](https://github.com/allentown521/saladict/releases/latest) page.

- 64-bit machine download `Saladict_{version}_x64-setup.exe`
- 32-bit machine download `Saladict_{version}_x86-setup.exe`
- arm64 machine download `Saladict_{version}_arm64-setup.exe`
- 64-bit machine download `saladict_{version}_x64-setup.exe`
- 32-bit machine download `saladict_{version}_x86-setup.exe`
- arm64 machine download `saladict_{version}_arm64-setup.exe`

2. Double click the downloaded file to install it.

Expand All @@ -197,7 +197,7 @@ winget install allentown521.Saladict

Check if WebView2 is uninstalled/disabled, if so, install WebView2 manually or restore it.

If the enterprise edition system is inconvenient to install or cannot install WebView2, please try to download the fix WebView2 version `Saladict_{version} at [Release](https://github.com/allentown521/saladict/releases/latest) _{arch}_fix_webview2_runtime-setup.exe`
If the enterprise edition system is inconvenient to install or cannot install WebView2, please try to download the fix WebView2 version `saladict_{version} at [Release](https://github.com/allentown521/saladict/releases/latest) _{arch}_fix_webview2_runtime-setup.exe`

If the issue persists, please try starting in Windows 7 compatibility mode.

Expand All @@ -220,26 +220,26 @@ For M-series Macs, you can install it from Mac App Store
brew tap allentown521/homebrew-saladict
```

2. Install pot:
2. Install Saladict:

```bash
brew install --cask saladict
```

3. Upgrade pot
3. Upgrade Saladict

```bash
brew upgrade --cask saladict
```

### Install Manually

1. Download the installation package ending in `.dmg` from the Latest [Release](https://github.com/allentown521/saladict/releases/latest) page. (If you are using M1, please download the installation package named `Saladict_{version}_aarch64.dmg`, otherwise download the installation package named `Saladict_{version}_x64.dmg`)
1. Download the installation package ending in `.dmg` from the Latest [Release](https://github.com/allentown521/saladict/releases/latest) page. (If you are using M1, please download the installation package named `saladict_{version}_aarch64.dmg`, otherwise download the installation package named `saladict_{version}_x64.dmg`)
2. Double click the downloaded file to install it.

### Troubleshooting

- If you encounter a permission prompt every time you open it, or if you cannot perform a shortcut translation, please go to Settings -> Privacy & Security -> Supporting Features to remove pot, and then re-add pot.
- If you encounter a permission prompt every time you open it, or if you cannot perform a shortcut translation, please go to Settings -> Privacy & Security -> Supporting Features to remove Saladict, and then re-add Saladict.

## Linux

Expand All @@ -256,7 +256,7 @@ Please note that: There are two deb package, `universal` is based on `glibc2.28`

</div>

Saladict provides a complete HTTP interface for integration with other software. You can call pot by sending HTTP requests to `127.0.0.1:port`, where `port` is the listening port of pot, default to `60606`, and can be changed in the app settings.
Saladict provides a complete HTTP interface for integration with other software. You can call Saladict by sending HTTP requests to `127.0.0.1:port`, where `port` is the listening port of Saladict, default to `60606`, and can be changed in the app settings.

## API Docs:

Expand All @@ -278,7 +278,7 @@ GET "/ocr_translate?screenshot=true" => Translate screenshot

- Call translation by selection:

To call pot's translation by selection, simply send a request to `127.0.0.1:port`:
To call Saladict's translation by selection, simply send a request to `127.0.0.1:port`:

E.g. using curl:

Expand All @@ -288,7 +288,7 @@ GET "/ocr_translate?screenshot=true" => Translate screenshot

## OCR without internal screenshot

This allows you to perform OCR/translation without using pot's internal screenshot, so you can use your own screenshot tools. It also solves the problem where pot's internal screenshot doesn't work on some platforms.
This allows you to perform OCR/translation without using Saladict's internal screenshot, so you can use your own screenshot tools. It also solves the problem where Saladict's internal screenshot doesn't work on some platforms.
### Workflow:
Expand All @@ -311,16 +311,16 @@ rm ~/.cache/allen.town.focus.saladict/pot_screenshot_cut.png && flameshot gui -s
### SnipDo (Windows)
1. Download and install SnipDo in the [Microsoft Store](https://apps.microsoft.com/store/detail/snipdo/9NPZ2TVKJVT7)
2. Download the SnipDo extension of pot from the Latest [Release](https://github.com/allentown521/saladict/releases/latest) (Saladict.pbar)
2. Download the SnipDo extension of Saladict from the Latest [Release](https://github.com/allentown521/saladict/releases/latest) (Saladict.pbar)
3. Double click the downloaded file to install it.
4. Selection some text, you can see the pot icon in the upper right corner of the selection, click the icon to translate.
4. Selection some text, you can see the Saladict icon in the upper right corner of the selection, click the icon to translate.
### PopClip (MacOS)
1. Download and install PopClip in the [Official Website](https://www.popclip.app/)
2. Download the PopClip extension of pot from the Latest [Release](https://github.com/allentown521/saladict/releases/latest) (Saladict.popclipextz)
2. Download the PopClip extension of Saladict from the Latest [Release](https://github.com/allentown521/saladict/releases/latest) (Saladict.popclipextz)
3. Double click the downloaded file to install it.
4. Enable the pot extension in PopClip settings, and then you can translate by selecting text.
4. Enable the Saladict extension in PopClip settings, and then you can translate by selecting text.
### Starry (Linux)
Expand All @@ -334,16 +334,16 @@ Github: [ccslykx/Starry](https://github.com/ccslykx/Starry)
</div>
Due to the varying levels of support for Wayland among different distributions, pot itself cannot achieve perfect compatibility. However, here are some solutions to common issues that can be implemented through proper configuration, allowing pot to run flawlessly on Wayland.
Due to the varying levels of support for Wayland among different distributions, Saladict itself cannot achieve perfect compatibility. However, here are some solutions to common issues that can be implemented through proper configuration, allowing Saladict to run flawlessly on Wayland.
## Shortcut key cannot be used
Due to Tauri's lack of support for Wayland, the shortcut key scheme in the pot application cannot be used under Wayland.
You can set the system shortcut and send a request with `curl` to call pot, see [External Calls](#external-calls) for details
Due to Tauri's lack of support for Wayland, the shortcut key scheme in the Saladict application cannot be used under Wayland.
You can set the system shortcut and send a request with `curl` to call Saladict, see [External Calls](#external-calls) for details

## Screenshot doesn't work

In some pure Wayland desktop environments/window managers (such as Hyprland), the built-in screenshot feature of pot cannot be used. In this case, you can use other screenshot tools instead. For more details, please refer to the section [Not Using Built-in Screenshot](#not-using-built-in-screenshot).
In some pure Wayland desktop environments/window managers (such as Hyprland), the built-in screenshot feature of Saladict cannot be used. In this case, you can use other screenshot tools instead. For more details, please refer to the section [Not Using Built-in Screenshot](#not-using-built-in-screenshot).

Below is a configuration example for Hyprland using `grim` and `slurp` to achieve screenshot functionality:

Expand All @@ -356,12 +356,12 @@ Other desktop environments/window managers also have similar operations.

## The translation window follows the mouse position.

Due to the current inability of pot to obtain accurate mouse coordinates under Wayland, its internal implementation cannot function properly.
Due to the current inability of Saladict to obtain accurate mouse coordinates under Wayland, its internal implementation cannot function properly.
For certain desktop environments/window managers, it is possible to achieve window following mouse position by setting window rules. Here we take Hyprland as an example:

```conf
windowrulev2 = float, class:(pot), title:(Translator|OCR|PopClip|Screenshot Translate) # Translation window floating
windowrulev2 = move cursor 0 0, class:(pot), title:(Translator|PopClip|Screenshot Translate) # Translation window follows the mouse position.
windowrulev2 = float, class:(saladict), title:(Translator|OCR|PopClip|Screenshot Translate) # Translation window floating
windowrulev2 = move cursor 0 0, class:(saladict), title:(Translator|PopClip|Screenshot Translate) # Translation window follows the mouse position.
```

<div align="center">
Expand Down Expand Up @@ -403,7 +403,7 @@ Rust >= 1.80.0
2. Install dependencies

```bash
cd pot-desktop
cd saladict
pnpm install
```

Expand Down
Loading

0 comments on commit 2f1d1a4

Please sign in to comment.