Update doc

This commit is contained in:
BruceChen 2022-11-07 11:15:19 +08:00
parent 2e7c024f45
commit 5a540f646c
10 changed files with 249 additions and 94 deletions

151
.github/workflows/build-MCC-only.yml vendored Normal file
View file

@ -0,0 +1,151 @@
name: Build MCC
on:
workflow_dispatch:
env:
PROJECT: "MinecraftClient"
target-version: "net6.0"
compile-flags: "--self-contained=true -c Release -p:UseAppHost=true -p:IncludeNativeLibrariesForSelfExtract=true -p:DebugType=None"
jobs:
Build:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v3
with:
fetch-depth: 0
submodules: 'true'
- name: Sync translations from crowdin
uses: crowdin/github-action@1.5.0
with:
upload_translations: true
download_translations: true
localization_branch_name: l10n_master
create_pull_request: false
base_path: ${{ github.workspace }}
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
CROWDIN_PROJECT_ID: ${{ secrets.CROWDIN_PROJECT_ID }}
CROWDIN_PERSONAL_TOKEN: ${{ secrets.CROWDIN_TOKEN }}
- name: Setup Project Path
run: |
echo project-path=${{ github.workspace }}/${{ env.PROJECT }} >> $GITHUB_ENV
- name: Setup Output Paths
run: |
echo win-x64-out-path=${{ env.project-path }}/bin/Release/${{ env.target-version }}/win-x64/publish/ >> $GITHUB_ENV
echo win-x86-out-path=${{ env.project-path }}/bin/Release/${{ env.target-version }}/win-x86/publish/ >> $GITHUB_ENV
echo linux-out-path=${{ env.project-path }}/bin/Release/${{ env.target-version }}/linux-x64/publish/ >> $GITHUB_ENV
echo osx-out-path=${{ env.project-path }}/bin/Release/${{ env.target-version }}/osx-x64/publish/ >> $GITHUB_ENV
echo linux-arm64-out-path=${{ env.project-path }}/bin/Release/${{ env.target-version }}/linux-arm64/publish/ >> $GITHUB_ENV
- name: Setup .NET SDK
uses: actions/setup-dotnet@v2.1.0
- name: Get Version DateTime
id: date-version
uses: nanzm/get-time-action@v1.1
with:
timeZone: 0
format: 'YYYY-MM-DD'
- name: VersionInfo
run: |
COMMIT=$(echo ${{ github.sha }} | cut -c 1-7)
echo '' >> ${{ env.project-path }}/Properties/AssemblyInfo.cs
echo "[assembly: AssemblyConfiguration(\"GitHub build ${{ github.run_number }}, built on ${{ steps.date-version.outputs.time }} from commit $COMMIT\")]" >> ${{ env.project-path }}/Properties/AssemblyInfo.cs
- name: Build for Windows x64
run: dotnet publish ${{ env.project-path }}.sln -f ${{ env.target-version }} -r win-x64 ${{ env.compile-flags }}
- name: Zip Windows x64 Build
run: zip -qq -r windows-x64.zip *
working-directory: ${{ env.win-x64-out-path }}
- name: Build for Windows x86
run: dotnet publish ${{ env.project-path }}.sln -f ${{ env.target-version }} -r win-x86 ${{ env.compile-flags }}
- name: Zip Windows x86 Build
run: zip -qq -r windows-x86.zip *
working-directory: ${{ env.win-x86-out-path }}
- name: Build for Linux
run: dotnet publish ${{ env.project-path }}.sln -f ${{ env.target-version }} -r linux-x64 ${{ env.compile-flags }}
- name: Zip Linux Build
run: zip -qq -r linux.zip *
working-directory: ${{ env.linux-out-path }}
- name: Build for ARM64 Linux
run: dotnet publish ${{ env.project-path }}.sln -f ${{ env.target-version }} -r linux-arm64 ${{ env.compile-flags }}
- name: Zip ARM64 Linux Build
run: zip -qq -r linux-arm64.zip *
working-directory: ${{ env.linux-arm64-out-path }}
- name: Build for OSX
run: dotnet publish ${{ env.project-path }}.sln -f ${{ env.target-version }} -r osx-x64 ${{ env.compile-flags }}
- name: Zip OSX Build
run: zip -qq -r osx.zip *
working-directory: ${{ env.osx-out-path }}
- name: Get Release DateTime
id: date-release
uses: nanzm/get-time-action@v1.1
with:
timeZone: 0
format: 'YYYYMMDD'
- name: Windows x64 Release
uses: tix-factory/release-manager@v1
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
mode: uploadReleaseAsset
filePath: ${{ env.win-x64-out-path }}windows-x64.zip
assetName: ${{ env.PROJECT }}-windows-x64.zip
tag: ${{ format('{0}-{1}', steps.date-release.outputs.time, github.run_number) }}
- name: Windows x86 Release
uses: tix-factory/release-manager@v1
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
mode: uploadReleaseAsset
filePath: ${{ env.win-x86-out-path }}windows-x86.zip
assetName: ${{ env.PROJECT }}-windows-x86.zip
tag: ${{ format('{0}-{1}', steps.date-release.outputs.time, github.run_number) }}
- name: Linux Release
uses: tix-factory/release-manager@v1
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
mode: uploadReleaseAsset
filePath: ${{ env.linux-out-path }}linux.zip
assetName: ${{ env.PROJECT }}-linux.zip
tag: ${{ format('{0}-{1}', steps.date-release.outputs.time, github.run_number) }}
- name: Linux ARM64 Release
uses: tix-factory/release-manager@v1
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
mode: uploadReleaseAsset
filePath: ${{ env.linux-arm64-out-path }}linux-arm64.zip
assetName: ${{ env.PROJECT }}-linux-arm64.zip
tag: ${{ format('{0}-{1}', steps.date-release.outputs.time, github.run_number) }}
- name: OSX Release
uses: tix-factory/release-manager@v1
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
mode: uploadReleaseAsset
filePath: ${{ env.osx-out-path }}osx.zip
assetName: ${{ env.PROJECT }}-osx.zip
tag: ${{ format('{0}-{1}', steps.date-release.outputs.time, github.run_number) }}

