Skip to content

Commit a88e836

Browse files
committed
Refactor section translation keys and update settings UI styles for consistent grouping and visual layout
- move 'context size warning threshold' into 'prompt field' sub group - add missing translations to [Fragment] - rename 'configurations' to 'api configurations' (translations and translation key) - rename sidebar to sections - add missing translations to [Fragment] - don't use 'wywołań', prefer 'zapytań'
1 parent 8c70eee commit a88e836

10 files changed

Lines changed: 89 additions & 92 deletions

File tree

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

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ type NavConfigItem = { id: NavItem; label: TranslationKey; is_nested?: boolean }
4343
const NAV_ITEMS_CONFIG: NavConfigItem[] = [
4444
{
4545
id: 'general',
46-
label: 'sidebar.general'
46+
label: 'sections.general'
4747
},
4848
{
4949
id: 'prompt-field',
@@ -67,11 +67,11 @@ const NAV_ITEMS_CONFIG: NavConfigItem[] = [
6767
},
6868
{
6969
id: 'model-providers',
70-
label: 'sidebar.model-providers'
70+
label: 'sections.model-providers'
7171
},
7272
{
7373
id: 'configurations',
74-
label: 'sidebar.configurations'
74+
label: 'sections.api-configurations'
7575
},
7676
{
7777
id: 'defaults',
@@ -281,7 +281,7 @@ export const Home: React.FC<Props> = (props) => {
281281
<div style={{ height: '100vh' }}>
282282
<UiLayout
283283
ref={scroll_container_ref}
284-
title={t('sidebar.settings')}
284+
title={t('sections.settings')}
285285
sidebar={NAV_ITEMS_CONFIG.map((item, i) => {
286286

287287
return (

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ export const ConfigurationsSection = forwardRef<HTMLDivElement, Props>(
4949
return (
5050
<UiSection
5151
ref={ref}
52-
title={t('sidebar.configurations')}
52+
title={t('sections.api-configurations')}
5353
subtitle={t('configurations.subtitle')}
5454
actions={
5555
<UiButton on_click={() => props.on_add_api_configuration()}>

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

Lines changed: 20 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -198,7 +198,7 @@ export const GeneralSection = forwardRef<HTMLDivElement, Props>(
198198
return (
199199
<UiSection
200200
ref={ref}
201-
title={t('sidebar.general')}
201+
title={t('sections.general')}
202202
subtitle={t('general.subtitle')}
203203
>
204204
<UiGroup>
@@ -240,25 +240,6 @@ export const GeneralSection = forwardRef<HTMLDivElement, Props>(
240240
</UiTextButton>
241241
}
242242
/>
243-
<UiItem
244-
title={t('general.context-size-warning-threshold.title')}
245-
description={t(
246-
'general.context-size-warning-threshold.description'
247-
)}
248-
slot_right={
249-
<UiInput
250-
type="number"
251-
value={context_size_warning_threshold?.toString() ?? ''}
252-
on_change={(val) =>
253-
set_context_size_warning_threshold(
254-
val == '' ? undefined : parseInt(val, 10)
255-
)
256-
}
257-
on_blur={handle_context_size_warning_threshold_blur}
258-
max_width={100}
259-
/>
260-
}
261-
/>
262243
<UiItem
263244
title={t('general.check-new-files.title')}
264245
description={t('general.check-new-files.description')}
@@ -317,6 +298,25 @@ export const GeneralSection = forwardRef<HTMLDivElement, Props>(
317298

318299
<div ref={(el) => props.set_section_ref('prompt-field', el)}>
319300
<UiGroup title={t('general.prompt-field.title')}>
301+
<UiItem
302+
title={t('general.context-size-warning-threshold.title')}
303+
description={t(
304+
'general.context-size-warning-threshold.description'
305+
)}
306+
slot_right={
307+
<UiInput
308+
type="number"
309+
value={context_size_warning_threshold?.toString() ?? ''}
310+
on_change={(val) =>
311+
set_context_size_warning_threshold(
312+
val == '' ? undefined : parseInt(val, 10)
313+
)
314+
}
315+
on_blur={handle_context_size_warning_threshold_blur}
316+
max_width={100}
317+
/>
318+
}
319+
/>
320320
<UiItem
321321
title={t('general.send-with-shift-enter.title')}
322322
description={t('general.send-with-shift-enter.description')}

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

Lines changed: 19 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -1,25 +1,25 @@
11
export const configurations = {
22
'configurations.subtitle': {
3-
en: 'Manage your API configurations.',
4-
pl: 'Zarządzaj swoimi konfiguracjami API.',
5-
'zh-cn': '管理您的 API 配置。',
6-
ja: 'API 設定を管理します。',
7-
'zh-tw': '管理您的 API 設定。',
8-
de: 'Ihre API-Konfigurationen verwalten.',
9-
es: 'Gestionar sus configuraciones de API.',
10-
fr: 'Gérer vos configurations API.',
11-
'pt-br': 'Gerenciar suas configurações de API.',
12-
ru: 'Управление вашими конфигурациями API.',
13-
ko: 'API 구성을 관리합니다.',
14-
it: 'Gestisci le tue configurazioni API.',
15-
tr: 'API yapılandırmalarınızı yönetin.',
16-
cs: 'Správa vašich konfigurací API.',
17-
hu: 'API konfigurációk kezelése.',
18-
bg: 'Управление на вашите API конфигурации.'
3+
en: 'Manage configurations used for API calls.',
4+
pl: 'Zarządzaj konfiguracjami używanymi do zapytań API.',
5+
'zh-cn': '管理用于 API 调用的配置。',
6+
ja: 'API 呼び出しに使用する設定を管理します。',
7+
'zh-tw': '管理用於 API 呼叫的設定。',
8+
de: 'Verwalten Sie die für API-Aufrufe verwendeten Konfigurationen.',
9+
es: 'Gestionar las configuraciones utilizadas para las llamadas a la API.',
10+
fr: 'Gérer les configurations utilisées pour les appels API.',
11+
'pt-br': 'Gerenciar as configurações usadas para chamadas de API.',
12+
ru: 'Управление конфигурациями, используемыми для вызовов API.',
13+
ko: 'API 호출에 사용되는 구성을 관리합니다.',
14+
it: 'Gestisci le configurazioni utilizzate per le chiamate API.',
15+
tr: 'API çağrıları için kullanılan yapılandırmaları yönetin.',
16+
cs: 'Správa konfigurací používaných pro volání API.',
17+
hu: 'Az API hívásokhoz használt konfigurációk kezelése.',
18+
bg: 'Управление на конфигурациите, използвани за API извиквания.'
1919
},
2020
'configurations.notice': {
2121
en: 'Configurations define the provider, model and parameters for API calls.',
22-
pl: 'Konfiguracje określają dostawcę, model i parametry dla wywołań API.',
22+
pl: 'Konfiguracje określają dostawcę, model i parametry dla zapytań API.',
2323
'zh-cn': '配置定义了 API 调用的提供商、模型和参数。',
2424
ja: '設定では、API 呼び出しのプロバイダー、モデル、パラメーターを定義します。',
2525
'zh-tw': '設定定義了 API 呼叫的供應商、模型和參數。',
@@ -344,7 +344,7 @@ export const configurations = {
344344
},
345345
'configurations.edit-context-system-instructions.description': {
346346
en: 'Tone and style instructions for the model when using the Edit Context prompt type with API calls.',
347-
pl: 'Instrukcje dotyczące tonu i stylu dla modelu przy użyciu typu promptu Edycji Kontekstu z wywołaniami API.',
347+
pl: 'Instrukcje dotyczące tonu i stylu dla modelu przy użyciu typu promptu Edycji Kontekstu z zapytaniami API.',
348348
'zh-cn': '使用编辑上下文提示类型进行 API 调用时,模型的语气和样式说明。',
349349
ja: 'API 呼び出しでコンテキスト編集プロンプトタイプを使用する際のモデルのトーンとスタイルの指示。',
350350
'zh-tw': '使用編輯上下文提示類型進行 API 呼叫時,模型的語氣和樣式說明。',
@@ -436,4 +436,4 @@ export const configurations = {
436436
hu: 'Hogyan dolgozza fel a modell a hangfelvételt.',
437437
bg: 'Как моделът трябва да обработва аудио записа.'
438438
}
439-
} as const
439+
} as const

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

Lines changed: 16 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -937,21 +937,21 @@ export const general = {
937937
bg: 'Натисни за говорене'
938938
},
939939
'general.voice-input.push-to-talk.description': {
940-
en: 'Hold spacebar to talk when using voice input.',
941-
pl: 'Przytrzymaj spację, aby mówić podczas wprowadzania głosowego.',
942-
'zh-cn': '使用语音输入时按住空格键说话。',
943-
ja: '音声入力を使用する際にスペースキーを押し続けて話します。',
944-
'zh-tw': '使用語音輸入時按住空白鍵說話。',
945-
de: 'Halten Sie die Leertaste gedrückt, um bei der Spracheingabe zu sprechen.',
946-
es: 'Mantén presionada la barra espaciadora para hablar al usar la entrada de voz.',
947-
fr: "Maintenez la barre d'espace pour parler lors de l'utilisation de la saisie vocale.",
948-
'pt-br': 'Segure a barra de espaço para falar ao usar a entrada de voz.',
949-
ru: 'Удерживайте пробел, чтобы говорить при использовании голосового ввода.',
950-
ko: '음성 입력을 사용할 때 스페이스바를 길게 눌러 말하세요.',
951-
it: "Tieni premuta la barra spaziatrice per parlare quando usi l'input vocale.",
952-
tr: 'Ses girişini kullanırken konuşmak için boşluk tuşunu basılı tutun.',
953-
cs: 'Při používání hlasového vstupu podržte mezerník pro mluvení.',
954-
hu: 'Hangbemenet használatakor beszédhez tartsa lenyomva a szóközt.',
955-
bg: 'Задръжте интервал, за да говорите при гласово въвеждане.'
940+
en: 'Hold spacebar to activate voice input.',
941+
pl: 'Przytrzymaj spację, aby aktywować wprowadzanie głosowe.',
942+
'zh-cn': '按住空格键激活语音输入。',
943+
ja: 'スペースキーを押し続けて音声入力を有効にします。',
944+
'zh-tw': '按住空白鍵啟用語音輸入。',
945+
de: 'Halten Sie die Leertaste gedrückt, um die Spracheingabe zu aktivieren.',
946+
es: 'Mantén presionada la barra espaciadora para activar la entrada de voz.',
947+
fr: "Maintenez la barre d'espace pour activer la saisie vocale.",
948+
'pt-br': 'Mantenha a barra de espaço pressionada para ativar a entrada de voz.',
949+
ru: 'Удерживайте пробел, чтобы активировать голосовой ввод.',
950+
ko: '스페이스바를 길게 눌러 음성 입력을 활성화하세요.',
951+
it: "Tieni premuta la barra spaziatrice per attivare l'inserimento vocale.",
952+
tr: 'Sesle girişi etkinleştirmek için boşluk tuşuna basılı tutun.',
953+
cs: 'Podržením mezerníku aktivujete hlasový vstup.',
954+
hu: 'Tartsa lenyomva a szóköz billentyűt a hangbemenet aktiválásához.',
955+
bg: 'Задръжте интервала, за да активирате гласовото въвеждане.'
956956
}
957957
} as const

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
11
import { actions } from './actions'
22
import { general } from './general'
33
import { model_providers } from './model-providers'
4-
import { sidebar } from './sidebar'
4+
import { sections } from './sections'
55
import { configurations } from './configurations'
66

77
export const translations = {
8-
...sidebar,
8+
...sections,
99
...actions,
1010
...general,
1111
...model_providers,

apps/editor/src/views/settings/frontend/i18n/translations/sidebar.ts renamed to apps/editor/src/views/settings/frontend/i18n/translations/sections.ts

Lines changed: 19 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
export const sidebar = {
2-
'sidebar.settings': {
1+
export const sections = {
2+
'sections.settings': {
33
en: 'Settings',
44
pl: 'Ustawienia',
55
'zh-cn': '设置',
@@ -17,7 +17,7 @@ export const sidebar = {
1717
hu: 'Beállítások',
1818
bg: 'Настройки'
1919
},
20-
'sidebar.general': {
20+
'sections.general': {
2121
en: 'General',
2222
pl: 'Ogólne',
2323
'zh-cn': '常规',
@@ -35,7 +35,7 @@ export const sidebar = {
3535
hu: 'Általános',
3636
bg: 'Общи'
3737
},
38-
'sidebar.model-providers': {
38+
'sections.model-providers': {
3939
en: 'Model Providers',
4040
pl: 'Dostawcy modeli',
4141
'zh-cn': '模型提供商',
@@ -53,22 +53,22 @@ export const sidebar = {
5353
hu: 'Modell Szolgáltatók',
5454
bg: 'Доставчици на модели'
5555
},
56-
'sidebar.configurations': {
57-
en: 'Configurations',
58-
pl: 'Konfiguracje',
59-
'zh-cn': '配置',
56+
'sections.api-configurations': {
57+
en: 'API Configurations',
58+
pl: 'Konfiguracje API',
59+
'zh-cn': 'API 配置',
6060
ja: '設定',
6161
'zh-tw': '設定',
62-
de: 'Konfigurationen',
63-
es: 'Configuraciones',
64-
fr: 'Configurations',
65-
'pt-br': 'Configurações',
66-
ru: 'Конфигурации',
67-
ko: '구성',
68-
it: 'Configurazioni',
69-
tr: 'Yapılandırmalar',
70-
cs: 'Konfigurace',
71-
hu: 'Konfigurációk',
72-
bg: 'Конфигурации'
62+
de: 'API-Konfigurationen',
63+
es: 'Configuraciones de API',
64+
fr: 'Configurations API',
65+
'pt-br': 'Configurações de API',
66+
ru: 'Конфигурации API',
67+
ko: 'API 구성',
68+
it: 'Configurazioni API',
69+
tr: 'API Yapılandırmaları',
70+
cs: 'Konfigurace API',
71+
hu: 'API Konfigurációk',
72+
bg: 'API Конфигурации'
7373
}
7474
} as const

‎packages/ui/src/components/editor/settings/Group/Group.module.scss‎

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,13 +12,19 @@
1212

1313
.container {
1414
color: var(--vscode-sideBarTitle-foreground);
15-
1615

1716
> div {
1817
border-top: 1px solid var(--cwc-border-color-dimmed);
1918
}
2019

2120
> div:first-child {
2221
border-top-width: 0;
22+
border-top-left-radius: 10px;
23+
border-top-right-radius: 10px;
24+
}
25+
26+
> div:last-child {
27+
border-bottom-left-radius: 10px;
28+
border-bottom-right-radius: 10px;
2329
}
2430
}

‎packages/ui/src/components/editor/settings/Item/Item.module.scss‎

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -7,16 +7,6 @@
77
&--hoverable:hover:not(:has(button:hover, a:hover)) {
88
background-color: var(--vscode-toolbar-hoverBackground);
99
}
10-
11-
&:first-child {
12-
border-top-left-radius: 10px;
13-
border-top-right-radius: 10px;
14-
}
15-
16-
&:last-child {
17-
border-bottom-left-radius: 10px;
18-
border-bottom-right-radius: 10px;
19-
}
2010
}
2111

2212
.main {

‎packages/ui/src/components/editor/settings/SortableList/SortableList.module.scss‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
display: flex;
33
flex-direction: column;
44
--row-height: 40px;
5+
background-color: var(--cwc-bg-tertiary);
56
}
67

78
.header {

0 commit comments

Comments
 (0)