Skip to content

Commit b7eaf26

Browse files
committed
Refactor translation keys for the commit file selection command into a dedicated module
- `apps/editor/src/context` has some commands handling that should be extracted to `apps/editor/src/commands`
1 parent 56cc98b commit b7eaf26

4 files changed

Lines changed: 234 additions & 165 deletions

File tree

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

Lines changed: 13 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ export const select_commit_files_command = (
3939

4040
if (!log_output) {
4141
vscode.window.showInformationMessage(
42-
t('command.context-restoration.commit.no-commits')
42+
t('command.select-commit-files.no-commits')
4343
)
4444
return
4545
}
@@ -57,11 +57,9 @@ export const select_commit_files_command = (
5757
const quick_pick = vscode.window.createQuickPick<
5858
vscode.QuickPickItem & { hash: string }
5959
>()
60-
quick_pick.title = t('command.context-restoration.commit.title')
60+
quick_pick.title = t('command.select-commit-files.title')
6161
quick_pick.items = commits
62-
quick_pick.placeholder = t(
63-
'command.context-restoration.commit.select'
64-
)
62+
quick_pick.placeholder = t('command.select-commit-files.select')
6563
quick_pick.matchOnDetail = true
6664
quick_pick.buttons = [
6765
{ iconPath: new vscode.ThemeIcon('close'), tooltip: 'Close' }
@@ -126,7 +124,7 @@ export const select_commit_files_command = (
126124

127125
if (!files_output) {
128126
vscode.window.showInformationMessage(
129-
t('command.context-restoration.commit.no-modified')
127+
t('command.select-commit-files.no-modified')
130128
)
131129
continue
132130
}
@@ -151,7 +149,7 @@ export const select_commit_files_command = (
151149

152150
if (valid_files.length == 0) {
153151
vscode.window.showInformationMessage(
154-
t('command.context-restoration.commit.no-valid')
152+
t('command.select-commit-files.no-valid')
155153
)
156154
continue
157155
}
@@ -190,7 +188,7 @@ export const select_commit_files_command = (
190188
quick_pick_files.items = file_items
191189
quick_pick_files.selectedItems = file_items.filter((i) => i.picked)
192190
quick_pick_files.title = t(
193-
'command.context-restoration.commit.files-modified',
191+
'command.select-commit-files.files-modified',
194192
{
195193
hash: selected_commit.hash.substring(0, 7)
196194
}
@@ -205,7 +203,7 @@ export const select_commit_files_command = (
205203
total > 0
206204
? ` (totalling ${display_token_count(total)} tokens)`
207205
: ''
208-
quick_pick_files.placeholder = `${t('command.context-restoration.commit.select-files')}${total_text}`
206+
quick_pick_files.placeholder = `${t('command.select-commit-files.select-files')}${total_text}`
209207
}
210208
update_placeholder()
211209
quick_pick_files.onDidChangeSelection(update_placeholder)
@@ -272,17 +270,15 @@ export const select_commit_files_command = (
272270
if (!is_identical) {
273271
const quick_pick_options = [
274272
{
275-
label: t(
276-
'command.context-restoration.action.replace.label'
277-
),
273+
label: t('command.select-commit-files.replace'),
278274
description: t(
279-
'command.context-restoration.action.replace.description'
275+
'command.select-commit-files.replace-description'
280276
)
281277
},
282278
{
283-
label: t('command.context-restoration.action.merge.label'),
279+
label: t('command.select-commit-files.merge'),
284280
description: t(
285-
'command.context-restoration.action.merge.description'
281+
'command.select-commit-files.merge-description'
286282
)
287283
}
288284
]
@@ -295,7 +291,7 @@ export const select_commit_files_command = (
295291
const quick_pick_merge = vscode.window.createQuickPick()
296292
quick_pick_merge.items = quick_pick_options
297293
quick_pick_merge.placeholder = t(
298-
'command.context-restoration.commit.apply',
294+
'command.select-commit-files.apply',
299295
{
300296
hash: selected_commit.hash.substring(0, 7)
301297
}
@@ -343,10 +339,7 @@ export const select_commit_files_command = (
343339
choice.label
344340
)
345341

346-
if (
347-
choice.label ==
348-
t('command.context-restoration.action.merge.label')
349-
) {
342+
if (choice.label == t('command.select-commit-files.merge')) {
350343
paths_to_apply = [
351344
...new Set([...currently_checked, ...selected_paths])
352345
]

‎apps/editor/src/i18n/translations/commands/context-restoration.ts‎

Lines changed: 0 additions & 144 deletions
Original file line numberDiff line numberDiff line change
@@ -431,150 +431,6 @@ export const translations = {
431431
hu: 'Törlés',
432432
bg: 'Изтриване'
433433
},
434-
'command.context-restoration.commit.no-commits': {
435-
en: 'No commits found in the repository.',
436-
pl: 'Brak commitów w repozytorium.',
437-
'zh-cn': '未在存储库中找到提交。',
438-
ja: 'リポジトリにコミットが見つかりません。',
439-
'zh-tw': '未在儲存庫中找到提交。',
440-
de: 'Keine Commits im Repository gefunden.',
441-
es: 'No se encontraron commits en el repositorio.',
442-
fr: 'Aucun commit trouvé dans le dépôt.',
443-
'pt-br': 'Nenhum commit encontrado no repositório.',
444-
ru: 'Коммиты в репозитории не найдены.',
445-
ko: '저장소에서 커밋을 찾을 수 없습니다.',
446-
it: 'Nessun commit trovato nel repository.',
447-
tr: 'Depoda işleme bulunamadı.',
448-
cs: 'V repozitáři nebyly nalezeny žádné commity.',
449-
hu: 'Nem találhatók commitok a tárolóban.',
450-
bg: 'Няма намерени къмити в хранилището.'
451-
},
452-
'command.context-restoration.commit.title': {
453-
en: 'Commits',
454-
pl: 'Commity',
455-
'zh-cn': '提交',
456-
ja: 'コミット',
457-
'zh-tw': '提交',
458-
de: 'Commits',
459-
es: 'Commits',
460-
fr: 'Commits',
461-
'pt-br': 'Commits',
462-
ru: 'Коммиты',
463-
ko: '커밋',
464-
it: 'Commit',
465-
tr: 'İşlemeler',
466-
cs: 'Commity',
467-
hu: 'Commitok',
468-
bg: 'Къмити'
469-
},
470-
'command.context-restoration.commit.select': {
471-
en: 'Select a commit to load modified files from',
472-
pl: 'Wybierz commit, z którego załadować zmodyfikowane pliki',
473-
'zh-cn': '选择一个提交以加载修改的文件',
474-
ja: '変更されたファイルを読み込むコミットを選択',
475-
'zh-tw': '選擇一個提交以載入修改的檔案',
476-
de: 'Wählen Sie einen Commit, um geänderte Dateien daraus zu laden',
477-
es: 'Seleccione un commit para cargar archivos modificados desde él',
478-
fr: 'Sélectionnez un commit pour charger les fichiers modifiés',
479-
'pt-br': 'Selecione um commit para carregar arquivos modificados',
480-
ru: 'Выберите коммит для загрузки измененных файлов',
481-
ko: '수정된 파일을 로드할 커밋 선택',
482-
it: 'Seleziona un commit da cui caricare i file modificati',
483-
tr: 'Değiştirilmiş dosyaların yükleneceği bir commit seçin',
484-
cs: 'Vyberte commit pro načtení změněných souborů',
485-
hu: 'Válasszon egy commitot a módosított fájlok betöltéséhez',
486-
bg: 'Изберете commit за зареждане на модифицирани файлове'
487-
},
488-
'command.context-restoration.commit.no-modified': {
489-
en: 'No files modified in this commit.',
490-
pl: 'Brak zmodyfikowanych plików w tym commicie.',
491-
'zh-cn': '此提交未修改任何文件。',
492-
ja: 'このコミットで変更されたファイルはありません。',
493-
'zh-tw': '此提交未修改任何檔案。',
494-
de: 'Keine Dateien in diesem Commit geändert.',
495-
es: 'No hay archivos modificados en este commit.',
496-
fr: 'Aucun fichier modifié dans ce commit.',
497-
'pt-br': 'Nenhum arquivo modificado neste commit.',
498-
ru: 'В этом коммите нет измененных файлов.',
499-
ko: '이 커밋에서 수정된 파일이 없습니다.',
500-
it: 'Nessun file modificato in questo commit.',
501-
tr: 'Bu committe hiçbir dosya değiştirilmemiş.',
502-
cs: 'V tomto commitu nebyly změněny žádné soubory.',
503-
hu: 'Ebben a commitban nincsenek módosított fájlok.',
504-
bg: 'Няма модифицирани файлове в този commit.'
505-
},
506-
'command.context-restoration.commit.no-valid': {
507-
en: 'No valid existing files found from this commit.',
508-
pl: 'Brak prawidłowych istniejących plików z tego commita.',
509-
'zh-cn': '在此提交中未找到有效的现有文件。',
510-
ja: 'このコミットから有効な既存ファイルが見つかりません。',
511-
'zh-tw': '在此提交中未找到有效的現有檔案。',
512-
de: 'Keine gültigen vorhandenen Dateien aus diesem Commit gefunden.',
513-
es: 'No se encontraron archivos existentes válidos de este commit.',
514-
fr: 'Aucun fichier existant valide trouvé pour ce commit.',
515-
'pt-br': 'Nenhum arquivo existente válido encontrado deste commit.',
516-
ru: 'Для этого коммита не найдено действительных существующих файлов.',
517-
ko: '이 커밋에서 유효한 기존 파일을 찾을 수 없습니다.',
518-
it: 'Nessun file esistente valido trovato da questo commit.',
519-
tr: 'Bu committen geçerli bir mevcut dosya bulunamadı.',
520-
cs: 'Z tohoto commitu nebyly nalezeny žádné platné existující soubory.',
521-
hu: 'Nem találhatók érvényes létező fájlok ebből a commitból.',
522-
bg: 'Не са намерени валидни съществуващи файлове от този commit.'
523-
},
524-
'command.context-restoration.commit.select-files': {
525-
en: 'Select files to add to context',
526-
pl: 'Wybierz pliki do dodania do kontekstu',
527-
'zh-cn': '选择要添加到上下文的文件',
528-
ja: 'コンテキストに追加するファイルを選択',
529-
'zh-tw': '選擇要加入上下文的檔案',
530-
de: 'Wählen Sie Dateien aus, die zum Kontext hinzugefügt werden sollen',
531-
es: 'Seleccione archivos para agregar al contexto',
532-
fr: 'Sélectionnez les fichiers à ajouter au contexte',
533-
'pt-br': 'Selecione arquivos para adicionar ao contexto',
534-
ru: 'Выберите файлы для добавления в контекст',
535-
ko: '컨텍스트에 추가할 파일 선택',
536-
it: 'Seleziona i file da aggiungere al contesto',
537-
tr: 'Bağlama eklenecek dosyaları seçin',
538-
cs: 'Vyberte soubory, které chcete přidat do kontextu',
539-
hu: 'Válasszon fájlokat a kontextushoz adáshoz',
540-
bg: 'Изберете файлове за добавяне към контекста'
541-
},
542-
'command.context-restoration.commit.files-modified': {
543-
en: 'Files modified in {hash}',
544-
pl: 'Pliki zmodyfikowane w {hash}',
545-
'zh-cn': '在 {hash} 中修改的文件',
546-
ja: '{hash} で変更されたファイル',
547-
'zh-tw': '在 {hash} 中修改的檔案',
548-
de: 'Geänderte Dateien in {hash}',
549-
es: 'Archivos modificados en {hash}',
550-
fr: 'Fichiers modifiés dans {hash}',
551-
'pt-br': 'Arquivos modificados em {hash}',
552-
ru: 'Файлы, измененные в {hash}',
553-
ko: '{hash}에 수정된 파일',
554-
it: 'File modificati in {hash}',
555-
tr: '{hash} içinde değiştirilen dosyalar',
556-
cs: 'Soubory změněné v {hash}',
557-
hu: 'A(z) {hash} commitban módosított fájlok',
558-
bg: 'Файлове, модифицирани в {hash}'
559-
},
560-
'command.context-restoration.commit.apply': {
561-
en: 'How would you like to apply files from commit {hash}?',
562-
pl: 'Jak chcesz zastosować pliki z commita {hash}?',
563-
'zh-cn': '您想如何应用提交 {hash} 中的文件?',
564-
ja: 'コミット {hash} のファイルをどのように適用しますか?',
565-
'zh-tw': '您想如何套用提交 {hash} 中的檔案?',
566-
de: 'Wie möchten Sie Dateien aus Commit {hash} anwenden?',
567-
es: '¿Cómo le gustaría aplicar los archivos del commit {hash}?',
568-
fr: 'Comment souhaitez-vous appliquer les fichiers du commit {hash} ?',
569-
'pt-br': 'Como você gostaria de aplicar os arquivos do commit {hash}?',
570-
ru: 'Как вы хотите применить файлы из коммита {hash}?',
571-
ko: '커밋 {hash}의 파일을 어떻게 적용하시겠습니까?',
572-
it: 'Come desideri applicare i file dal commit {hash}?',
573-
tr: '{hash} commitindeki dosyaları nasıl uygulamak istersiniz?',
574-
cs: 'Jak si přejete aplikovat soubory z commitu {hash}?',
575-
hu: 'Hogyan szeretné alkalmazni a(z) {hash} commitból származó fájlokat?',
576-
bg: 'Как бихте искали да приложите файлове от commit {hash}?'
577-
},
578434
'command.context-restoration.unstaged.title': {
579435
en: 'Unstaged Files',
580436
pl: 'Nieprzygotowane pliki',

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

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@ import { translations as new_folder } from './new-folder'
1313
import { translations as rename } from './rename'
1414
import { translations as rate } from './rate'
1515
import { translations as select_unstaged_files } from './select-unstaged-files'
16+
import { translations as select_commit_files } from './select-commit-files'
1617

1718
export const translations = {
1819
...generate_commit_message,
@@ -29,5 +30,6 @@ export const translations = {
2930
...new_folder,
3031
...rename,
3132
...rate,
32-
...select_unstaged_files
33+
...select_unstaged_files,
34+
...select_commit_files
3335
}

0 commit comments

Comments
 (0)