View file

@ -1,4 +1,4 @@
name: Build name: Build MCC and Documents
on: on:
push: push:

42
.github/workflows/deploy-doc-only.yml vendored Normal file
View file

@ -0,0 +1,42 @@
name: Build Documents
on:
workflow_dispatch:
jobs:
Build:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v3
with:
fetch-depth: 0
submodules: 'true'
- name: Sync translations from crowdin
uses: crowdin/github-action@1.5.0
with:
upload_translations: true
download_translations: true
localization_branch_name: l10n_master
create_pull_request: false
base_path: ${{ github.workspace }}
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
CROWDIN_PROJECT_ID: ${{ secrets.CROWDIN_PROJECT_ID }}
CROWDIN_PERSONAL_TOKEN: ${{ secrets.CROWDIN_TOKEN }}
- name: Deploy Documentation Site
uses: jenkey2011/vuepress-deploy@master
env:
ACCESS_TOKEN: ${{ secrets.GH_PAGES_TOKEN }}
TARGET_REPO: MCCTeam/MCCTeam.github.io
TARGET_BRANCH: master
BUILD_SCRIPT: yarn --cwd ./docs/ && yarn --cwd ./docs/ docs:build
BUILD_DIR: docs/.vuepress/dist
COMMIT_MESSAGE: Build from ${{ github.sha }}
CNAME: https://mccteam.github.io

View file

@ -0,0 +1,31 @@
name: Sync Translations
on:
workflow_dispatch:
jobs:
Sync:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v3
with:
fetch-depth: 0
submodules: 'true'
- name: Sync translations from crowdin
uses: crowdin/github-action@1.5.0
with:
upload_translations: true
download_translations: true
localization_branch_name: l10n_master
create_pull_request: false
base_path: ${{ github.workspace }}
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
CROWDIN_PROJECT_ID: ${{ secrets.CROWDIN_PROJECT_ID }}
CROWDIN_PERSONAL_TOKEN: ${{ secrets.CROWDIN_TOKEN }}

9
.gitignore vendored
View file

