Skip to content

Commit 56cc98b

Browse files
committed
Refactor translation keys for the select-unstaged-files command
- `apps/editor/src/context` has some commands handling that should be extracted to `apps/editor/src/commands`
1 parent 3c82832 commit 56cc98b

3 files changed

Lines changed: 159 additions & 16 deletions

File tree

‎apps/editor/src/commands/select-unstaged-files-command.ts‎

Lines changed: 10 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -101,7 +101,7 @@ export const select_unstaged_files_command = (
101101
iconPath: new vscode.ThemeIcon(
102102
'git-pull-request-go-to-changes'
103103
),
104-
tooltip: t('command.commit-message.show-diff')
104+
tooltip: t('command.select-unstaged-files.show-diff')
105105
},
106106
{
107107
iconPath: new vscode.ThemeIcon('go-to-file'),
@@ -115,10 +115,8 @@ export const select_unstaged_files_command = (
115115
const quick_pick = vscode.window.createQuickPick<
116116
vscode.QuickPickItem & { file_path: string }
117117
>()
118-
quick_pick.title = t('command.context-restoration.unstaged.title')
119-
quick_pick.placeholder = t(
120-
'command.context-restoration.unstaged.include'
121-
)
118+
quick_pick.title = t('command.select-unstaged-files.title')
119+
quick_pick.placeholder = t('command.select-unstaged-files.include')
122120
quick_pick.canSelectMany = true
123121
quick_pick.items = quick_pick_items
124122
quick_pick.ignoreFocusOut = true
@@ -144,7 +142,7 @@ export const select_unstaged_files_command = (
144142
const uri = vscode.Uri.file(e.item.file_path)
145143
vscode.window.showTextDocument(uri, { preview: true })
146144
} else if (
147-
e.button.tooltip == t('command.commit-message.show-diff')
145+
e.button.tooltip == t('command.select-unstaged-files.show-diff')
148146
) {
149147
const uri = vscode.Uri.file(e.item.file_path)
150148
await vscode.commands.executeCommand('git.openChange', uri)
@@ -191,15 +189,15 @@ export const select_unstaged_files_command = (
191189
if (!is_identical) {
192190
const quick_pick_options = [
193191
{
194-
label: t('command.context-restoration.action.replace.label'),
192+
label: t('command.select-unstaged-files.replace'),
195193
description: t(
196-
'command.context-restoration.action.replace.description'
194+
'command.select-unstaged-files.replace-description'
197195
)
198196
},
199197
{
200-
label: t('command.context-restoration.action.merge.label'),
198+
label: t('command.select-unstaged-files.merge'),
201199
description: t(
202-
'command.context-restoration.action.merge.description'
200+
'command.select-unstaged-files.merge-description'
203201
)
204202
}
205203
]
@@ -212,7 +210,7 @@ export const select_unstaged_files_command = (
212210
const quick_pick_merge = vscode.window.createQuickPick()
213211
quick_pick_merge.items = quick_pick_options
214212
quick_pick_merge.placeholder = t(
215-
'command.context-restoration.unstaged.apply',
213+
'command.select-unstaged-files.apply',
216214
{
217215
count: selected_paths.length
218216
}
@@ -260,10 +258,7 @@ export const select_unstaged_files_command = (
260258
choice.label
261259
)
262260

263-
if (
264-
choice.label ==
265-
t('command.context-restoration.action.merge.label')
266-
) {
261+
if (choice.label == t('command.select-unstaged-files.merge')) {
267262
paths_to_apply = [
268263
...new Set([...currently_checked, ...selected_paths])
269264
]

‎apps/editor/src/i18n/translations/commands/index.ts‎

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@ import { translations as new_file } from './new-file'
1212
import { translations as new_folder } from './new-folder'
1313
import { translations as rename } from './rename'
1414
import { translations as rate } from './rate'
15+
import { translations as select_unstaged_files } from './select-unstaged-files'
1516

1617
export const translations = {
1718
...generate_commit_message,
@@ -27,5 +28,6 @@ export const translations = {
2728
...new_file,
2829
...new_folder,
2930
...rename,
30-
...rate
31+
...rate,
32+
...select_unstaged_files
3133
}
Lines changed: 146 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,146 @@
1+
export const translations = {
2+
'command.select-unstaged-files.title': {
3+
en: 'Unstaged Files',
4+
pl: 'Nieprzygotowane pliki',
5+
'zh-cn': '未暂存文件',
6+
ja: 'ステージングされていないファイル',
7+
'zh-tw': '未暫存檔案',
8+
de: 'Nicht bereitgestellte Dateien',
9+
es: 'Archivos no preparados',
10+
fr: 'Fichiers non indexés',
11+
'pt-br': 'Arquivos não preparados',
12+
ru: 'Неиндексированные файлы',
13+
ko: '스테이징되지 않은 파일',
14+
it: 'File non in stage',
15+
tr: 'Hazırlanmamış (Unstaged) Dosyalar',
16+
cs: 'Nepřipravené soubory',
17+
hu: 'Nem előkészített fájlok',
18+
bg: 'Неиндексирани файлове'
19+
},
20+
'command.select-unstaged-files.include': {
21+
en: 'Select files to include',
22+
pl: 'Wybierz pliki do włączenia',
23+
'zh-cn': '选择要包含的文件',
24+
ja: '含めるファイルを選択',
25+
'zh-tw': '選擇要包含的檔案',
26+
de: 'Zu inkludierende Dateien auswählen',
27+
es: 'Seleccione los archivos a incluir',
28+
fr: 'Sélectionnez les fichiers à inclure',
29+
'pt-br': 'Selecione os arquivos para incluir',
30+
ru: 'Выберите файлы для включения',
31+
ko: '포함할 파일 선택',
32+
it: 'Seleziona i file da includere',
33+
tr: 'Dahil edilecek dosyaları seçin',
34+
cs: 'Vyberte soubory, které se mají zahrnout',
35+
hu: 'Válassza ki a belefoglalandó fájlokat',
36+
bg: 'Изберете файлове за включване'
37+
},
38+
'command.select-unstaged-files.apply': {
39+
en: 'How would you like to apply the {count} selected files?',
40+
pl: 'W jaki sposób chcesz zastosować {count} zaznaczonych plików?',
41+
'zh-cn': '您希望如何应用选定的 {count} 个文件?',
42+
ja: '選択された {count} 個のファイルをどのように適用しますか?',
43+
'zh-tw': '您希望如何套用選定的 {count} 個檔案?',
44+
de: 'Wie möchten Sie die {count} ausgewählten Dateien anwenden?',
45+
es: '¿Cómo le gustaría aplicar los {count} archivos seleccionados?',
46+
fr: 'Comment souhaitez-vous appliquer les {count} fichiers sélectionnés ?',
47+
'pt-br': 'Como você gostaria de aplicar os {count} arquivos selecionados?',
48+
ru: 'Как вы хотите применить {count} выбранных файлов?',
49+
ko: '선택한 {count}개의 파일을 어떻게 적용하시겠습니까?',
50+
it: 'Come desideri applicare i {count} file selezionati?',
51+
tr: 'Seçili {count} dosyayı nasıl uygulamak istersiniz?',
52+
cs: 'Jak byste chtěli aplikovat {count} vybraných souborů?',
53+
hu: 'Hogyan szeretné alkalmazni a(z) {count} kiválasztott fájlt?',
54+
bg: 'Как искате да приложите избраните {count} файла?'
55+
},
56+
'command.select-unstaged-files.show-diff': {
57+
en: 'Show Diff',
58+
pl: 'Pokaż zmiany',
59+
'zh-cn': '显示差异',
60+
ja: '変更を表示',
61+
'zh-tw': '顯示差異',
62+
de: 'Änderungen anzeigen',
63+
es: 'Mostrar cambios',
64+
fr: 'Afficher les modifications',
65+
'pt-br': 'Mostrar alterações',
66+
ru: 'Показать изменения',
67+
ko: '차이 보기',
68+
it: 'Mostra differenze',
69+
tr: 'Değişiklikleri Göster',
70+
cs: 'Zobrazit změny',
71+
hu: 'Eltérések megjelenítése',
72+
bg: 'Покажи разликите'
73+
},
74+
'command.select-unstaged-files.replace': {
75+
en: 'Replace',
76+
pl: 'Zastąp',
77+
'zh-cn': '替换',
78+
ja: '置換',
79+
'zh-tw': '替換',
80+
de: 'Ersetzen',
81+
es: 'Reemplazar',
82+
fr: 'Remplacer',
83+
'pt-br': 'Substituir',
84+
ru: 'Заменить',
85+
ko: '바꾸기',
86+
it: 'Sostituisci',
87+
tr: 'Değiştir',
88+
cs: 'Nahradit',
89+
hu: 'Csere',
90+
bg: 'Замяна'
91+
},
92+
'command.select-unstaged-files.replace-description': {
93+
en: 'Replace the current context with selected files',
94+
pl: 'Zastąp obecny kontekst zaznaczonymi plikami',
95+
'zh-cn': '用选定的文件替换当前上下文',
96+
ja: '現在のコンテキストを選択したファイルで置き換える',
97+
'zh-tw': '用選定的檔案替換當前上下文',
98+
de: 'Aktuellen Kontext durch ausgewählte Dateien ersetzen',
99+
es: 'Reemplazar el contexto actual por los archivos seleccionados',
100+
fr: 'Remplacer le contexte actuel par les fichiers sélectionnés',
101+
'pt-br': 'Substituir o contexto atual pelos arquivos selecionados',
102+
ru: 'Заменить текущий контекст выбранными файлами',
103+
ko: '현재 컨텍스트를 선택한 파일로 바꾸기',
104+
it: 'Sostituisci il contesto corrente con i file selezionati',
105+
tr: 'Geçerli bağlamı seçili dosyalarla değiştir',
106+
cs: 'Nahradit aktuální kontext vybranými soubory',
107+
hu: 'Az aktuális kontextus cseréje a kiválasztott fájlokra',
108+
bg: 'Замяна на текущия контекст с избраните файлове'
109+
},
110+
'command.select-unstaged-files.merge': {
111+
en: 'Merge',
112+
pl: 'Połącz',
113+
'zh-cn': '合并',
114+
ja: 'マージ',
115+
'zh-tw': '合併',
116+
de: 'Zusammenführen',
117+
es: 'Fusionar',
118+
fr: 'Fusionner',
119+
'pt-br': 'Mesclar',
120+
ru: 'Объединить',
121+
ko: '병합',
122+
it: 'Unisci',
123+
tr: 'Birleştir',
124+
cs: 'Sloučit',
125+
hu: 'Összevonás',
126+
bg: 'Сливане'
127+
},
128+
'command.select-unstaged-files.merge-description': {
129+
en: 'Merge selected files with the current context',
130+
pl: 'Połącz zaznaczone pliki z obecnym kontekstem',
131+
'zh-cn': '将选定的文件与当前上下文合并',
132+
ja: '選択したファイルを現在のコンテキストとマージする',
133+
'zh-tw': '將選定的檔案與當前上下文合併',
134+
de: 'Ausgewählte Dateien mit dem aktuellen Kontext zusammenführen',
135+
es: 'Fusionar los archivos seleccionados con el contexto actual',
136+
fr: 'Fusionner les fichiers sélectionnés avec le contexte actuel',
137+
'pt-br': 'Mesclar os arquivos selecionados com o contexto atual',
138+
ru: 'Объединить выбранные файлы с текущим контекстом',
139+
ko: '선택한 파일을 현재 컨텍스트와 병합하기',
140+
it: 'Unisci i file selezionati al contesto corrente',
141+
tr: 'Seçili dosyaları geçerli bağlamla birleştir',
142+
cs: 'Sloučit vybrané soubory s aktuálním kontextem',
143+
hu: 'Kiválasztott fájlok összevonása az aktuális kontextussal',
144+
bg: 'Сливане на избраните файлове с текущия контекст'
145+
}
146+
} as const

0 commit comments

Comments
 (0)