Skip to content

Commit f6711b6

Browse files
committed
Update translation system
1 parent 4514d84 commit f6711b6

File tree

117 files changed

+34
-1223
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

117 files changed

+34
-1223
lines changed

.github/workflows/translate-and-build-package.yml

Lines changed: 34 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,12 @@ name: Translate and Build Package
22

33
on:
44
workflow_dispatch:
5+
inputs:
6+
debug_enabled:
7+
type: boolean
8+
description: 'With TMATE'
9+
required: false
10+
default: false
511

612
push:
713
branches: [ "*" ]
@@ -10,7 +16,21 @@ jobs:
1016
build:
1117
runs-on: ubuntu-latest
1218
steps:
13-
- uses: actions/checkout@v3
19+
- uses: actions/checkout@v4
20+
- name: If Template exit
21+
shell: bash
22+
run: |
23+
cancel () {
24+
echo "Pacote de template, não precisa traduzir e compilar"
25+
echo "SAINDO...."
26+
curl -s -H "Authorization: token ${{ github.token }}" \
27+
-X POST "https://api.github.com/repos/${{ github.repository }}/actions/runs/${{ github.run_id }}/cancel"
28+
sleep infinity
29+
}
30+
if [ -n "$(grep biglinux-package-template pkgbuild/PKGBUILD)" ];then
31+
cancel
32+
fi
33+
1434
- name: Install Translator Dependencies
1535
shell: bash
1636
run: |
@@ -22,15 +42,23 @@ jobs:
2242
# Install attranslator
2343
sudo npm install --location=global attranslate
2444
45+
## Tmate ##
46+
- name: Setup TMATE Session
47+
uses: mxschmitt/action-tmate@v3
48+
if: ${{ github.event_name == 'workflow_dispatch' && inputs.debug_enabled }}
49+
2550
- name: Translate Package
26-
shell: bash -O extglob {0}
51+
shell: bash #-O extglob {0}
2752
env:
2853
AZURE_KEY: ${{ secrets.AZURE_KEY }}
54+
OPENAI_KEY: ${{ secrets.OPENAI_KEY }}
2955
run: |
3056
cd ..
3157
git clone https://github.com/biglinux/big-auto-translator.git
3258
mv big-auto-translator/gettext_po_generator_github.sh .
59+
sudo cp -f big-auto-translator/openai-translate.js /usr/local/lib/node_modules/attranslate/dist/services/openai-translate.js
3360
gitfolder=$(echo ${{ github.repository }} | rev | cut -d "/" -f1 | rev)
61+
# export OriginalLang=pt-BR
3462
bash gettext_po_generator_github.sh $gitfolder
3563
3664
- name: Update github
@@ -49,4 +77,7 @@ jobs:
4977
- name: Send Hooks BigLinux Build Package
5078
shell: bash
5179
run: |
52-
curl -X POST -H "Accept: application/json" -H "Authorization: token ${{ secrets.WEBHOOK_TOKEN }}" --data '{"event_type": "${{ github.repository }}", "client_payload": { "branch": "${{ github.ref_name }}", "url": "https://github.com/${{ github.repository }}"}}' https://api.github.com/repos/BigLinux-Package-Build/build-package/dispatches
80+
if [ -z "$(grep biglinux-package-template pkgbuild/PKGBUILD)" ];then
81+
curl -X POST -H "Accept: application/json" -H "Authorization: token ${{ secrets.WEBHOOK_TOKEN }}" --data '{"event_type": "${{ github.repository }}", "client_payload": { "branch": "${{ github.ref_name }}", "url": "https://github.com/${{ github.repository }}"}}' https://api.github.com/repos/BigLinux-Package-Build/build-package/dispatches
82+
curl -X POST -H "Accept: application/json" -H "Authorization: token ${{ secrets.WEBHOOK_TOKEN }}" --data '{"event_type": "${{ github.repository }}", "client_payload": { "branch": "${{ github.ref_name }}", "url": "https://github.com/${{ github.repository }}"}}' https://api.github.com/repos/BigLinux-Package-Build/build-package-ARM/dispatches
83+
fi

locale/bg.json

Lines changed: 0 additions & 1 deletion
This file was deleted.

locale/bg.po

Lines changed: 0 additions & 32 deletions
This file was deleted.

locale/calamares-biglinux-tmp.pot

Lines changed: 0 additions & 84 deletions
This file was deleted.

locale/calamares-biglinux.pot

Lines changed: 0 additions & 89 deletions
This file was deleted.

locale/cs.json

Lines changed: 0 additions & 1 deletion
This file was deleted.

locale/cs.po

Lines changed: 0 additions & 32 deletions
This file was deleted.

locale/da.json

Lines changed: 0 additions & 1 deletion
This file was deleted.

locale/da.po

Lines changed: 0 additions & 32 deletions
This file was deleted.

locale/de.json

Lines changed: 0 additions & 1 deletion
This file was deleted.

locale/de.po

Lines changed: 0 additions & 32 deletions
This file was deleted.

locale/el.json

Lines changed: 0 additions & 1 deletion
This file was deleted.

0 commit comments

Comments
 (0)