@ -405,3 +405,12 @@ FodyWeavers.xsd
# docs # docs
!/docs/.vuepress !/docs/.vuepress
/docs/.vuepress/dist /docs/.vuepress/dist
# translations
/MinecraftClient/Resources/Translations/Translations.*.resx
/MinecraftClient/Resources/AsciiArt/AsciiArt.*.resx
/docs/.vuepress/translations/*.json
!/docs/.vuepress/translations/en.json
/docs/l10n/

View file

@ -153,7 +153,7 @@ namespace MinecraftClient
string configString = File.ReadAllText(filepath); string configString = File.ReadAllText(filepath);
if (configString.Contains("Some settings missing here after an upgrade?")) if (configString.Contains("Some settings missing here after an upgrade?"))
{ {
string newFilePath = Path.ChangeExtension(filepath, ".backup.ini"); string newFilePath = Path.ChangeExtension(filepath, ".old.ini");
File.Copy(filepath, newFilePath, true); File.Copy(filepath, newFilePath, true);
ConsoleIO.WriteLineFormatted("§c" + Translations.mcc_use_new_config); ConsoleIO.WriteLineFormatted("§c" + Translations.mcc_use_new_config);
ConsoleIO.WriteLineFormatted("§c" + string.Format(Translations.mcc_backup_old_config, newFilePath)); ConsoleIO.WriteLineFormatted("§c" + string.Format(Translations.mcc_backup_old_config, newFilePath));

View file

@ -59,16 +59,6 @@ If you'd like to contribute to Minecraft Console Client, great, just fork the re
To improve translations for MCC, please visit: [Crowdin - Minecraft Console Client](https://crwd.in/minecraft-console-client). To improve translations for MCC, please visit: [Crowdin - Minecraft Console Client](https://crwd.in/minecraft-console-client).
MCC now supports the following languages (Alphabetical order) :
* `de.ini` : Deutsch - German
* `en.ini` : English - English
* `fr.ini` : Français (France) - French
* `ru.ini` : Русский (Russkiy) - Russian
* `tr.ini` : Türkçe (Türkiye) - Turkish
* `vi.ini` : Tiếng Việt (Việt Nam) - Vietnamese
* `zh-Hans.ini` : 简体中文 - Chinese Simplified
* `zh-Hant.ini` : 繁體中文 - Chinese Traditional
## Building from the source 🏗️ ## Building from the source 🏗️
This section has been moved to our new [Documentation website](https://mccteam.github.io/guide/installation.html#building-from-the-source-code). This section has been moved to our new [Documentation website](https://mccteam.github.io/guide/installation.html#building-from-the-source-code).

View file

@ -6,28 +6,29 @@ A documentation website for Minecraft Console Client (MCC) written using [Vue Pr
### Requirements: ### Requirements:
- Git
- Node JS >= v12 - Node JS >= v12
- Yarn - Yarn
### Install Yarn if you don't have it: ### Install Yarn if you don't have it:
``` ```bash
npm i yarn -g npm i yarn -g
``` ```
Fork and clone the repository. Fork and clone the repository `Minecraft-Console-Client`.
All of the source is in the `source` directory. All of the source is in the `docs` directory.
### Install dependencies: ### Install dependencies:
``` ```bash
yarn install yarn install
``` ```
### Run developer mode: ### Run developer mode:
``` ```bash
yarn docs:dev yarn docs:dev
``` ```
@ -35,18 +36,4 @@ _If you have the port `8080` taken, use the `--port <port>` for a custom port._
Change things Change things
### Build:
```
yarn docs:build
```
### Deploy changes:
```
yarn docs:deploy
```
**⚠️ Do not forget this step, or your changes will not go live!**
Commit, push and open a pull request. Commit, push and open a pull request.

View file

@ -10,70 +10,15 @@ For now you can use our article from the [Git Hub repository Wiki](https://githu
## Translations ## Translations
MCC now supports the following languages (Alphabetical order) : To improve translations for MCC, please visit: [Crowdin - Minecraft Console Client](https://crwd.in/minecraft-console-client).
* `de.ini` : Deutsch - German
* **`en.ini` : English - English**
* `fr.ini` : Français (France) - French
* `ru.ini` : Русский (Russkiy) - Russian
* `vi.ini` : Tiếng Việt (Việt Nam) - Vietnamese
* `zh-Hans.ini` : 简体中文 - Chinese Simplified
* `zh-Hant.ini` : 繁體中文 - Chinese Traditional
### Add new translation **It is recommended to translate `MCC in-app text` first.**
1. First you need to get the name of the translated file. If you can't find the language you want to translate into, please contact us at Github or Discord to add it.
* Visit [this link](https://learn.microsoft.com/en-us/openspecs/windows_protocols/ms-lcid/a9eac961-e77d-41a6-90a5-ce1a8b0cdb9c) and find the first occurrence of the language you need to translate in the table below.
* Use the language code of the row in the table as the name of the translation file.
* For example:
* `English` -> row `English 0x0009` -> `en` -> `en.ini`
* `Chinese (Traditional)` -> row `Chinese (Traditional) 0x7C04` -> `zh-Hant` -> `zh-Hant.ini`
2. Which system languages are recommended to use this translation? Github: <a href="https://github.com/MCCTeam/Minecraft-Console-Client" rel="nofollow noopener" target="_blank">https://github.com/MCCTeam/Minecraft-Console-Client</a>
* Still check the table in [this link](https://learn.microsoft.com/en-us/openspecs/windows_protocols/ms-lcid/a9eac961-e77d-41a6-90a5-ce1a8b0cdb9c), one language may have multiple rows.
* You will need to indicate which language codes this translation applies to.
* For example:
* Translation `de.ini` applies to `de`, `de-AT`, `de-BE`, `de-DE`, ...
* Translation `zh-Hans.ini` applies to `zh-Hans`, `zh`, `zh-CN`, `zh-SG`.
3. Which game languages are recommended to use this translation? Discord: <a href="https://discord.gg/9HPr2EE4C4" rel="nofollow noopener" target="_blank">https://discord.gg/9HPr2EE4C4</a>
* Check out the table in [this link](https://mccteam.github.io/r/l-code/), where the `Locale Code` column indicates the language code in minecraft.
* You will need to indicate which locale codes this translation applies to.
* For example:
* Translation `fr.ini` applies to `fr_ca`, `fr_fr`.
* Translation `zh-Hans.ini` applies to `zh_cn`.
4. Add the new translation to the code. (Optional)
* **If you are not familiar with programming, you can skip this step and just write the above information in your PR or issue.**
* Add the newly created translation file `xx.ini` to the project `/Resources/lang/xx.ini`.
* Open `/DefaultConfigResource.resx`.
* Click `Add Resources`.
* Choose `/Resources/lang/xx.ini`.
* Rename the added resource file in `/DefaultConfigResource.resx` to `Translation_xx`.
* Open `/Translations.cs`.
* Find `public static Tuple<string, string[]> GetTranslationPriority();`
* Update the mapping of system language codes to translation files.
* Find `public static string[] GetTranslationPriority(string gameLanguage);`
* Update the mapping of game locale code to translation files.
5. Follow the section "Update existing translation".
### Update existing translation
1. Visit [the lang folder](https://github.com/MCCTeam/Minecraft-Console-Client/tree/master/MinecraftClient/Resources/lang), download `en.ini` and the language you want to translate(`xx.ini`).
2. Compare `en.ini` and `xx.ini` and update outdated or non-existent entries in `xx.ini`.
3. Once you finished the translation work, submit a pull request or send us the file through an [Issue](https://github.com/MCCTeam/Minecraft-Console-Client/issues) in case you are not familiar with Git.
### Translate README.md
1. Get the English version of the README.md from [here](https://raw.githubusercontent.com/MCCTeam/Minecraft-Console-Client/master/README.md).
2. See `Add new translation -> 1.` for the target language code. Assume it is `xx`.
3. Complete the translation according to the English README.md and name the translated version as `README-xx.md`.
4. In the English README, above the "About" section, add the name of the language and a hyperlink to `README-xx.md`.
## Contributors ## Contributors

View file

@ -57,7 +57,7 @@ Install [Git](https://www.git-scm.com/)
4. Clone the [Git Hub Repository](https://github.com/MCCTeam/Minecraft-Console-Client) by typing end executing the following command: 4. Clone the [Git Hub Repository](https://github.com/MCCTeam/Minecraft-Console-Client) by typing end executing the following command:
```bash ```bash
git clone https://github.com/MCCTeam/Minecraft-Console-Client.git --recursive git clone --branch l10n_master https://github.com/MCCTeam/Minecraft-Console-Client.git --recursive
``` ```
5. Once the repository has been cloned, you can close the `Git Bash` terminal emulator 5. Once the repository has been cloned, you can close the `Git Bash` terminal emulator
@ -114,7 +114,7 @@ Requirements:
2. Recursively clone the [Git Hub Repository](https://github.com/MCCTeam/Minecraft-Console-Client) by typing end executing the following command: 2. Recursively clone the [Git Hub Repository](https://github.com/MCCTeam/Minecraft-Console-Client) by typing end executing the following command:
```bash ```bash
git clone https://github.com/MCCTeam/Minecraft-Console-Client.git --recursive git clone --branch l10n_master https://github.com/MCCTeam/Minecraft-Console-Client.git --recursive
``` ```
3. Go to the folder you've cloned (should be `Minecraft-Console-Client`) 3. Go to the folder you've cloned (should be `Minecraft-Console-Client`)
@ -171,7 +171,7 @@ Requirements:
1. Clone the [Git Hub Repository](https://github.com/MCCTeam/Minecraft-Console-Client) by typing end executing the following command: 1. Clone the [Git Hub Repository](https://github.com/MCCTeam/Minecraft-Console-Client) by typing end executing the following command:
```bash ```bash
git clone https://github.com/MCCTeam/Minecraft-Console-Client.git --recursive git clone --branch l10n_master https://github.com/MCCTeam/Minecraft-Console-Client.git --recursive
``` ```
2. Navigate to `Minecraft-Console-Client/Docker` 2. Navigate to `Minecraft-Console-Client/Docker`