Sfoglia il codice sorgente

fix: change i18n workflow trigger mechanism to run in main repository (#23662)

tags/1.7.2
lyzno1 2 mesi fa
parent
commit
f9abcfd789
Nessun account collegato all'indirizzo email del committer

+ 13
- 5
.github/workflows/translate-i18n-base-on-english.yml Vedi File

@@ -1,9 +1,10 @@
name: Check i18n Files and Create PR

on:
pull_request:
types: [closed]
push:
branches: [main]
paths:
- 'web/i18n/en-US/*.ts'

permissions:
contents: write
@@ -11,7 +12,7 @@ permissions:

jobs:
check-and-update:
if: github.event.pull_request.merged == true
if: github.repository == 'langgenius/dify'
runs-on: ubuntu-latest
defaults:
run:
@@ -19,7 +20,7 @@ jobs:
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 2 # last 2 commits
fetch-depth: 2
token: ${{ secrets.GITHUB_TOKEN }}

- name: Check for file changes in i18n/en-US
@@ -31,6 +32,13 @@ jobs:
echo "Changed files: $changed_files"
if [ -n "$changed_files" ]; then
echo "FILES_CHANGED=true" >> $GITHUB_ENV
file_args=""
for file in $changed_files; do
filename=$(basename "$file" .ts)
file_args="$file_args --file=$filename"
done
echo "FILE_ARGS=$file_args" >> $GITHUB_ENV
echo "File arguments: $file_args"
else
echo "FILES_CHANGED=false" >> $GITHUB_ENV
fi
@@ -55,7 +63,7 @@ jobs:

- name: Generate i18n translations
if: env.FILES_CHANGED == 'true'
run: pnpm run auto-gen-i18n
run: pnpm run auto-gen-i18n ${{ env.FILE_ARGS }}

- name: Create Pull Request
if: env.FILES_CHANGED == 'true'

+ 5
- 3
web/i18n-config/auto-gen-i18n.js Vedi File

@@ -212,7 +212,9 @@ export default translation

// Add command line argument support
const isDryRun = process.argv.includes('--dry-run')
const targetFile = process.argv.find(arg => arg.startsWith('--file='))?.split('=')[1]
const targetFiles = process.argv
.filter(arg => arg.startsWith('--file='))
.map(arg => arg.split('=')[1])
const targetLang = process.argv.find(arg => arg.startsWith('--lang='))?.split('=')[1]

// Rate limiting helper
@@ -230,8 +232,8 @@ async function main() {
.map(file => file.replace(/\.ts$/, ''))
// Removed app-debug exclusion, now only skip specific problematic keys

// Filter by target file if specified
const filesToProcess = targetFile ? files.filter(f => f === targetFile) : files
// Filter by target files if specified
const filesToProcess = targetFiles.length > 0 ? files.filter(f => targetFiles.includes(f)) : files
const languagesToProcess = targetLang ? [targetLang] : Object.keys(languageKeyMap)

console.log(`📁 Files to process: ${filesToProcess.join(', ')}`)

+ 2
- 0
web/i18n/de-DE/workflow.ts Vedi File

@@ -114,6 +114,8 @@ const translation = {
needEndNode: 'Der Endknoten muss hinzugefügt werden.',
needAnswerNode: 'Der Antwortknoten muss hinzugefügt werden.',
tagBound: 'Anzahl der Apps, die dieses Tag verwenden',
currentWorkflow: 'Aktueller Arbeitsablauf',
currentView: 'Aktuelle Ansicht',
},
env: {
envPanelTitle: 'Umgebungsvariablen',

+ 2
- 0
web/i18n/es-ES/workflow.ts Vedi File

@@ -114,6 +114,8 @@ const translation = {
needEndNode: 'Se debe agregar el nodo Final',
addBlock: 'Agregar nodo',
tagBound: 'Número de aplicaciones que utilizan esta etiqueta',
currentView: 'Vista actual',
currentWorkflow: 'Flujo de trabajo actual',
},
env: {
envPanelTitle: 'Variables de Entorno',

+ 2
- 0
web/i18n/fa-IR/workflow.ts Vedi File

@@ -114,6 +114,8 @@ const translation = {
needAnswerNode: 'باید گره پاسخ اضافه شود',
addBlock: 'نود اضافه کنید',
tagBound: 'تعداد برنامه‌هایی که از این برچسب استفاده می‌کنند',
currentView: 'نمای فعلی',
currentWorkflow: 'گردش کار فعلی',
},
env: {
envPanelTitle: 'متغیرهای محیطی',

+ 2
- 0
web/i18n/fr-FR/workflow.ts Vedi File

@@ -114,6 +114,8 @@ const translation = {
needAnswerNode: 'Le nœud de réponse doit être ajouté.',
addBlock: 'Ajouter un nœud',
tagBound: 'Nombre d\'applications utilisant cette étiquette',
currentView: 'Vue actuelle',
currentWorkflow: 'Flux de travail actuel',
},
env: {
envPanelTitle: 'Variables d\'Environnement',

+ 2
- 0
web/i18n/hi-IN/workflow.ts Vedi File

@@ -117,6 +117,8 @@ const translation = {
addBlock: 'नोड जोड़ें',
needEndNode: 'अंत नोड जोड़ा जाना चाहिए',
tagBound: 'इस टैग का उपयोग करने वाले ऐप्स की संख्या',
currentView: 'वर्तमान दृश्य',
currentWorkflow: 'वर्तमान कार्यप्रवाह',
},
env: {
envPanelTitle: 'पर्यावरण चर',

+ 2
- 0
web/i18n/it-IT/workflow.ts Vedi File

@@ -118,6 +118,8 @@ const translation = {
addBlock: 'Aggiungi nodo',
needAnswerNode: 'Deve essere aggiunto il nodo di risposta',
tagBound: 'Numero di app che utilizzano questo tag',
currentWorkflow: 'Flusso di lavoro corrente',
currentView: 'Vista corrente',
},
env: {
envPanelTitle: 'Variabili d\'Ambiente',

+ 2
- 0
web/i18n/ko-KR/workflow.ts Vedi File

@@ -118,6 +118,8 @@ const translation = {
needAnswerNode: '답변 노드를 추가해야 합니다.',
needEndNode: '종단 노드를 추가해야 합니다.',
tagBound: '이 태그를 사용하는 앱 수',
currentView: '현재 보기',
currentWorkflow: '현재 워크플로',
},
env: {
envPanelTitle: '환경 변수',

+ 2
- 0
web/i18n/pl-PL/workflow.ts Vedi File

@@ -114,6 +114,8 @@ const translation = {
needEndNode: 'Należy dodać węzeł końcowy',
needAnswerNode: 'Węzeł odpowiedzi musi zostać dodany',
tagBound: 'Liczba aplikacji korzystających z tego tagu',
currentWorkflow: 'Bieżący przepływ pracy',
currentView: 'Bieżący widok',
},
env: {
envPanelTitle: 'Zmienne Środowiskowe',

+ 2
- 0
web/i18n/pt-BR/workflow.ts Vedi File

@@ -114,6 +114,8 @@ const translation = {
needEndNode: 'O nó de Fim deve ser adicionado',
needAnswerNode: 'O nó de resposta deve ser adicionado',
tagBound: 'Número de aplicativos usando esta tag',
currentView: 'Visualização atual',
currentWorkflow: 'Fluxo de trabalho atual',
},
env: {
envPanelTitle: 'Variáveis de Ambiente',

+ 2
- 0
web/i18n/ro-RO/workflow.ts Vedi File

@@ -114,6 +114,8 @@ const translation = {
needAnswerNode: 'Nodul de răspuns trebuie adăugat',
needEndNode: 'Nodul de sfârșit trebuie adăugat',
tagBound: 'Numărul de aplicații care folosesc acest tag',
currentView: 'Vizualizare curentă',
currentWorkflow: 'Flux de lucru curent',
},
env: {
envPanelTitle: 'Variabile de Mediu',

+ 2
- 0
web/i18n/ru-RU/workflow.ts Vedi File

@@ -114,6 +114,8 @@ const translation = {
needAnswerNode: 'В узел ответа необходимо добавить',
needEndNode: 'Узел конца должен быть добавлен',
tagBound: 'Количество приложений, использующих этот тег',
currentView: 'Текущий вид',
currentWorkflow: 'Текущий рабочий процесс',
},
env: {
envPanelTitle: 'Переменные среды',

+ 2
- 0
web/i18n/sl-SI/workflow.ts Vedi File

@@ -114,6 +114,8 @@ const translation = {
configure: 'Konfiguriraj',
inRunMode: 'V načinu izvajanja',
tagBound: 'Število aplikacij, ki uporabljajo to oznako',
currentView: 'Trenutni pogled',
currentWorkflow: 'Trenutni potek dela',
},
env: {
modal: {

+ 2
- 0
web/i18n/th-TH/workflow.ts Vedi File

@@ -114,6 +114,8 @@ const translation = {
addBlock: 'เพิ่มโนด',
needEndNode: 'ต้องเพิ่มโหนดจบ',
tagBound: 'จำนวนแอปพลิเคชันที่ใช้แท็กนี้',
currentWorkflow: 'เวิร์กโฟลว์ปัจจุบัน',
currentView: 'ปัจจุบัน View',
},
env: {
envPanelTitle: 'ตัวแปรสภาพแวดล้อม',

+ 2
- 0
web/i18n/tr-TR/workflow.ts Vedi File

@@ -114,6 +114,8 @@ const translation = {
needAnswerNode: 'Cevap düğümü eklenmelidir.',
needEndNode: 'Son düğüm eklenmelidir',
tagBound: 'Bu etiketi kullanan uygulama sayısı',
currentView: 'Geçerli Görünüm',
currentWorkflow: 'Mevcut İş Akışı',
},
env: {
envPanelTitle: 'Çevre Değişkenleri',

+ 2
- 0
web/i18n/uk-UA/workflow.ts Vedi File

@@ -114,6 +114,8 @@ const translation = {
needEndNode: 'Необхідно додати кінцевий вузол',
needAnswerNode: 'Вузол Відповіді повинен бути доданий',
tagBound: 'Кількість додатків, що використовують цей тег',
currentView: 'Поточний вигляд',
currentWorkflow: 'Поточний робочий процес',
},
env: {
envPanelTitle: 'Змінні середовища',

+ 2
- 0
web/i18n/vi-VN/workflow.ts Vedi File

@@ -114,6 +114,8 @@ const translation = {
addBlock: 'Thêm Node',
needEndNode: 'Nút Kết thúc phải được thêm vào',
tagBound: 'Số lượng ứng dụng sử dụng thẻ này',
currentWorkflow: 'Quy trình làm việc hiện tại',
currentView: 'Hiện tại View',
},
env: {
envPanelTitle: 'Biến Môi Trường',

+ 2
- 0
web/i18n/zh-Hant/workflow.ts Vedi File

@@ -114,6 +114,8 @@ const translation = {
exportImage: '匯出圖像',
exportJPEG: '匯出為 JPEG',
tagBound: '使用此標籤的應用程式數量',
currentView: '當前檢視',
currentWorkflow: '當前工作流程',
},
env: {
envPanelTitle: '環境變數',

Loading…
Annulla
Salva