Skip to content

Commit 7953b6e

Browse files
committed
Refactor missing configuration notices to use common translation and group slots
- the placement of [Fragment] is incorrect. should follow this group [Image] - move 'missing configuration' to common
1 parent e5183a1 commit 7953b6e

5 files changed

Lines changed: 27 additions & 43 deletions

File tree

‎apps/editor/src/views/settings/frontend/Home/sections/ApiConfigurationsSection.tsx‎

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -133,9 +133,7 @@ export const ApiConfigurationsSection = forwardRef<HTMLDivElement, Props>(
133133
title={t('api-calls.configurations.title')}
134134
notice_slot={
135135
!props.api_configurations.length ? (
136-
<UiNotice type="warning">
137-
{t('api-calls.configurations.notice.missing')}
138-
</UiNotice>
136+
<UiNotice type="warning">{t('common.notice.missing')}</UiNotice>
139137
) : null
140138
}
141139
>

‎apps/editor/src/views/settings/frontend/Home/sections/WebConfigurationsSection.tsx‎

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -113,9 +113,6 @@ export const WebConfigurationsSection = forwardRef<HTMLDivElement, Props>(
113113
>
114114
<div style={{ display: 'flex', flexDirection: 'column', gap: 8 }}>
115115
<UiNotice type="info">{t('chatbots.notice')}</UiNotice>
116-
{props.web_configurations.length == 0 && (
117-
<UiNotice type="warning">{t('chatbots.notice.missing')}</UiNotice>
118-
)}
119116
</div>
120117
<div
121118
ref={(el) =>
@@ -125,7 +122,14 @@ export const WebConfigurationsSection = forwardRef<HTMLDivElement, Props>(
125122
)
126123
}
127124
>
128-
<UiGroup title={t('chatbots.configurations.title')}>
125+
<UiGroup
126+
title={t('chatbots.configurations.title')}
127+
notice_slot={
128+
!props.web_configurations.length ? (
129+
<UiNotice type="warning">{t('common.notice.missing')}</UiNotice>
130+
) : null
131+
}
132+
>
129133
{props.web_configurations && (
130134
<SortableList
131135
items={props.web_configurations.map((c, index) => ({

‎apps/editor/src/views/settings/frontend/i18n/translations/api-calls.ts‎

Lines changed: 0 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -217,24 +217,6 @@ export const translations = {
217217
hu: 'Küldjön promptokat a szerkesztőből.',
218218
bg: 'Изпращайте промптове от самия редактор.'
219219
},
220-
'api-calls.configurations.notice.missing': {
221-
en: 'Missing configuration.',
222-
pl: 'Brak konfiguracji.',
223-
'zh-cn': '缺少配置。',
224-
ja: '設定が不足しています。',
225-
'zh-tw': '缺少設定。',
226-
de: 'Fehlende Konfiguration.',
227-
es: 'Configuración faltante.',
228-
fr: 'Configuration manquante.',
229-
'pt-br': 'Configuração ausente.',
230-
ru: 'Отсутствует конфигурация.',
231-
ko: '구성이 누락되었습니다.',
232-
it: 'Configurazione mancante.',
233-
tr: 'Eksik yapılandırma.',
234-
cs: 'Chybějící konfigurace.',
235-
hu: 'Hiányzó konfiguráció.',
236-
bg: 'Липсваща конфигурация.'
237-
},
238220
'api-calls.configurations.action.insert': {
239221
en: 'Insert a new configuration below/above',
240222
pl: 'Wstaw nową konfigurację poniżej/powyżej',

‎apps/editor/src/views/settings/frontend/i18n/translations/chatbots.ts‎

Lines changed: 0 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -72,24 +72,6 @@ export const translations = {
7272
hu: 'A böngészővel való kommunikáció helyi WebSocketeket használ.',
7373
bg: 'Комуникацията с браузъра използва локални WebSocket.'
7474
},
75-
'chatbots.notice.missing': {
76-
en: 'No web configurations have been added yet.',
77-
pl: 'Nie dodano jeszcze żadnych konfiguracji webowych.',
78-
'zh-cn': '尚未添加网络配置。',
79-
ja: 'Web 設定はまだ追加されていません。',
80-
'zh-tw': '尚未新增網路設定。',
81-
de: 'Es wurden noch keine Webkonfigurationen hinzugefügt.',
82-
es: 'Aún no se han añadido configuraciones web.',
83-
fr: 'Aucune configuration web n’a encore été ajoutée.',
84-
'pt-br': 'Nenhuma configuração web foi adicionada ainda.',
85-
ru: 'Веб-конфигурации пока не добавлены.',
86-
ko: '아직 웹 구성을 추가하지 않았습니다.',
87-
it: 'Nessuna configurazione web è stata ancora aggiunta.',
88-
tr: 'Henüz hiçbir web yapılandırması eklenmedi.',
89-
cs: 'Zatím nebyly přidány žádné webové konfigurace.',
90-
hu: 'Még nincsenek hozzáadva webes konfigurációk.',
91-
bg: 'Все още няма добавени уеб конфигурации.'
92-
},
9375
'chatbots.action.insert': {
9476
en: 'Insert a new configuration below/above',
9577
pl: 'Wstaw nową konfigurację poniżej/powyżej',

‎apps/editor/src/views/settings/frontend/i18n/translations/common.ts‎

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,5 +34,23 @@ export const translations = {
3434
cs: 'Sbalit',
3535
hu: 'Összecsukás',
3636
bg: 'Свиване'
37+
},
38+
'common.notice.missing': {
39+
en: 'Missing configuration.',
40+
pl: 'Brak konfiguracji.',
41+
'zh-cn': '缺少配置。',
42+
ja: '設定が不足しています。',
43+
'zh-tw': '缺少設定。',
44+
de: 'Fehlende Konfiguration.',
45+
es: 'Configuración faltante.',
46+
fr: 'Configuration manquante.',
47+
'pt-br': 'Configuração ausente.',
48+
ru: 'Отсутствует конфигурация.',
49+
ko: '구성이 누락되었습니다.',
50+
it: 'Configurazione mancante.',
51+
tr: 'Eksik yapılandırma.',
52+
cs: 'Chybějící konfigurace.',
53+
hu: 'Hiányzó konfiguráció.',
54+
bg: 'Липсваща конфигурация.'
3755
}
3856
} as const

0 commit comments

Comments
 (0)