Skip to content

Commit

Permalink
Update README
Browse files Browse the repository at this point in the history
  • Loading branch information
SkyEye-FAST committed Jul 13, 2024
1 parent e0fd461 commit cefc9af
Show file tree
Hide file tree
Showing 7 changed files with 56 additions and 50 deletions.
36 changes: 19 additions & 17 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,47 +1,49 @@
# Minecraft标准译名查询
# Minecraft标准译名工具合集

[![Pylint](https://github.com/SkyEye-FAST/minecraft_translation_flask/actions/workflows/pylint.yml/badge.svg)](https://github.com/SkyEye-FAST/minecraft_translation_flask/actions/workflows/pylint.yml) [![Update language files](https://github.com/SkyEye-FAST/minecraft_translation_flask/actions/workflows/update.yml/badge.svg)](https://github.com/SkyEye-FAST/minecraft_translation_flask/actions/workflows/update.yml) [![Generate font subset (I.Ming)](https://github.com/SkyEye-FAST/minecraft_translation_flask/actions/workflows/extract_font.yml/badge.svg)](https://github.com/SkyEye-FAST/minecraft_translation_flask/actions/workflows/extract_font.yml)

- **[English](README_en.md) | [中文](README.md)**

----

可查询Minecraft标准译名的简易网页,后端框架使用[Flask](https://github.com/pallets/flask)
可查询Minecraft标准译名的简易网页,后端框架使用[Flask](https://github.com/pallets/flask),前端使用了[jQuery](https://jquery.com/)库。

目前网页的演示可在以下网址查看:

1. [mcst.teahouse.team](https://mcst.teahouse.team/)
2. [skyeyefast.pythonanywhere.com](https://skyeyefast.pythonanywhere.com/)(备用站,更新可能较慢)

## 用途

### 主页面

在主页面的输入框内输入需要查询的源字符串内容(即英文原文),点击“查询”按钮,在出现的列表中选择需要查询的字符串键名,再次点击“查询”按钮即可
在主页面的输入框内输入需要查询的源字符串内容(即英文原文),点击“查询”按钮,在出现的列表中选择需要查询的字符串键名,再次点击“查询”按钮即可查询相应的译名

默认只显示中文变种,可以通过“启用其他语言”来切换是否显示日韩越的译名。

目前主页面的演示可在以下网址查看:

1. [mcst.teahouse.team](https://mcst.teahouse.team/)
2. [skyeyefast.pythonanywhere.com](https://skyeyefast.pythonanywhere.com/)(更新可能较慢)
3. [mczhst.vercel.app](https://mczhst.vercel.app/)(国内网络可能无法访问)

#### 样式

网页样式参考[SkyEye-FAST/minecraft_translation_ppt](https://github.com/SkyEye-FAST/minecraft_translation_ppt),参见[#颜色](#颜色)一节。

![Sample](sample/sample_advancements.png)

### 测验

可以在网站的[`/quiz`子页面](https://mcst.teahouse.team/quiz)找到译名测验小游戏。

题目为从语言文件中随机抽取的10个译名,可以用于测试玩家对标准译名的熟悉程度。

![Sample](sample/sample_quiz_portal.png)
![Sample](sample/sample_quiz_sub.png)

### 翻译表

可以在网站的`/table`子页面找到自动生成的翻译表,包括键名、原文和支持的7种语言。
可以在网站的[`/table`子页面](https://mcst.teahouse.team/table)找到自动生成的翻译表,包括键名、原文和支持的7种语言。

在浏览器中使用自带的页面内搜索功能(快捷键:`Ctrl + F``⌘ Command + F`)可以快速检索译名。

此页面在快速检索时非常有用,但并不适合将结果向他人展示。建议使用主页面的截图向他人展示译名情况。

目前翻译表的演示可在以下网址查看:

1. [mcst.teahouse.team/table](https://mcst.teahouse.team/table)
2. [skyeyefast.pythonanywhere.com/table](https://skyeyefast.pythonanywhere.com/table)(更新可能较慢)
3. [mczhst.vercel.app/table](https://mczhst.vercel.app/table)(国内网络可能无法访问)

![Sample](sample/sample_table.png)

## 运行
Expand All @@ -68,7 +70,7 @@ python -c 'import secrets; print(secrets.token_hex())'

### Minecraft语言文件

本仓库会在每天🕧00:30(UTC+8,即🕟UTC 16:30)自动检查Minecraft Java版语言文件更新。使用脚本为[`update.py`](update.py),需要安装库`requests`
引用自[SkyEye-FAST/mc_lang](https://github.com/SkyEye-FAST/mc_lang)

如果希望在自己搭建的实例中使用其他版本的Java版语言文件,请使用[SkyEye-FAST/minecraft_translation](https://github.com/SkyEye-FAST/minecraft_translation)获取。

Expand Down
70 changes: 37 additions & 33 deletions README_en.md
Original file line number Diff line number Diff line change
@@ -1,90 +1,94 @@
# Query Minecraft Standard Translations
# Minecraft Standard Translation Toolkit

[![Pylint](https://github.com/SkyEye-FAST/minecraft_translation_flask/actions/workflows/pylint.yml/badge.svg)](https://github.com/SkyEye-FAST/minecraft_translation_flask/actions/workflows/pylint.yml) [![Update language files](https://github.com/SkyEye-FAST/minecraft_translation_flask/actions/workflows/update.yml/badge.svg)](https://github.com/SkyEye-FAST/minecraft_translation_flask/actions/workflows/update.yml) [![Generate font subset (I.Ming)](https://github.com/SkyEye-FAST/minecraft_translation_flask/actions/workflows/extract_font.yml/badge.svg)](https://github.com/SkyEye-FAST/minecraft_translation_flask/actions/workflows/extract_font.yml)

- **[English](README_en.md) | [中文](README.md)**

----

A simple web page for querying Minecraft standard translations of , using [Flask](https://github.com/pallets/flask) as the backend framework.
A simple web page for querying Minecraft standard translations, using [Flask](https://github.com/pallets/flask) as the backend framework and [jQuery](https://jquery.com/) for the frontend.

## Usage
You can view a demo of the webpage at the following URLs:

### Main page
1. [mcst.teahouse.team](https://mcst.teahouse.team/)
2. [skyeyefast.pythonanywhere.com](https://skyeyefast.pythonanywhere.com/) (Backup site, updates may be slower)

Enter the source string content that needs to be queried (i.e. the original English text) in the input box on the main page, click the "Query" button, select the string key name that needs to be queried in the list that appears, and click the "Query" button again.
## Purpose

By default, only the Chinese variants are displayed. You can switch whether to display Japanese, Korean, and Vietnamese translations by checking "Enable additional languages".
### Main Page

Demonstrations of the main page are available at the following URLs:
Enter the source string (i.e. the original English text) into the input box on the main page, click the "Query" button, select the desired string key from the resulting list, and click "Query" again to retrieve the corresponding translation.

1. [mcst.teahouse.team](https://mcst.teahouse.team)
2. [skyeyefast.pythonanywhere.com](https://skyeyefast.pythonanywhere.com/) (Updates may be slower)
3. [mczhst.vercel.app](https://mczhst.vercel.app/) (May not be accessible from Chinese mainland)
By default, only Chinese variants are displayed. You can enable other languages (Japanese, Korean, Vietnamese) by toggling the "Enable additional languages" option.

The webpage style is referenced from [SkyEye-FAST/minecraft_translation_ppt](https://github.com/SkyEye-FAST/minecraft_translation_ppt), see section [#Colors](#colors).
#### Styling

The webpage styling is inspired by [SkyEye-FAST/minecraft_translation_ppt](https://github.com/SkyEye-FAST/minecraft_translation_ppt). Refer to the [#Colors](#colors) section.

![Sample](sample/sample_advancements_en.png)

### Translation table page
### Quiz

A translation quiz game can be found on the [`/quiz` subpage](https://mcst.teahouse.team/quiz) of the website.

It features 10 randomly selected translations from language files, allowing players to test their familiarity with standard translations.

The automatically generated translation table can be found in the `/table` subpage of the website, including key name, original text and 7 supported languages.
![Sample](sample/sample_quiz_portal.png)
![Sample](sample/sample_quiz_sub.png)

Use the built-in page search function in browsers (shortcut key: `Ctrl + F` or `⌘ Command + F`) to quickly search for translations.
### Translation Table

This page is useful for quick searches, but is not suitable for showing results to others. It is recommended to use a screenshot of the main page to show others the translation status.
An autogenerated translation table can be found on the [`/table` subpage](https://mcst.teahouse.team/table) of the website, including keys, original texts, and translations in 7 supported languages.

Demonstrations of the translation table page are available at the following URLs:
Use the browser's built-in search function (shortcut key: `Ctrl + F` or `⌘ Command + F`) for quick lookups.

1. [mcst.teahouse.team/table](https://mcst.teahouse.team/table)
2. [skyeyefast.pythonanywhere.com/table](https://skyeyefast.pythonanywhere.com/table) (Updates may be slower)
3. [mczhst.vercel.app/table](https://mczhst.vercel.app/table) (May not be accessible from Chinese mainland)
This page is useful for quick searches, but not suitable for presenting results to others. Consider using screenshots from the main page to showcase translations.

![Sample](sample/sample_table.png)

## Running

See [Flask documentation](https://flask.palletsprojects.com/en/3.0.x/)
See [Flask documentation](https://flask.palletsprojects.com/en/3.0.x/) for details.

## Dependencies
### Dependencies

Install dependencies using the following command:

``` shell
pip install -r requirements.txt
```

## Environment Variables
### Environment Variables

You need to set the `SECRET_KEY` environment variable either in `.env` or in your system. You can generate it using the following command:
Set the `SECRET_KEY` environment variable either in `.env` or system settings. Generate it using:

``` shell
python -c 'import secrets; print(secrets.token_hex())'
```

## Instructions
## Notes

### Minecraft Language Files

This repository automatically checks for updates to Minecraft: Java edition language files every day at 🕧00:30 (UTC+8, i.e., 🕟UTC 16:30). This process uses the script [`update.py`](update.py) and requires `requests`.
Referenced from [SkyEye-FAST/mc_lang](https://github.com/SkyEye-FAST/mc_lang).

If you want to use language files from other versions of Minecraft: Java Edition in your own instance, use [SkyEye-FAST/minecraft_translation](https://github.com/SkyEye-FAST/minecraft_translation) to obtain them.
For other versions of Java Edition language files in your own instance, use [SkyEye-FAST/minecraft_translation](https://github.com/SkyEye-FAST/minecraft_translation).

Obtained `en_us.json`, `zh_cn.json`, `zh_hk.json`, `zh_tw.json`, `lzh.json`, `ja_jp.json`, `ko_kr.json`, and `vi_vn.json` files should be placed in the language files folder (by default, it's the lang folder at the same level as the script, but you can adjust this in the configuration file).
Place `en_us.json`, `zh_cn.json`, `zh_hk.json`, `zh_tw.json`, `lzh.json`, `ja_jp.json`, `ko_kr.json`, and `vi_vn.json` in the language files folder (default: `lang` folder alongside the script, configurable in settings).

[`supplements.json`](lang/supplements.json) contains currently (as of January 28, 2024) missing translations from the in-game language files that have been updated on Crowdin (currently empty). By default, this feature is disabled in the project configuration.
[`supplements.json`](lang/supplements.json) contains updates from Crowdin for missing in-game language files. This feature is disabled by default.

### Fonts

This project uses Source Han Serif and an automatically constructed subset of [I.Ming](https://github.com/ichitenfont/I.Ming).

This repository automatically checks whether the subset files of I.Ming need to be updated based on the content of classical Chinese every Thursday at 🕐01:00 (UTC+8, i.e., UTC Wednesday 🕔17:00).
The repository automatically checks for updates to I.Ming subsets every Thursday 🕐 01:00 (UTC+8, UTC Wednesday 🕔 17:00) based on Classical Chinese content.

This process uses the script [`extract_font.py`](extract_font.py) and requires [`fonttools`](https://github.com/fonttools/fonttools).

### Date and Timezone

The date and timezone displayed on the web page are determined based on the user's IP, using data obtained from the GeoIP2 GeoLite2 database.
Date and timezone on the webpage are based on user's IP, sourced from GeoIP2 GeoLite2 database.

Localization of date and timezone is handled by [`babel`](https://github.com/python-babel/babel) and [`flask-babel`](https://github.com/python-babel/flask-babel).

Expand Down Expand Up @@ -130,8 +134,8 @@ Pull requests are welcome.

## Acknowledgments

The original files for the [favicon](static/favicon.ico) and [apple-touch-icon.png](static/apple-touch-icon.png) are from [Minecraft Wiki](https://minecraft.wiki/w/File:Favicon.ico) and are licensed under the CC BY-NC-SA 3.0 license.
Original files for [Favicon](static/favicon.ico) and [apple-touch-icon.png](static/apple-touch-icon.png) are from [Minecraft Wiki](https://minecraft.wiki/w/File:Favicon.ico), licensed under CC BY-NC-SA 3.0.

The font for Classical Chinese is [I.Ming](https://github.com/ichitenfont/I.Ming), licensed under the [IPA Open Font License v1.0](https://github.com/ichitenfont/I.Ming/blob/master/LICENSE.md).
Classical Chinese font [I.Ming](https://github.com/ichitenfont/I.Ming) is licensed under [IPA Open Font License v1.0](https://github.com/ichitenfont/I.Ming/blob/master/LICENSE.md).

[`GeoLite2-City.mmdb`](GeoLite2-City.mmdb) is from [P3TERX/GeoLite.mmdb](https://github.com/P3TERX/GeoLite.mmdb). Copyright belongs to MaxMind, Inc.
[`GeoLite2-City.mmdb`](GeoLite2-City.mmdb) is from [P3TERX/GeoLite.mmdb](https://github.com/P3TERX/GeoLite.mmdb), copyright MaxMind, Inc.
Binary file modified sample/sample_advancements.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 modified sample/sample_advancements_en.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 sample/sample_quiz_portal.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 sample/sample_quiz_sub.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 modified sample/sample_table.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

0 comments on commit cefc9af

Please sign in to comment.