Skip to content

Commit

Permalink
Try translate
Browse files Browse the repository at this point in the history
  • Loading branch information
bigbruno committed Jan 26, 2025
1 parent 59402ee commit 9d0d120
Show file tree
Hide file tree
Showing 2 changed files with 101 additions and 17 deletions.
83 changes: 83 additions & 0 deletions .github/workflows/translate-and-build-package.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,83 @@
name: Translate and Build Package

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

push:
branches: [ "*" ]

jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- 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: |
sudo apt-get update
sudo apt-get install \
git \
gettext \
npm
# 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}
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=en-US
bash gettext_po_generator_github.sh $gitfolder
- name: Update github
run: |
git config --local user.email "github-actions[bot]@users.noreply.github.com"
git config --local user.name "github-actions[bot]"
git add --all
if [ -n "$(git commit -m "translate $(date +%y-%m-%d_%H:%M)" -a | grep "nothing to commit")" ];then exit 0; fi
- name: Push changes
uses: ad-m/github-push-action@master
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
branch: ${{ github.ref }}

- name: Send Hooks BigLinux Build Package
shell: bash
run: |
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
35 changes: 18 additions & 17 deletions contents/ui/ConfigGeneral.qml
Original file line number Diff line number Diff line change
Expand Up @@ -119,46 +119,46 @@ KCM.SimpleKCM {

model: [{
"id": "showDuckDuckGoChat",
"text": i18nc("@option:check", "DuckDuckGo Chat")
"text": "DuckDuckGo Chat"
}, {
"id": "showChatGPT",
"text": i18nc("@option:check", "ChatGPT")
"text": "ChatGPT"
}, {
"id": "showHugginChat",
"text": i18nc("@option:check", "HugginChat")
"text": "HugginChat"
}, {
"id": "showGoogleGemini",
"text": i18nc("@option:check", "Google Gemini")
"text": "Google Gemini"
}, {
"id": "showYou",
"text": i18nc("@option:check", "You")
"text": "You"
}, {
"id": "showPerplexity",
"text": i18nc("@option:check", "Perplexity")
"text": "Perplexity"
}, {
"id": "showBlackBox",
"text": i18nc("@option:check", "BlackBox AI")
"text": "BlackBox AI"
}, {
"id": "showBingCopilot",
"text": i18nc("@option:check", "Bing Copilot")
"text": "Bing Copilot"
}, {
"id": "showBigAGI",
"text": i18nc("@option:check", "Big AGI")
"text": "Big AGI"
}, {
"id": "showLobeChat",
"text": i18nc("@option:check", "LobeChat")
"text": "LobeChat"
}, {
"id": "showClaude",
"text": i18nc("@option:check", "Claude")
"text": "Claude"
}, {
"id": "showDeepSeek",
"text": i18nc("@option:check", "DeepSeek")
"text": "DeepSeek"
}, {
"id": "showMetaAI",
"text": i18nc("@option:check", "Meta AI")
"text": "Meta AI"
}, {
"id": "showGrok",
"text": i18nc("@option:check", "Grok")
"text": "Grok"
}]

delegate: ColumnLayout {
Expand Down Expand Up @@ -322,15 +322,16 @@ KCM.SimpleKCM {
Kirigami.InlineMessage {
Layout.fillWidth: true
type: Kirigami.MessageType.Information
text: i18nc("@info:tooltip", "If notifications are not working create the file:
.local/share/knotifications6/chatai_plasmoid.notifyrc with the following content:
text: i18nc("@info:tooltip", "If notifications are not working create the file:") + `
.local/share/knotifications6/chatai_plasmoid.notifyrc ` + i18nc("@info:tooltip", "with the following content:") + `
[Global]
IconName=applications-internet
DesktopEntry=ChatAI
Comment=ChatAI
[Event/notification]
Name=ChatAIAction=Popup")
Name=ChatAI
Action=Popup`
visible: notificationsEnabled.checked
}

Expand Down

0 comments on commit 9d0d120

Please sign in to comment.