Skip to content

Commit 3e2ca33

Browse files
committed
Refactor placement translation keys to use common i18n
- options in 'where to insert' should be simplified to just 'Above' 'Below' - place 'above' 'below' translations in `apps/editor/src/i18n/translations/common.ts` ├── apps │ ├── browser │ │ └── LICENSE │ └── editor │ ├── LICENSE │ └── src │ ├── commands │ │ └── apply-response-command │ │ └── utils │ │ └── response-parser │ │ └── parsers │ │ ├── diff-parser │ │ │ └── test │ │ │ └── diff-parser.spec.ts │ │ └── multiple-files-parser │ │ └── test │ │ ├── cases │ │ │ └── delete-file-header │ │ │ ├── 1-text.txt │ │ │ └── delete-file-header.txt │ │ └── multiple-files-parser.spec.ts │ ├── i18n │ │ └── translations │ │ ├── common.ts │ │ └── views │ │ ├── settings │ │ │ └── handlers │ │ │ └── handle-create-template.ts │ │ └── shared │ │ └── actions │ │ ├── api │ │ │ ├── create │ │ │ │ └── create.ts │ │ │ └── upsert-provider.ts │ │ └── web │ │ └── create.ts │ ├── utils │ │ └── changes-integration │ │ └── diff-processor │ │ └── test-cases │ │ └── generic-1 │ │ ├── diff.txt │ │ └── original.txt │ └── views │ ├── prompt │ │ └── frontend │ │ └── components │ │ └── Layout │ │ └── Footer │ │ └── Footer.module.scss │ ├── settings │ │ ├── backend │ │ │ └── message-handlers │ │ │ └── handle-create-template.ts │ │ └── frontend │ │ └── i18n │ │ └── translations │ │ ├── api-calls.ts │ │ └── chatbots.ts │ └── shared │ └── actions │ ├── api │ │ ├── create │ │ │ └── create.ts │ │ └── upsert-provider.ts │ └── web │ └── create.ts └── packages └── ui └── src └── components └── editor └── prompt ├── ContextUtilisation │ ├── ContextUtilisation.stories.tsx │ └── ContextUtilisation.tsx └── ResponsePreview └── ResponsePreview.tsx
1 parent 9a05994 commit 3e2ca33

9 files changed

Lines changed: 48 additions & 164 deletions

File tree

