Skip to content

Commit 59c5a1f

Browse files
committed
Add i18n translations for model provider and configuration actions in settings UI
1 parent f509e4b commit 59c5a1f

8 files changed

Lines changed: 326 additions & 14 deletions

File tree

‎apps/editor/src/views/i18n/settings.ts‎

Lines changed: 234 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -197,6 +197,240 @@ export const settings = {
197197
hu: 'Új Hozzáadása',
198198
bg: 'Добавяне на нов'
199199
},
200+
'settings.action.insert-provider': {
201+
en: 'Insert a new provider below/above',
202+
pl: 'Wstaw nowego dostawcę poniżej/powyżej',
203+
'zh-cn': '在下方/上方插入新提供商',
204+
ja: '下/上に新しいプロバイダーを挿入',
205+
'zh-tw': '在下方/上方插入新供應商',
206+
de: 'Neuen Anbieter darunter/darüber einfügen',
207+
es: 'Insertar un nuevo proveedor debajo/arriba',
208+
fr: 'Insérer un nouveau fournisseur en dessous/au-dessus',
209+
'pt-br': 'Inserir um novo provedor abaixo/acima',
210+
ru: 'Вставить нового провайдера ниже/выше',
211+
ko: '아래/위에 새 제공자 삽입',
212+
it: 'Inserisci un nuovo fornitore sotto/sopra',
213+
tr: 'Aşağıya/yukarıya yeni bir sağlayıcı ekle',
214+
cs: 'Vložit nového poskytovatele pod/nad',
215+
hu: 'Új szolgáltató beszúrása alá/fölé',
216+
bg: 'Вмъкване на нов доставчик отдолу/отгоре'
217+
},
218+
'settings.action.edit-provider': {
219+
en: 'Edit provider',
220+
pl: 'Edytuj dostawcę',
221+
'zh-cn': '编辑提供商',
222+
ja: 'プロバイダーを編集',
223+
'zh-tw': '編輯供應商',
224+
de: 'Anbieter bearbeiten',
225+
es: 'Editar proveedor',
226+
fr: 'Modifier le fournisseur',
227+
'pt-br': 'Editar provedor',
228+
ru: 'Редактировать провайдера',
229+
ko: '제공자 편집',
230+
it: 'Modifica fornitore',
231+
tr: 'Sağlayıcıyı düzenle',
232+
cs: 'Upravit poskytovatele',
233+
hu: 'Szolgáltató szerkesztése',
234+
bg: 'Редактиране на доставчик'
235+
},
236+
'settings.action.change-api-key': {
237+
en: 'Change API key',
238+
pl: 'Zmień klucz API',
239+
'zh-cn': '更改 API 密钥',
240+
ja: 'APIキーを変更',
241+
'zh-tw': '更改 API 金鑰',
242+
de: 'API-Schlüssel ändern',
243+
es: 'Cambiar clave API',
244+
fr: 'Changer la clé API',
245+
'pt-br': 'Alterar chave da API',
246+
ru: 'Изменить API ключ',
247+
ko: 'API 키 변경',
248+
it: 'Cambia chiave API',
249+
tr: 'API anahtarını değiştir',
250+
cs: 'Změnit API klíč',
251+
hu: 'API kulcs módosítása',
252+
bg: 'Промяна на API ключ'
253+
},
254+
'settings.action.delete-provider': {
255+
en: 'Delete provider',
256+
pl: 'Usuń dostawcę',
257+
'zh-cn': '删除提供商',
258+
ja: 'プロバイダーを削除',
259+
'zh-tw': '刪除供應商',
260+
de: 'Anbieter löschen',
261+
es: 'Eliminar proveedor',
262+
fr: 'Supprimer le fournisseur',
263+
'pt-br': 'Excluir provedor',
264+
ru: 'Удалить провайдера',
265+
ko: '제공자 삭제',
266+
it: 'Elimina fornitore',
267+
tr: 'Sağlayıcıyı sil',
268+
cs: 'Smazat poskytovatele',
269+
hu: 'Szolgáltató törlése',
270+
bg: 'Изтриване на доставчик'
271+
},
272+
'settings.action.model-provider': {
273+
en: 'model provider',
274+
pl: 'dostawca modelu',
275+
'zh-cn': '模型提供商',
276+
ja: 'モデルプロバイダー',
277+
'zh-tw': '模型供應商',
278+
de: 'Modellanbieter',
279+
es: 'proveedor de modelos',
280+
fr: 'fournisseur de modèles',
281+
'pt-br': 'provedor de modelos',
282+
ru: 'провайдер модели',
283+
ko: '모델 제공자',
284+
it: 'fornitore di modelli',
285+
tr: 'model sağlayıcı',
286+
cs: 'poskytovatel modelu',
287+
hu: 'modell szolgáltató',
288+
bg: 'доставчик на модели'
289+
},
290+
'settings.action.model-providers': {
291+
en: 'model providers',
292+
pl: 'dostawców modelu',
293+
'zh-cn': '模型提供商',
294+
ja: 'モデルプロバイダー',
295+
'zh-tw': '模型供應商',
296+
de: 'Modellanbieter',
297+
es: 'proveedores de modelos',
298+
fr: 'fournisseurs de modèles',
299+
'pt-br': 'provedores de modelos',
300+
ru: 'провайдеры модели',
301+
ko: '모델 제공자',
302+
it: 'fornitori di modelli',
303+
tr: 'model sağlayıcılar',
304+
cs: 'poskytovatelé modelu',
305+
hu: 'modell szolgáltatók',
306+
bg: 'доставчици на модели'
307+
},
308+
'settings.action.insert-configuration': {
309+
en: 'Insert a new configuration below/above',
310+
pl: 'Wstaw nową konfigurację poniżej/powyżej',
311+
'zh-cn': '在下方/上方插入新配置',
312+
ja: '下/上に新しい設定を挿入',
313+
'zh-tw': '在下方/上方插入新設定',
314+
de: 'Neue Konfiguration darunter/darüber einfügen',
315+
es: 'Insertar una nueva configuración debajo/arriba',
316+
fr: 'Insérer une nouvelle configuration en dessous/au-dessus',
317+
'pt-br': 'Inserir uma nova configuração abaixo/acima',
318+
ru: 'Вставить новую конфигурацию ниже/выше',
319+
ko: '아래/위에 새 구성 삽입',
320+
it: 'Inserisci una nuova configurazione sotto/sopra',
321+
tr: 'Aşağıya/yukarıya yeni bir yapılandırma ekle',
322+
cs: 'Vložit novou konfiguraci pod/nad',
323+
hu: 'Új konfiguráció beszúrása alá/fölé',
324+
bg: 'Вмъкване на нова конфигурация отдолу/отгоре'
325+
},
326+
'settings.action.edit-configuration': {
327+
en: 'Edit configuration',
328+
pl: 'Edytuj konfigurację',
329+
'zh-cn': '编辑配置',
330+
ja: '設定を編集',
331+
'zh-tw': '編輯設定',
332+
de: 'Konfiguration bearbeiten',
333+
es: 'Editar configuración',
334+
fr: 'Modifier la configuration',
335+
'pt-br': 'Editar configuração',
336+
ru: 'Редактировать конфигурацию',
337+
ko: '구성 편집',
338+
it: 'Modifica configurazione',
339+
tr: 'Yapılandırmayı düzenle',
340+
cs: 'Upravit konfiguraci',
341+
hu: 'Konfiguráció szerkesztése',
342+
bg: 'Редактиране на конфигурация'
343+
},
344+
'settings.action.delete-configuration': {
345+
en: 'Delete configuration',
346+
pl: 'Usuń konfigurację',
347+
'zh-cn': '删除配置',
348+
ja: '設定を削除',
349+
'zh-tw': '刪除設定',
350+
de: 'Konfiguration löschen',
351+
es: 'Eliminar configuración',
352+
fr: 'Supprimer la configuration',
353+
'pt-br': 'Excluir configuração',
354+
ru: 'Удалить конфигурацию',
355+
ko: '구성 삭제',
356+
it: 'Elimina configurazione',
357+
tr: 'Yapılandırmayı sil',
358+
cs: 'Smazat konfiguraci',
359+
hu: 'Konfiguráció törlése',
360+
bg: 'Изтриване на конфигурация'
361+
},
362+
'settings.action.set-default': {
363+
en: 'Set as default',
364+
pl: 'Ustaw jako domyślne',
365+
'zh-cn': '设为默认',
366+
ja: 'デフォルトに設定',
367+
'zh-tw': '設為預設',
368+
de: 'Als Standard festlegen',
369+
es: 'Establecer como predeterminado',
370+
fr: 'Définir par défaut',
371+
'pt-br': 'Definir como padrão',
372+
ru: 'Установить по умолчанию',
373+
ko: '기본값으로 설정',
374+
it: 'Imposta come predefinito',
375+
tr: 'Varsayılan olarak ayarla',
376+
cs: 'Nastavit jako výchozí',
377+
hu: 'Beállítás alapértelmezettként',
378+
bg: 'Задаване по подразбиране'
379+
},
380+
'settings.action.unset-default': {
381+
en: 'Unset default',
382+
pl: 'Usuń domyślne',
383+
'zh-cn': '取消默认设置',
384+
ja: 'デフォルトを解除',
385+
'zh-tw': '取消預設設定',
386+
de: 'Standard aufheben',
387+
es: 'Quitar predeterminado',
388+
fr: 'Annuler par défaut',
389+
'pt-br': 'Remover padrão',
390+
ru: 'Снять по умолчанию',
391+
ko: '기본값 해제',
392+
it: 'Rimuovi predefinito',
393+
tr: 'Varsayılanı kaldır',
394+
cs: 'Zrušit výchozí',
395+
hu: 'Alapértelmezés törlése',
396+
bg: 'Премахване на по подразбиране'
397+
},
398+
'settings.action.configuration': {
399+
en: 'configuration',
400+
pl: 'konfiguracja',
401+
'zh-cn': '配置',
402+
ja: '設定',
403+
'zh-tw': '設定',
404+
de: 'Konfiguration',
405+
es: 'configuración',
406+
fr: 'configuration',
407+
'pt-br': 'configuração',
408+
ru: 'конфигурация',
409+
ko: '구성',
410+
it: 'configurazione',
411+
tr: 'yapılandırma',
412+
cs: 'konfigurace',
413+
hu: 'konfiguráció',
414+
bg: 'конфигурация'
415+
},
416+
'settings.action.configurations': {
417+
en: 'configurations',
418+
pl: 'konfiguracje',
419+
'zh-cn': '配置',
420+
ja: '設定',
421+
'zh-tw': '設定',
422+
de: 'Konfigurationen',
423+
es: 'configuraciones',
424+
fr: 'configurations',
425+
'pt-br': 'configurações',
426+
ru: 'конфигурации',
427+
ko: '구성',
428+
it: 'configurazioni',
429+
tr: 'yapılandırmalar',
430+
cs: 'konfigurace',
431+
hu: 'konfigurációk',
432+
bg: 'конфигурации'
433+
},
200434
'settings.message.missing-configuration': {
201435
en: 'Missing configuration.',
202436
pl: 'Brak konfiguracji.',

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

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -104,7 +104,6 @@ type Props = {
104104
edit_format_instructions: EditFormatInstructions
105105
clear_checks_in_workspace_behavior: 'ignore-open-editors' | 'uncheck-all'
106106
fix_all_automatically: boolean
107-
108107
set_providers: (providers: ProviderForClient[]) => void
109108
set_edit_context_configs: (configs: ConfigurationForClient[]) => void
110109
set_code_at_cursor_configs: (configs: ConfigurationForClient[]) => void

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

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
import { ConfigurationForClient } from '@/views/settings/types/messages'
22
import { ConfigurationsList as UiConfigurationsList } from '@ui/components/editor/settings/ConfigurationsList'
3+
import { use_translation } from '@/views/i18n/use-translation'
34

45
type ToolName =
56
| 'CODE_AT_CURSOR'
@@ -29,11 +30,22 @@ export const ApiToolConfigurationSection: React.FC<
2930
ToolConfigurationsSectionProps
3031
> = (props) => {
3132
const { configurations, set_configurations } = props
33+
const { t } = use_translation()
3234

3335
return (
3436
<>
3537
{configurations && (
3638
<UiConfigurationsList
39+
translations={{
40+
add_title: t('settings.action.add-new'),
41+
insert_title: t('settings.action.insert-configuration'),
42+
edit_title: t('settings.action.edit-configuration'),
43+
delete_title: t('settings.action.delete-configuration'),
44+
set_default_title: t('settings.action.set-default'),
45+
unset_default_text: t('settings.action.unset-default'),
46+
configuration_text: t('settings.action.configuration'),
47+
configurations_text: t('settings.action.configurations')
48+
}}
3749
configurations={configurations}
3850
on_add={props.on_add}
3951
on_reorder={(reordered) => {

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

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
import { ProviderForClient } from '@/views/settings/types/messages'
22
import { ModelProviders as UiModelProviders } from '@ui/components/editor/settings/ModelProviders'
3+
import { use_translation } from '@/views/i18n/use-translation'
34

45
type ModelProvidersSectionProps = {
56
providers: ProviderForClient[] | undefined
@@ -15,10 +16,21 @@ type ModelProvidersSectionProps = {
1516
export const ModelProvidersSection: React.FC<ModelProvidersSectionProps> = (
1617
props
1718
) => {
19+
const { t } = use_translation()
20+
1821
return (
1922
<>
2023
{props.providers && (
2124
<UiModelProviders
25+
translations={{
26+
add_title: t('settings.action.add-new'),
27+
insert_title: t('settings.action.insert-provider'),
28+
edit_title: t('settings.action.edit-provider'),
29+
change_api_key_title: t('settings.action.change-api-key'),
30+
delete_title: t('settings.action.delete-provider'),
31+
provider_text: t('settings.action.model-provider'),
32+
providers_text: t('settings.action.model-providers')
33+
}}
2234
providers={props.providers}
2335
on_reorder={props.on_reorder}
2436
on_add_provider={props.on_add_provider}

‎packages/ui/src/components/editor/settings/ConfigurationsList/ConfigurationsList.stories.tsx‎

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,17 @@ const initial_configurations: ConfigurationsList.Configuration[] = [
2424
}
2525
]
2626

27+
const translations = {
28+
add_title: 'Add New',
29+
insert_title: 'Insert...',
30+
edit_title: 'Edit',
31+
delete_title: 'Delete',
32+
set_default_title: 'Set Default',
33+
unset_default_text: 'Unset',
34+
configuration_text: 'config',
35+
configurations_text: 'configs'
36+
}
37+
2738
const log_action =
2839
(action: string) =>
2940
(...args: any[]) => {
@@ -71,6 +82,7 @@ export const Default = () => {
7182
on_add={log_action('on_add')}
7283
on_set_default={handle_set_default}
7384
on_unset_default={handle_unset_default}
85+
translations={translations}
7486
/>
7587
</div>
7688
)
@@ -97,6 +109,7 @@ export const NoDefaultOption = () => {
97109
on_edit={log_action('on_edit')}
98110
on_delete={log_action('on_delete')}
99111
on_add={log_action('on_add')}
112+
translations={translations}
100113
/>
101114
</div>
102115
)
@@ -118,6 +131,7 @@ export const Empty = () => {
118131
on_add={log_action('on_add')}
119132
on_set_default={log_action('on_set_default')}
120133
on_unset_default={log_action('on_unset_default')}
134+
translations={translations}
121135
/>
122136
</div>
123137
)

0 commit comments

Comments
 (0)