forked from tisfeng/Easydict
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add documentation for translating Easyict (tisfeng#230)
* docs: add translation guide * docs: update translation guide * Update How-to-translate-Easydict.md * docs: wrap up translation doc * docs: update header
- Loading branch information
1 parent
51d4cbb
commit 63ef8e0
Showing
4 changed files
with
68 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
# Getting Started | ||
We are using String Catalog in Xcode to manage translations for Easydict, so the following steps are what you need to get started on localizing the app. | ||
### Install Xcode 15+ | ||
You can install Xcode from the [Mac App Store](https://apps.apple.com/app/xcode/id497799835) or its beta versions on [Apple Developer](https://developer.apple.com/xcode/resources/). | ||
### Cloning and building the project | ||
1. Use git to clone the project from GitHub to your Mac. You can do this by using the [git command line tool](https://docs.github.com/en/get-started/getting-started-with-git) or [GitHub Desktop](https://desktop.github.com). | ||
2. Make sure you are on the [dev](https://github.com/tisfeng/Easydict/tree/dev) branch, this is where development takes place. | ||
3. Open the project and build it, detailed instructions on how to build the project can be found [here](/README_EN.md#developer-build). | ||
### Add your language to String Catalog | ||
Now you can start adding your own language! | ||
1. Navigate to `Easydict -> Easydict -> App -> Localizable.xcstrings`. Also Expand `Main.storyboard` to find `Main.xcstrings (Strings)` These two `.xcstrings` files are what you are going to work on. | ||
2. Click the `Localizable.xcstrings` file first and click the `+` button to find a list of available options. If you don't see the language you want to localize in the list (e.g. Canadian English). Scroll all the way down to the bottom of the menu to find `More Languages`. | ||
3. After you add a language, you can start translating. Don't forget to translate the strings in `Main.xcstring (Strings)`😉 | ||
### Previewing your translations | ||
After you are done with your translations, it's nice to run the app and preview them to look for rooms for improvements. You can set the app language to the one that you did with a simple few clicks. | ||
1. Find the Easydict icon on the top toolbar of Xcode and click on it | ||
2. Click on `Edit Scheme...` | ||
3. Select the `RUN` tab on the left sidebar and go to `Options` | ||
4. Scroll down and find `App Language`, then choose the one you localized for | ||
5. Close the tab and use ⌘R to run the app and see your translations | ||
### Pushing your changes to GitHub | ||
After you finish checking your localization, it's time to push the changes to GitHub and start a pull request. | ||
- [Start a Pull Request](https://docs.github.com/en/pull-requests). | ||
- Remember to set the merge target to the `dev` branch | ||
Now you can wait for a maintainer's review and get your translations adopted in the next Easydict version. | ||
### Additional Resources | ||
- [Localization - Apple Developer](https://developer.apple.com/documentation/Xcode/localization) | ||
- [Localizing and varying text with a string catalog - Apple Developer](https://developer.apple.com/documentation/xcode/localizing-and-varying-text-with-a-string-catalog) | ||
- [Discover String Catalogs - WWDC23 Videos](https://developer.apple.com/videos/play/wwdc2023/10155) | ||
- [Apple Localization Glossaries](https://applelocalization.com) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
# 开始翻译 | ||
Easydict 的翻译是通过 Xcode 中的 String Catalog 管理的,下面是翻译 Easydict 的详细步骤 | ||
### 安装 Xcode 15+ | ||
可以从 [Mac App Store](https://apps.apple.com/app/xcode/id497799835) 安装Xcode,或者从 [Apple Developer](https://developer.apple.com/xcode/resources/) 获取 Beta 版本。 | ||
### 克隆和构建项目 | ||
1. 使用 git 将项目从 GitHub 克隆到本地,这里可以使用 [git 命令行工具](https://docs.github.com/en/get-started/getting-started-with-git) 或 [GitHub Desktop](https://desktop.github.com) | ||
2. 切换到 [dev](https://github.com/tisfeng/Easydict/tree/dev) 分支 | ||
3. 打开项目并构建,有关如何构建项目的详细说明在[这里](/README.md#developer-build) | ||
### 添加语言到String Catalog | ||
现在可以添加新的语言了! | ||
1. 找到 `Easydict -> Easydict -> App -> Localizable.xcstrings`。同时展开 `Main.storyboard` 然后找到 `Main.xcstrings (Strings)`。这两个 `.xcstrings` 是翻译要用的 | ||
2. 首先打开 `Localizable.xcstrings` 文件,然后点`+`按钮添加语言,如果找不到要做翻译的语言(例如 Canadian English),滚动到菜单底部,打开二级菜单 `More Languages` | ||
3. 添加语言后就可以开始翻译了。不要忘记翻译 `Main.xcstring (Strings)` 中的字符串😉 | ||
### 预览翻译 | ||
在完成翻译后可以跑一下 Easydict 做检查。 | ||
1. 在 Xcode 顶部工具栏上找到 Easydict 图标,然后点击它 | ||
2. 点击 `Edit Scheme...` | ||
3. 在侧边栏中选择 `RUN`,然后转到 `Options` | ||
4. 向下滚动找到 `App Language`,然后选择要检查的语言 | ||
5. 关闭选项卡,然后使用快捷键 ⌘R 运行 Easydict 并检查翻译 | ||
### 将更改 push 到 GitHub | ||
在完成本地化检查后就可以将更改 push 到 GitHub 并发起拉取请求了。 | ||
- [发起拉取请求](https://docs.github.com/zh/pull-requests)。 | ||
- 记得将合并目标设置为`dev`分支 | ||
最后等待 review 完成就可以合并到主仓库啦,下一次发版的时候就能看到最新的翻译啦! | ||
### 其他资源 | ||
- [Localization - Apple Developer](https://developer.apple.com/documentation/Xcode/localization) | ||
- [Localizing and varying text with a string catalog - Apple Developer](https://developer.apple.com/documentation/xcode/localizing-and-varying-text-with-a-string-catalog) | ||
- [Discover String Catalogs - WWDC23 Videos](https://developer.apple.com/videos/play/wwdc2023/10155) | ||
- [Apple 本地化术语表](https://applelocalization.com) |