Repository: flxzt/rnote (language: rust)

Issue:
Suggestion for Chinese translations
I found that the completion of `Simplified Chinese`translation is way higher than the `Traditional Chinese` ( 90+% vs 70+%).
As `Simplified Chinese` and `Traditional Chinese` are the **SAME** language but in two different **WRITING FONTS**, I suggest that we just keep the Simplified Chinese active, and use the converter tool OpenCC([https://github.com/BYVoid/OpenCC](https://github.com/BYVoid/OpenCC)) to automatically generate the Traditional version of Chinese.
In this way, translators no longer need to maintain two **SAME** languages, and their work should be easier.


Discussion / hints:
This is a good idea. Unfortunately weblate treats simplified and traditional as separate languages, I don't think it is possible to convert them automatically there. Either a Github Action could be set up, or it could be done manually. Is it possible to convert .po files with `opencc`?. If yes, you could download the simplified chinese file from weblate, convert it and create a PR with the updated traditional chinese file. Would you be willing to do that?
It is possible to do it with `opencc`. Because now it is mid-night here in China, I will probably do it tomorrow.
But before converting, I would like to know what does the term [`perm.`](https://hosted.weblate.org/translate/rnote/repo/zh_Hans/?checksum=edee9ee7aff9e450&sort_by=-priority,position) actually means. I found it confusing, and cannot translate it.
No worries, there is no rush. :)
Ah that one probably needs a replacement by an icon or something. It is the abbreviation for permanent, it is the suffix of a checkbox.
![Bildschirmfoto vom 2022-07-17 18-37-27](https://user-images.githubusercontent.com/19841886/179413200-e6ce4dfb-67b9-4850-b21c-5b990d698dc7.png)


OK, I will leave it as is. And that makes the Han_s to be 100% complete (for now).
I have updated Chinese Traditional manually.
I used the config file `openCC\share\opencc\s2twp.json`.
Thanks! Can you provide the exact command for conversion? I believe it should be possible to automate it.
Yes, it can be done automatically. You can use openCC as either a `bin` or a `lib`. There are API for nodejs, python, cpp and etc. 
The question now is that what is the trigger of the automatic program (when should it run) and where should we put the converted version(on weblate or GitHub).
My suggestion is that 
1. Delete the TC on weblate(we will not manually manage TC anymore)
2. Use GitHub Action to run automatically after PR merge
3. Just put the converted TC file in the repo's directory.

Fix patch:
diff --git a/.github/workflows/update-translation.yml b/.github/workflows/update-translation.yml
new file mode 100644
index 0000000000..ee0c9aa17b
--- /dev/null
+++ b/.github/workflows/update-translation.yml
@@ -0,0 +1,71 @@
+on:
+  push:
+    branches:
+      - 'main'
+    paths:
+      - 'crates/rnote-ui/po/LINGUAS'
+      - 'crates/rnote-ui/po/zh_Hans.po'
+      - 'crates/rnote-ui/po/zh_Hant.po'
+  workflow_dispatch:
+  workflow_call:
+
+name: Update Translation
+
+concurrency:
+    group: ${{ github.workflow }}-${{ github.ref }}
+    cancel-in-progress: true
+
+jobs:
+  i18n_zh_Hans2zh_Hant:
+    name: zh_Hans -> zh_Hant
+    runs-on: ubuntu-22.04
+    container: fedora:39
+    permissions:
+      contents: write # needed for pushing the changes
+    steps:
+      - name: Install dependencies
+        run: |
+          sudo dnf install --refresh -y git opencc-tools
+
+      - name: Setup repository
+        run: |
+          git clone -b ${GITHUB_HEAD_REF:-${GITHUB_REF#refs/heads/}} \
+            ${{ github.server_url }}/${{ github.repository }} .
+          git config --global --add safe.directory "$(pwd)"
+          git config --local user.email "github-actions[bot]@users.noreply.github.com"
+          git config --local user.name "github-actions[bot]"
+
+      - name: Generate zh_Hant from zh_Hans
+        run: |
+          cat ./crates/rnote-ui/po/LINGUAS \
+          | sed -e 's|zh_Hans|zh_Hans\nzh_CN\nzh_SG|' \
+                -e 's|zh_Hant|zh_Hant\nzh_HK\nzh_TW|' \
+          | sort -uo ./crates/rnote-ui/po/LINGUAS
+
+          cat ./crates/rnote-ui/po/zh_Hans.po \
+          | sed -e 's|Language: zh_Hans|Language: zh_Hant|' \
+                -e 's|Last-Translator:|Last-Translator: openCC converted|' \
+          | opencc -c /usr/share/opencc/s2twp.json \
+                   -o ./crates/rnote-ui/po/zh_Hant.po
+
+      - name: Commit changes
+        id: commit-changes
+        run: |
+          echo -e "Update traditional Chinese translation\nreferenced issue: 220" \
+          | git commit -a -F - || export failure=$?
+
+          if [ -z $failure ]; then
+            echo "status=true" >> $GITHUB_OUTPUT
+          elif [ $failure = '1' ]; then
+            echo 'No commit made, skip push.'
+            echo "status=false" >> $GITHUB_OUTPUT
+          else
+            exit $failure
+          fi
+      
+      - name: Push changes
+        if: ${{ steps.commit-changes.outputs.status == 'true' }}
+        uses: ad-m/github-push-action@v0.8.0
+        with:
+          github_token: ${{ secrets.GITHUB_TOKEN }}
+          branch: ${{ github.ref }}


Test patch: