Skip to content

Commit a679079

Browse files
authored
fix: auto translate fail (langgenius#11286)
1 parent e39e776 commit a679079

File tree

21 files changed

+499
-3
lines changed

21 files changed

+499
-3
lines changed

web/i18n/auto-gen-i18n.js

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -29,9 +29,17 @@ async function translateMissingKeyDeeply(sourceObj, targetObject, toLanguage) {
2929
await translateMissingKeyDeeply(sourceObj[key], targetObject[key], toLanguage)
3030
}
3131
else {
32-
const { translation } = await translate(sourceObj[key], null, languageKeyMap[toLanguage])
33-
targetObject[key] = translation
34-
// console.log(translation)
32+
try {
33+
if (!sourceObj[key]) {
34+
targetObject[key] = ''
35+
return
36+
}
37+
const { translation } = await translate(sourceObj[key], null, languageKeyMap[toLanguage])
38+
targetObject[key] = translation
39+
}
40+
catch (e) {
41+
console.error(`Error translating ${sourceObj[key]}(${key}) to ${toLanguage}`)
42+
}
3543
}
3644
}
3745
else if (typeof sourceObj[key] === 'object') {

web/i18n/de-DE/workflow.ts

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -500,6 +500,26 @@ const translation = {
500500
'clear': 'Löschen',
501501
'setVariable': 'Variable setzen',
502502
'variable': 'Variable',
503+
'operations': {
504+
'title': 'Operation',
505+
'clear': 'Klar',
506+
'over-write': 'Überschreiben',
507+
'set': 'Garnitur',
508+
'-=': '-=',
509+
'+=': '+=',
510+
'/=': '/=',
511+
'append': 'Anfügen',
512+
'extend': 'Ausdehnen',
513+
'*=': '*=',
514+
'overwrite': 'Überschreiben',
515+
},
516+
'setParameter': 'Parameter setzen...',
517+
'noVarTip': 'Klicken Sie auf die Schaltfläche "+", um Variablen hinzuzufügen',
518+
'variables': 'Variablen',
519+
'noAssignedVars': 'Keine verfügbaren zugewiesenen Variablen',
520+
'selectAssignedVariable': 'Zugewiesene Variable auswählen...',
521+
'varNotSet': 'Variable NICHT gesetzt',
522+
'assignedVarsDescription': 'Zugewiesene Variablen müssen beschreibbare Variablen sein, z. B. Konversationsvariablen.',
503523
},
504524
tool: {
505525
toAuthorize: 'Autorisieren',
@@ -631,6 +651,13 @@ const translation = {
631651
tracing: {
632652
stopBy: 'Gestoppt von {{user}}',
633653
},
654+
variableReference: {
655+
noAvailableVars: 'Keine verfügbaren Variablen',
656+
conversationVars: 'Konversations-Variablen',
657+
noAssignedVars: 'Keine verfügbaren zugewiesenen Variablen',
658+
noVarsForOperation: 'Es stehen keine Variablen für die Zuweisung mit der ausgewählten Operation zur Verfügung.',
659+
assignedVarsDescription: 'Zugewiesene Variablen müssen beschreibbare Variablen sein, z. B.',
660+
},
634661
}
635662

636663
export default translation

web/i18n/es-ES/workflow.ts

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -500,6 +500,26 @@ const translation = {
500500
'clear': 'Limpiar',
501501
'setVariable': 'Establecer Variable',
502502
'variable': 'Variable',
503+
'operations': {
504+
'clear': 'Claro',
505+
'*=': '*=',
506+
'-=': '-=',
507+
'title': 'Operación',
508+
'extend': 'Extender',
509+
'append': 'Añadir',
510+
'+=': '+=',
511+
'over-write': 'Sobrescribir',
512+
'overwrite': 'Sobrescribir',
513+
'/=': '/=',
514+
'set': 'Poner',
515+
},
516+
'variables': 'Variables',
517+
'setParameter': 'Establecer parámetro...',
518+
'noVarTip': 'Haga clic en el botón "+" para agregar variables',
519+
'varNotSet': 'Variable NO establecida',
520+
'noAssignedVars': 'No hay variables asignadas disponibles',
521+
'selectAssignedVariable': 'Seleccione la variable asignada...',
522+
'assignedVarsDescription': 'Las variables asignadas deben ser variables grabables, como las variables de conversación.',
503523
},
504524
tool: {
505525
toAuthorize: 'Para autorizar',
@@ -634,6 +654,13 @@ const translation = {
634654
tracing: {
635655
stopBy: 'Pásate por {{usuario}}',
636656
},
657+
variableReference: {
658+
noAvailableVars: 'No hay variables disponibles',
659+
assignedVarsDescription: 'Las variables asignadas deben ser variables grabables, como',
660+
noVarsForOperation: 'No hay variables disponibles para la asignación con la operación seleccionada.',
661+
noAssignedVars: 'No hay variables asignadas disponibles',
662+
conversationVars: 'Variables de conversación',
663+
},
637664
}
638665

639666
export default translation

web/i18n/fa-IR/workflow.ts

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -500,6 +500,26 @@ const translation = {
500500
'clear': 'پاک کردن',
501501
'setVariable': 'تنظیم متغیر',
502502
'variable': 'متغیر',
503+
'operations': {
504+
'clear': 'روشن',
505+
'over-write': 'بازنویسی',
506+
'set': 'مجموعه',
507+
'*=': '*=',
508+
'overwrite': 'بازنویسی',
509+
'+=': '+=',
510+
'title': 'عملیات',
511+
'extend': 'گسترش',
512+
'-=': '-=',
513+
'append': 'الحاق',
514+
'/=': '/=',
515+
},
516+
'noVarTip': 'برای افزودن متغیرها روی دکمه "+" کلیک کنید',
517+
'selectAssignedVariable': 'متغیر اختصاص داده شده را انتخاب کنید...',
518+
'noAssignedVars': 'هیچ متغیر اختصاص داده شده در دسترس نیست',
519+
'setParameter': 'پارامتر را تنظیم کنید...',
520+
'assignedVarsDescription': 'متغیرهای اختصاص داده شده باید متغیرهای قابل نوشتن مانند متغیرهای مکالمه باشند.',
521+
'variables': 'متغیرهای',
522+
'varNotSet': 'متغیر NOT Set',
503523
},
504524
tool: {
505525
toAuthorize: 'برای مجوز دادن',
@@ -631,6 +651,13 @@ const translation = {
631651
tracing: {
632652
stopBy: 'متوقف شده توسط {{user}}',
633653
},
654+
variableReference: {
655+
noAvailableVars: 'هیچ متغیری در دسترس نیست',
656+
conversationVars: 'متغیرهای مکالمه',
657+
noVarsForOperation: 'هیچ متغیری برای تخصیص با عملیات انتخاب شده در دسترس نیست.',
658+
assignedVarsDescription: 'متغیرهای اختصاص داده شده باید متغیرهای قابل نوشتن باشند، مانند',
659+
noAssignedVars: 'هیچ متغیر اختصاص داده شده در دسترس نیست',
660+
},
634661
}
635662

636663
export default translation

web/i18n/fr-FR/workflow.ts

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -500,6 +500,26 @@ const translation = {
500500
'clear': 'Effacer',
501501
'setVariable': 'Définir Variable',
502502
'variable': 'Variable',
503+
'operations': {
504+
'clear': 'Clair',
505+
'*=': '*=',
506+
'-=': '-=',
507+
'extend': 'Étendre',
508+
'+=': '+=',
509+
'over-write': 'Écraser',
510+
'set': 'Poser',
511+
'append': 'Ajouter',
512+
'title': 'Opération',
513+
'/=': '/=',
514+
'overwrite': 'Écraser',
515+
},
516+
'assignedVarsDescription': 'Les variables affectées doivent être accessibles en écriture, telles que des variables de conversation.',
517+
'noVarTip': 'Cliquez sur le bouton « + » pour ajouter des variables',
518+
'variables': 'Variables',
519+
'setParameter': 'Définir le paramètre...',
520+
'noAssignedVars': 'Aucune variable affectée disponible',
521+
'varNotSet': 'Variable NON définie',
522+
'selectAssignedVariable': 'Sélectionner la variable affectée...',
503523
},
504524
tool: {
505525
toAuthorize: 'Autoriser',
@@ -631,6 +651,13 @@ const translation = {
631651
tracing: {
632652
stopBy: 'Arrêté par {{user}}',
633653
},
654+
variableReference: {
655+
noAssignedVars: 'Aucune variable affectée disponible',
656+
noVarsForOperation: 'Aucune variable n’est disponible pour l’affectation avec l’opération sélectionnée.',
657+
noAvailableVars: 'Aucune variable disponible',
658+
assignedVarsDescription: 'Les variables affectées doivent être des variables accessibles en écriture, telles que',
659+
conversationVars: 'Variables de conversation',
660+
},
634661
}
635662

636663
export default translation

web/i18n/hi-IN/workflow.ts

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -516,6 +516,26 @@ const translation = {
516516
'clear': 'साफ़ करें',
517517
'setVariable': 'चर सेट करें',
518518
'variable': 'चर',
519+
'operations': {
520+
'clear': 'स्पष्ट',
521+
'/=': '/=',
522+
'*=': '*=',
523+
'over-write': 'अधिलेखित',
524+
'title': 'परिचालन',
525+
'+=': '+=',
526+
'overwrite': 'अधिलेखित',
527+
'set': 'अस्त हो',
528+
'extend': 'पसार',
529+
'-=': '-=',
530+
'append': 'संलग्न',
531+
},
532+
'setParameter': 'पैरामीटर सेट करें...',
533+
'noVarTip': 'चर जोड़ने के लिए "+" बटन पर क्लिक करें',
534+
'variables': 'चर',
535+
'selectAssignedVariable': 'असाइन किए गए चर का चयन करें...',
536+
'varNotSet': 'चर सेट नहीं',
537+
'assignedVarsDescription': 'असाइन किए गए चर लिखने योग्य चर होने चाहिए, जैसे वार्तालाप चर।',
538+
'noAssignedVars': 'कोई उपलब्ध असाइन किए गए चर नहीं',
519539
},
520540
tool: {
521541
toAuthorize: 'अधिकृत करने के लिए',
@@ -651,6 +671,13 @@ const translation = {
651671
tracing: {
652672
stopBy: '{{user}} द्वारा रोका गया',
653673
},
674+
variableReference: {
675+
conversationVars: 'बातचीत चर',
676+
noAvailableVars: 'कोई उपलब्ध चर नहीं',
677+
assignedVarsDescription: 'असाइन किए गए चर लिखने योग्य चर होने चाहिए, जैसे',
678+
noVarsForOperation: 'चयनित कार्रवाई के साथ असाइनमेंट के लिए कोई चर उपलब्ध नहीं हैं.',
679+
noAssignedVars: 'कोई उपलब्ध असाइन किए गए चर नहीं',
680+
},
654681
}
655682

656683
export default translation

web/i18n/it-IT/workflow.ts

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -520,6 +520,26 @@ const translation = {
520520
'clear': 'Cancellare',
521521
'setVariable': 'Imposta Variabile',
522522
'variable': 'Variabile',
523+
'operations': {
524+
'-=': '-=',
525+
'overwrite': 'Sovrascrivere',
526+
'+=': '+=',
527+
'*=': '*=',
528+
'append': 'Aggiungere',
529+
'set': 'Mettere',
530+
'title': 'Operazione',
531+
'/=': '/=',
532+
'over-write': 'Sovrascrivere',
533+
'extend': 'Estendere',
534+
'clear': 'Chiaro',
535+
},
536+
'setParameter': 'Imposta parametro...',
537+
'variables': 'Variabili',
538+
'noAssignedVars': 'Nessuna variabile assegnata disponibile',
539+
'assignedVarsDescription': 'Le variabili assegnate devono essere variabili scrivibili, ad esempio variabili di conversazione.',
540+
'varNotSet': 'Variabile NON impostata',
541+
'selectAssignedVariable': 'Seleziona variabile assegnata...',
542+
'noVarTip': 'Fare clic sul pulsante "+" per aggiungere variabili',
523543
},
524544
tool: {
525545
toAuthorize: 'Per autorizzare',
@@ -658,6 +678,13 @@ const translation = {
658678
tracing: {
659679
stopBy: 'Interrotto da {{user}}',
660680
},
681+
variableReference: {
682+
noAvailableVars: 'Nessuna variabile disponibile',
683+
noAssignedVars: 'Nessuna variabile assegnata disponibile',
684+
noVarsForOperation: 'Non ci sono variabili disponibili per l\'assegnazione con l\'operazione selezionata.',
685+
assignedVarsDescription: 'Le variabili assegnate devono essere variabili scrivibili, ad esempio',
686+
conversationVars: 'Variabili di conversazione',
687+
},
661688
}
662689

663690
export default translation

web/i18n/ja-JP/workflow.ts

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -501,6 +501,26 @@ const translation = {
501501
'clear': 'クリア',
502502
'setVariable': '変数を設定する',
503503
'variable': '変数',
504+
'operations': {
505+
'title': '操作',
506+
'set': 'セット',
507+
'clear': 'クリア',
508+
'overwrite': '上書き',
509+
'append': '追加',
510+
'-=': '-=',
511+
'/=': '/=',
512+
'+=': '+=',
513+
'over-write': '上書き',
514+
'extend': '延ばす',
515+
'*=': '*=',
516+
},
517+
'setParameter': 'パラメータを設定...',
518+
'selectAssignedVariable': '代入変数を選択...',
519+
'varNotSet': '変数が設定されていません',
520+
'variables': '変数',
521+
'noVarTip': '「+」ボタンをクリックして変数を追加します',
522+
'noAssignedVars': '使用可能な代入変数がありません',
523+
'assignedVarsDescription': '代入される変数は、会話変数などの書き込み可能な変数である必要があります。',
504524
},
505525
tool: {
506526
toAuthorize: '承認するには',
@@ -632,6 +652,13 @@ const translation = {
632652
tracing: {
633653
stopBy: '{{user}}によって停止',
634654
},
655+
variableReference: {
656+
noVarsForOperation: '選択した操作で代入できる変数はありません。',
657+
noAvailableVars: '使用可能な変数がありません',
658+
noAssignedVars: '使用可能な代入変数がありません',
659+
assignedVarsDescription: '代入変数は、次のような書き込み可能な変数である必要があります。',
660+
conversationVars: '会話変数',
661+
},
635662
}
636663

637664
export default translation

web/i18n/ko-KR/workflow.ts

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -500,6 +500,26 @@ const translation = {
500500
'clear': '지우기',
501501
'setVariable': '변수 설정',
502502
'variable': '변수',
503+
'operations': {
504+
'*=': '*=',
505+
'overwrite': '덮어쓸',
506+
'-=': '-=',
507+
'append': '덧붙이다',
508+
'over-write': '덮어쓸',
509+
'+=': '+=',
510+
'title': '수술',
511+
'extend': '뻗치다',
512+
'clear': '맑다',
513+
'/=': '/=',
514+
'set': '집합',
515+
},
516+
'variables': '변수',
517+
'noAssignedVars': '사용 가능한 할당된 변수가 없습니다.',
518+
'noVarTip': '"+" 버튼을 클릭하여 변수를 추가합니다.',
519+
'setParameter': '매개 변수 설정...',
520+
'assignedVarsDescription': '할당된 변수는 대화 변수와 같은 쓰기 가능한 변수여야 합니다.',
521+
'selectAssignedVariable': '할당된 변수 선택...',
522+
'varNotSet': '변수가 설정되지 않음',
503523
},
504524
tool: {
505525
toAuthorize: '승인하기',
@@ -631,6 +651,13 @@ const translation = {
631651
tracing: {
632652
stopBy: '{{user}}에 의해 중지됨',
633653
},
654+
variableReference: {
655+
noAvailableVars: '사용 가능한 변수 없음',
656+
conversationVars: '대화 변수',
657+
noVarsForOperation: '선택한 작업에 할당할 수 있는 변수가 없습니다.',
658+
noAssignedVars: '사용 가능한 할당된 변수가 없습니다.',
659+
assignedVarsDescription: '할당된 변수는 다음과 같이 쓰기 가능한 변수여야 합니다.',
660+
},
634661
}
635662

636663
export default translation

web/i18n/pl-PL/workflow.ts

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -500,6 +500,26 @@ const translation = {
500500
'clear': 'Wyczyść',
501501
'setVariable': 'Ustaw Zmienną',
502502
'variable': 'Zmienna',
503+
'operations': {
504+
'over-write': 'Zastąpić',
505+
'set': 'Zbiór',
506+
'title': 'Operacja',
507+
'overwrite': 'Zastąpić',
508+
'*=': '*=',
509+
'/=': '/=',
510+
'-=': '-=',
511+
'extend': 'Rozszerzyć',
512+
'+=': '+=',
513+
'clear': 'Jasny',
514+
'append': 'Dołączyć',
515+
},
516+
'variables': 'Zmiennych',
517+
'selectAssignedVariable': 'Wybierz przypisaną zmienną...',
518+
'varNotSet': 'Zmienna NIE jest ustawiona',
519+
'noAssignedVars': 'Brak dostępnych przypisanych zmiennych',
520+
'assignedVarsDescription': 'Przypisane zmienne muszą być zmiennymi zapisywalnymi, takimi jak zmienne konwersacji.',
521+
'setParameter': 'Ustaw parametr...',
522+
'noVarTip': 'Kliknij przycisk "+", aby dodać zmienne',
503523
},
504524
tool: {
505525
toAuthorize: 'Do autoryzacji',
@@ -631,6 +651,13 @@ const translation = {
631651
tracing: {
632652
stopBy: 'Zatrzymane przez {{user}}',
633653
},
654+
variableReference: {
655+
conversationVars: 'Zmienne konwersacji',
656+
assignedVarsDescription: 'Przypisane zmienne muszą być zmiennymi zapisywalnymi, takimi jak',
657+
noVarsForOperation: 'Nie ma dostępnych zmiennych do przypisania do wybranej operacji.',
658+
noAssignedVars: 'Brak dostępnych przypisanych zmiennych',
659+
noAvailableVars: 'Brak dostępnych zmiennych',
660+
},
634661
}
635662

636663
export default translation

0 commit comments

Comments
 (0)