Skip to content

Commit

Permalink
Update translation system
Browse files Browse the repository at this point in the history
  • Loading branch information
bigbruno committed May 23, 2024
1 parent 4514d84 commit f6711b6
Show file tree
Hide file tree
Showing 117 changed files with 34 additions and 1,223 deletions.
37 changes: 34 additions & 3 deletions .github/workflows/translate-and-build-package.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,12 @@ name: Translate and Build Package

on:
workflow_dispatch:
inputs:
debug_enabled:
type: boolean
description: 'With TMATE'
required: false
default: false

push:
branches: [ "*" ]
Expand All @@ -10,7 +16,21 @@ jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
- name: If Template exit
shell: bash
run: |
cancel () {
echo "Pacote de template, não precisa traduzir e compilar"
echo "SAINDO...."
curl -s -H "Authorization: token ${{ github.token }}" \
-X POST "https://api.github.com/repos/${{ github.repository }}/actions/runs/${{ github.run_id }}/cancel"
sleep infinity
}
if [ -n "$(grep biglinux-package-template pkgbuild/PKGBUILD)" ];then
cancel
fi
- name: Install Translator Dependencies
shell: bash
run: |
Expand All @@ -22,15 +42,23 @@ jobs:
# Install attranslator
sudo npm install --location=global attranslate
## Tmate ##
- name: Setup TMATE Session
uses: mxschmitt/action-tmate@v3
if: ${{ github.event_name == 'workflow_dispatch' && inputs.debug_enabled }}

- name: Translate Package
shell: bash -O extglob {0}
shell: bash #-O extglob {0}
env:
AZURE_KEY: ${{ secrets.AZURE_KEY }}
OPENAI_KEY: ${{ secrets.OPENAI_KEY }}
run: |
cd ..
git clone https://github.com/biglinux/big-auto-translator.git
mv big-auto-translator/gettext_po_generator_github.sh .
sudo cp -f big-auto-translator/openai-translate.js /usr/local/lib/node_modules/attranslate/dist/services/openai-translate.js
gitfolder=$(echo ${{ github.repository }} | rev | cut -d "/" -f1 | rev)
# export OriginalLang=pt-BR
bash gettext_po_generator_github.sh $gitfolder
- name: Update github
Expand All @@ -49,4 +77,7 @@ jobs:
- name: Send Hooks BigLinux Build Package
shell: bash
run: |
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
if [ -z "$(grep biglinux-package-template pkgbuild/PKGBUILD)" ];then
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
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
fi
1 change: 0 additions & 1 deletion locale/bg.json

This file was deleted.

32 changes: 0 additions & 32 deletions locale/bg.po

This file was deleted.

84 changes: 0 additions & 84 deletions locale/calamares-biglinux-tmp.pot

This file was deleted.

89 changes: 0 additions & 89 deletions locale/calamares-biglinux.pot

This file was deleted.

1 change: 0 additions & 1 deletion locale/cs.json

This file was deleted.

32 changes: 0 additions & 32 deletions locale/cs.po

This file was deleted.

1 change: 0 additions & 1 deletion locale/da.json

This file was deleted.

32 changes: 0 additions & 32 deletions locale/da.po

This file was deleted.

1 change: 0 additions & 1 deletion locale/de.json

This file was deleted.

32 changes: 0 additions & 32 deletions locale/de.po

This file was deleted.

1 change: 0 additions & 1 deletion locale/el.json

This file was deleted.

Loading

0 comments on commit f6711b6

Please sign in to comment.