‎apps/editor/src/i18n/translations/common.ts‎

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,42 @@ export const translations = {
1717
hu: 'Szülőmappa kiválasztása...',
1818
bg: 'Изберете родителска папка...'
1919
},
20+
'common.placement-above': {
21+
en: 'Above',
22+
pl: 'Powyżej',
23+
'zh-cn': '上方',
24+
ja: '上',
25+
'zh-tw': '上方',
26+
de: 'Darüber',
27+
es: 'Arriba',
28+
fr: 'Au-dessus',
29+
'pt-br': 'Acima',
30+
ru: 'Выше',
31+
ko: '위',
32+
it: 'Sopra',
33+
tr: 'Yukarı',
34+
cs: 'Nad',
35+
hu: 'Fölé',
36+
bg: 'Отгоре'
37+
},
38+
'common.placement-below': {
39+
en: 'Below',
40+
pl: 'Poniżej',
41+
'zh-cn': '下方',
42+
ja: '下',
43+
'zh-tw': '下方',
44+
de: 'Darunter',
45+
es: 'Abajo',
46+
fr: 'En dessous',
47+
'pt-br': 'Abaixo',
48+
ru: 'Ниже',
49+
ko: '아래',
50+
it: 'Sotto',
51+
tr: 'Aşağı',
52+
cs: 'Pod',
53+
hu: 'Alá',
54+
bg: 'Отдолу'
55+
},
2056
'common.close': {
2157
en: 'Close',
2258
pl: 'Zamknij',

‎apps/editor/src/i18n/translations/views/settings/handlers/handle-create-template.ts‎

Lines changed: 0 additions & 36 deletions
Original file line numberDiff line numberDiff line change
@@ -1,40 +1,4 @@
11
export const translations = {
2-
'views.settings.handlers.handle-create-template.placement-above': {
3-
en: 'Insert a new template above',
4-
pl: 'Wstaw nowy szablon promptu powyżej',
5-
'zh-cn': '在上方插入新的提示词模板',
6-
ja: '上に新しいプロンプトテンプレートを挿入',
7-
'zh-tw': '在上方插入新的提示詞範本',
8-
de: 'Neue Prompt-Vorlage darüber einfügen',
9-
es: 'Insertar una nueva plantilla de prompt arriba',
10-
fr: 'Insérer un nouveau modèle de prompt au-dessus',
11-
'pt-br': 'Inserir um novo modelo de prompt acima',
12-
ru: 'Вставить новый шаблон промпта выше',
13-
ko: '위에 새 프롬프트 템플릿 삽입',
14-
it: 'Inserisci un nuovo modello di prompt sopra',
15-
tr: 'Yukarıya yeni bir istem şablonu ekle',
16-
cs: 'Vložit novou šablonu promptu nad',
17-
hu: 'Új prompt sablon beszúrása fölé',
18-
bg: 'Вмъкване на нов шаблон за промпт отгоре'
19-
},
20-
'views.settings.handlers.handle-create-template.placement-below': {
21-
en: 'Insert a new template below',
22-
pl: 'Wstaw nowy szablon promptu poniżej',
23-
'zh-cn': '在下方插入新的提示词模板',
24-
ja: '下に新しいプロンプトテンプレートを挿入',
25-
'zh-tw': '在下方插入新的提示詞範本',
26-
de: 'Neue Prompt-Vorlage darunter einfügen',
27-
es: 'Insertar una nueva plantilla de prompt abajo',
28-
fr: 'Insérer un nouveau modèle de prompt en dessous',
29-
'pt-br': 'Inserir um novo modelo de prompt abaixo',
30-
ru: 'Вставить новый шаблон промпта ниже',
31-
ko: '아래에 새 프롬프트 템플릿 삽입',
32-
it: 'Inserisci un nuovo modello di prompt sotto',
33-
tr: 'Aşağıya yeni bir istem şablonu ekle',
34-
cs: 'Vložit novou šablonu promptu pod',
35-
hu: 'Új prompt sablon beszúrása alá',
36-
bg: 'Вмъкване на нов шаблон за промпт отдолу'
37-
},
382
'views.settings.handlers.handle-create-template.title': {
393
en: 'Create Template',
404
pl: 'Utwórz szablon promptu',

‎apps/editor/src/i18n/translations/views/shared/actions/api/create/create.ts‎

Lines changed: 0 additions & 36 deletions
Original file line numberDiff line numberDiff line change
@@ -1,40 +1,4 @@
11
export const translations = {
2-
'views.shared.actions.api.create.create.placement-above': {
3-
en: 'Insert a new API configuration above',
4-
pl: 'Wstaw nową konfigurację API powyżej',
5-
'zh-cn': '在上方插入新的 API 配置',
6-
ja: '上に新しい API 構成を挿入',
7-
'zh-tw': '在上方插入新的 API 配置',
8-
de: 'Neue API-Konfiguration darüber einfügen',
9-
es: 'Insertar una nueva configuración de API arriba',
10-
fr: 'Insérer une nouvelle configuration API au-dessus',
11-
'pt-br': 'Inserir uma nova configuração de API acima',
12-
ru: 'Вставить новую конфигурацию API выше',
13-
ko: '위에 새 API 구성 삽입',
14-
it: 'Inserisci una nuova configurazione API sopra',
15-
tr: 'Yukarıya yeni bir API yapılandırması ekle',
16-
cs: 'Vložit novou konfiguraci API nad',
17-
hu: 'Új API konfiguráció beszúrása fölé',
18-
bg: 'Вмъкване на нова API конфигурация отгоре'
19-
},
20-
'views.shared.actions.api.create.create.placement-below': {
21-
en: 'Insert a new API configuration below',
22-
pl: 'Wstaw nową konfigurację API poniżej',
23-
'zh-cn': '在下方插入新的 API 配置',
24-
ja: '下に新しい API 構成を挿入',
25-
'zh-tw': '在下方插入新的 API 配置',
26-
de: 'Neue API-Konfiguration darunter einfügen',
27-
es: 'Insertar una nueva configuración de API abajo',
28-
fr: 'Insérer une nouvelle configuration API en dessous',
29-
'pt-br': 'Inserir uma nova configuração de API abaixo',
30-
ru: 'Вставить новую конфигурацию API ниже',
31-
ko: '아래에 새 API 구성 삽입',
32-
it: 'Inserisci una nuova configurazione API sotto',
33-
tr: 'Aşağıya yeni bir API yapılandırması ekle',
34-
cs: 'Vložit novou konfiguraci API pod',
35-
hu: 'Új API konfiguráció beszúrása alá',
36-
bg: 'Вмъкване на нова API конфигурация отдолу'
37-
},
382
'views.shared.actions.api.create.create.title': {
393
en: 'Placement',
404
pl: 'Umiejscowienie',

‎apps/editor/src/i18n/translations/views/shared/actions/api/upsert-provider.ts‎

Lines changed: 0 additions & 36 deletions
Original file line numberDiff line numberDiff line change
@@ -323,42 +323,6 @@ export const translations = {
323323
hu: 'API kulcs törlése',
324324
bg: 'Изчистване на API ключ'
325325
},
326-
'views.shared.actions.api.upsert-provider.placement.above': {
327-
en: 'Insert a new provider above',
328-
pl: 'Wstaw nowego dostawcę powyżej',
329-
'zh-cn': '在上方插入新提供商',
330-
ja: '上に新しいプロバイダーを挿入',
331-
'zh-tw': '在上方插入新提供商',
332-
de: 'Neuen Anbieter oben einfügen',
333-
es: 'Insertar un nuevo proveedor arriba',
334-
fr: 'Insérer un nouveau fournisseur au-dessus',
335-
'pt-br': 'Inserir um novo provedor acima',
336-
ru: 'Вставить нового провайдера выше',
337-
ko: '위에 새 제공자 삽입',
338-
it: 'Inserisci un nuovo fornitore sopra',
339-
tr: 'Yukarıya yeni bir sağlayıcı ekle',
340-
cs: 'Vložit nového poskytovatele nahoru',
341-
hu: 'Új szolgáltató beszúrása fölé',
342-
bg: 'Вмъкване на нов доставчик отгоре'
343-
},
344-
'views.shared.actions.api.upsert-provider.placement.below': {
345-
en: 'Insert a new provider below',
346-
pl: 'Wstaw nowego dostawcę poniżej',
347-
'zh-cn': '在下方插入新提供商',
348-
ja: '下に新しいプロバイダーを挿入',
349-
'zh-tw': '在下方插入新提供商',
350-
de: 'Neuen Anbieter unten einfügen',
351-
es: 'Insertar un nuevo proveedor abajo',
352-
fr: 'Insérer un nouveau fournisseur en dessous',
353-
'pt-br': 'Inserir um novo provedor abaixo',
354-
ru: 'Вставить нового провайдера ниже',
355-
ko: '아래에 새 제공자 삽입',
356-
it: 'Inserisci un nuovo fornitore sotto',
357-
tr: 'Aşağıya yeni bir sağlayıcı ekle',
358-
cs: 'Vložit nového poskytovatele dolů',
359-
hu: 'Új szolgáltató beszúrása alá',
360-
bg: 'Вмъкване на нов доставчик отдолу'
361-
},
362326
'views.shared.actions.api.upsert-provider.placement.title': {
363327
en: 'Placement',
364328
pl: 'Umiejscowienie',

‎apps/editor/src/i18n/translations/views/shared/actions/web/create.ts‎

Lines changed: 0 additions & 36 deletions
Original file line numberDiff line numberDiff line change
@@ -1,40 +1,4 @@
11
export const translations = {
2-
'views.shared.actions.web.create.placement-above': {
3-
en: 'Insert a new web configuration above',
4-
pl: 'Wstaw nową konfigurację sieci Web powyżej',
5-
'zh-cn': '在上方插入新的 Web 配置',
6-
ja: '上に新しいWeb構成を挿入',
7-
'zh-tw': '在上方插入新的 Web 配置',
8-
de: 'Neue Web-Konfiguration darüber einfügen',
9-
es: 'Insertar una nueva configuración web arriba',
10-
fr: 'Insérer une nouvelle configuration web au-dessus',
11-
'pt-br': 'Inserir uma nova configuração web acima',
12-
ru: 'Вставить новую веб-конфигурацию выше',
13-
ko: '위에 새 웹 구성 삽입',
14-
it: 'Inserisci una nuova configurazione web sopra',
15-
tr: 'Yukarıya yeni bir web yapılandırması ekle',
16-
cs: 'Vložit novou webovou konfiguraci nad',
17-
hu: 'Új webes konfiguráció beszúrása fölé',
18-
bg: 'Вмъкване на нова уеб конфигурация отгоре'
19-
},
20-
'views.shared.actions.web.create.placement-below': {
21-
en: 'Insert a new web configuration below',
22-
pl: 'Wstaw nową konfigurację sieci Web poniżej',
23-
'zh-cn': '在下方插入新的 Web 配置',
24-
ja: '下に新しいWeb構成を挿入',
25-
'zh-tw': '在下方插入新的 Web 配置',
26-
de: 'Neue Web-Konfiguration darunter einfügen',
27-
es: 'Insertar una nueva configuración web abajo',
28-
fr: 'Insérer une nouvelle configuration web en dessous',
29-
'pt-br': 'Inserir uma nova configuração web abaixo',
30-
ru: 'Вставить новую веб-конфигурацию ниже',
31-
ko: '아래에 새 웹 구성 삽입',
32-
it: 'Inserisci una nuova configurazione web sotto',
33-
tr: 'Aşağıya yeni bir web yapılandırması ekle',
34-
cs: 'Vložit novou webovou konfiguraci pod',
35-
hu: 'Új webes konfiguráció beszúrása alá',
36-
bg: 'Вмъкване на нова уеб конфигурация отдолу'
37-
},
382
'views.shared.actions.web.create.title': {
393
en: 'Placement',
404
pl: 'Umiejscowienie',

‎apps/editor/src/views/settings/backend/message-handlers/handle-create-template.ts‎

Lines changed: 3 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -15,14 +15,10 @@ export const handle_create_template = async (
1515
const quick_pick = vscode.window.createQuickPick()
1616
quick_pick.items = [
1717
{
18-
label: t(
19-
'views.settings.handlers.handle-create-template.placement-above'
20-
)
18+
label: t('common.placement-above')
2119
},
2220
{
23-
label: t(
24-
'views.settings.handlers.handle-create-template.placement-below'
25-
)
21+
label: t('common.placement-below')
2622
}
2723
]
2824
quick_pick.title = t(
@@ -64,8 +60,7 @@ export const handle_create_template = async (
6460
if (!position_quick_pick) return
6561

6662
insertion_index =
67-
position_quick_pick ==
68-
t('views.settings.handlers.handle-create-template.placement-above')
63+
position_quick_pick == t('common.placement-above')
6964
? message.insertion_index
7065
: message.insertion_index + 1
7166
}

‎apps/editor/src/views/shared/actions/api/create/create.ts‎

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -28,9 +28,9 @@ export const create = async (params: {
2828
const quick_pick = vscode.window.createQuickPick()
2929
quick_pick.items = [
3030
{
31-
label: t('views.shared.actions.api.create.create.placement-above')
31+
label: t('common.placement-above')
3232
},
33-
{ label: t('views.shared.actions.api.create.create.placement-below') }
33+
{ label: t('common.placement-below') }
3434
]
3535
quick_pick.title = t('views.shared.actions.api.create.create.title')
3636
quick_pick.placeholder = t(
@@ -68,8 +68,7 @@ export const create = async (params: {
6868
if (!position_quick_pick) return undefined
6969

7070
actual_insertion_index =
71-
position_quick_pick ==
72-
t('views.shared.actions.api.create.create.placement-above')
71+
position_quick_pick == t('common.placement-above')
7372
? params.insertion_index
7473
: params.insertion_index + 1
7574
}

‎apps/editor/src/views/shared/actions/api/upsert-provider.ts‎

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -349,10 +349,10 @@ export const upsert_provider = async (params: {
349349
const quick_pick = vscode.window.createQuickPick()
350350
quick_pick.items = [
351351
{
352-
label: t('views.shared.actions.api.upsert-provider.placement.above')
352+
label: t('common.placement-above')
353353
},
354354
{
355-
label: t('views.shared.actions.api.upsert-provider.placement.below')
355+
label: t('common.placement-below')
356356
}
357357
]
358358
quick_pick.title = t(
@@ -393,8 +393,7 @@ export const upsert_provider = async (params: {
393393
if (!position_quick_pick) return
394394

395395
actual_insertion_index =
396-
position_quick_pick ==
397-
t('views.shared.actions.api.upsert-provider.placement.above')
396+
position_quick_pick == t('common.placement-above')
398397
? params.insertion_index
399398
: params.insertion_index + 1
400399
}

‎apps/editor/src/views/shared/actions/web/create.ts‎

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -20,8 +20,8 @@ export const create = async (params: {
2020
(resolve) => {
2121
const quick_pick = vscode.window.createQuickPick()
2222
quick_pick.items = [
23-
{ label: t('views.shared.actions.web.create.placement-above') },
24-
{ label: t('views.shared.actions.web.create.placement-below') }
23+
{ label: t('common.placement-above') },
24+
{ label: t('common.placement-below') }
2525
]
2626
quick_pick.title = t('views.shared.actions.web.create.title')
2727
quick_pick.placeholder = t(
@@ -60,8 +60,7 @@ export const create = async (params: {
6060
if (!position_quick_pick) return undefined
6161

6262
insertion_index =
63-
position_quick_pick ==
64-
t('views.shared.actions.web.create.placement-above')
63+
position_quick_pick == t('common.placement-above')
6564
? params.reference_index
6665
: params.reference_index + 1
6766
}

0 commit comments

Comments
 (0)