From b0dce4e02f3eea0be37c9b1bf9507dc5cccdad7c Mon Sep 17 00:00:00 2001 From: DoctorReid Date: Sun, 16 Jun 2024 18:37:15 +0800 Subject: [PATCH] =?UTF-8?q?#2=20=E5=A2=9E=E5=8A=A0=E7=BC=96=E8=AF=91po?= =?UTF-8?q?=E7=9A=84=E5=B7=A5=E4=BD=9C=E6=B5=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/workflows/locale-po.yml | 44 +++++++++++++++++++++++ assets/text/output/cn/LC_MESSAGES/ocr.mo | Bin 0 -> 118 bytes assets/text/output/cn/LC_MESSAGES/ui.mo | Bin 0 -> 258 bytes assets/text/output/en/LC_MESSAGES/ocr.mo | Bin 0 -> 118 bytes assets/text/output/en/LC_MESSAGES/ui.mo | Bin 0 -> 196 bytes requirements-dev-ext.txt | 5 +-- src/one_dragon/devtools/__init__.py | 0 src/one_dragon/devtools/compile_po.py | 36 +++++++++++++++++++ src/one_dragon/gui/app/installer.py | 3 +- src/one_dragon/utils/i18_utils.py | 2 +- 10 files changed, 86 insertions(+), 4 deletions(-) create mode 100644 .github/workflows/locale-po.yml create mode 100644 assets/text/output/cn/LC_MESSAGES/ocr.mo create mode 100644 assets/text/output/cn/LC_MESSAGES/ui.mo create mode 100644 assets/text/output/en/LC_MESSAGES/ocr.mo create mode 100644 assets/text/output/en/LC_MESSAGES/ui.mo create mode 100644 src/one_dragon/devtools/__init__.py create mode 100644 src/one_dragon/devtools/compile_po.py diff --git a/.github/workflows/locale-po.yml b/.github/workflows/locale-po.yml new file mode 100644 index 00000000..0b87a533 --- /dev/null +++ b/.github/workflows/locale-po.yml @@ -0,0 +1,44 @@ +name: Compile po into mo + +on: + push: + branches: + - dev_locale + +jobs: + job1: + runs-on: ubuntu-latest + strategy: + matrix: + python-version: ["3.11"] + + steps: + - name: Checkout code + uses: actions/checkout@v4 + + - name: Set up Python ${{ matrix.python-version }} + uses: actions/setup-python@v4 + with: + python-version: ${{ matrix.python-version }} + + - name: Install dependencies + run: pip install polib==1.2.0 + + - name: Show dir + run: pwd + + - name: Compile PO files + run: | + PYTHONPATH=$(pwd) python your_script.py python src/one_dragon/devtools/compile_po.py + + - name: Commit changes + run: | + if ! git diff --quiet; then + git config user.name github-actions + git config user.email github-actions@github.com + git add data/locales/**/*.mo + git commit -m "#2 自动编译mo文件提交 $(date +%Y-%m-%d)" + git push + else + echo "No file modifications" + fi \ No newline at end of file diff --git a/assets/text/output/cn/LC_MESSAGES/ocr.mo b/assets/text/output/cn/LC_MESSAGES/ocr.mo new file mode 100644 index 0000000000000000000000000000000000000000..2030e4dacc41cf9ed6e622d3cb6c0d61369e8f2b GIT binary patch literal 118 zcmca7#4?ou2pEA_28dNa93aqvP+-~v$kqk%o%8cbQu9i5Ln;eWtrSX9D@ybWauPH1 utQC?o5{rscOKd|!+;lCt;OdGJ^NQ0_i*#M{lJiqC^U|#pERr%yxEKK56C3~l literal 0 HcmV?d00001 diff --git a/assets/text/output/cn/LC_MESSAGES/ui.mo b/assets/text/output/cn/LC_MESSAGES/ui.mo new file mode 100644 index 0000000000000000000000000000000000000000..718b1ec1fb7afdad1de03c613d0b38ca070db752 GIT binary patch literal 258 zcmca7#4?ou2v~qv28eAy93Y5+P+(dT$c_bKHXtsC(se-E1BhFJSQv=U0Wm)iKZ4Sq zfHXr?YF