mirror of
https://github.com/danielmiessler/fabric.git
synced 2026-09-10 07:36:44 -04:00
i18n: add git CLI error message keys across all supported locales
- Add `githelper_failed_create_temp_directory` i18n key to all locales - Add `githelper_failed_git_cli_clone` error key across 10 locale files - Add `githelper_failed_git_cli_fallback` key for CLI fallback error messaging - Replace hardcoded error strings in `githelper.go` with `i18n.T()` calls - Support localized git CLI error reporting in de, en, es, fa, fr, it, ja, pt, zh
This commit is contained in:
parent
4bb1319685
commit
c0b1f6175a
|
|
@ -224,6 +224,9 @@
|
|||
"gemini_wav_generation_failed": "WAV-Datei konnte nicht generiert werden: %w",
|
||||
"githelper_failed_clone_repository": "Repository konnte nicht geklont werden: %w",
|
||||
"githelper_failed_create_dest_directory": "Zielverzeichnis konnte nicht erstellt werden: %w",
|
||||
"githelper_failed_create_temp_directory": "Temporäres Verzeichnis konnte nicht erstellt werden: %w",
|
||||
"githelper_failed_git_cli_clone": "Git-Klon fehlgeschlagen: %w: %s",
|
||||
"githelper_failed_git_cli_fallback": "%w; Git-CLI-Fallback ebenfalls fehlgeschlagen: %v",
|
||||
"githelper_failed_get_commit": "Commit konnte nicht abgerufen werden: %w",
|
||||
"githelper_failed_get_head": "Repository HEAD konnte nicht abgerufen werden: %w",
|
||||
"githelper_failed_get_tree": "Verzeichnisbaum konnte nicht abgerufen werden: %w",
|
||||
|
|
|
|||
|
|
@ -224,6 +224,9 @@
|
|||
"gemini_wav_generation_failed": "failed to generate WAV file: %w",
|
||||
"githelper_failed_clone_repository": "failed to clone repository: %w",
|
||||
"githelper_failed_create_dest_directory": "failed to create destination directory: %w",
|
||||
"githelper_failed_create_temp_directory": "failed to create temp directory: %w",
|
||||
"githelper_failed_git_cli_clone": "git clone failed: %w: %s",
|
||||
"githelper_failed_git_cli_fallback": "%w; git CLI fallback also failed: %v",
|
||||
"githelper_failed_get_commit": "failed to get commit: %w",
|
||||
"githelper_failed_get_head": "failed to get repository HEAD: %w",
|
||||
"githelper_failed_get_tree": "failed to get tree: %w",
|
||||
|
|
|
|||
|
|
@ -224,6 +224,9 @@
|
|||
"gemini_wav_generation_failed": "no se pudo generar el archivo WAV: %w",
|
||||
"githelper_failed_clone_repository": "No se pudo clonar el repositorio: %w",
|
||||
"githelper_failed_create_dest_directory": "No se pudo crear el directorio de destino: %w",
|
||||
"githelper_failed_create_temp_directory": "No se pudo crear el directorio temporal: %w",
|
||||
"githelper_failed_git_cli_clone": "Falló la clonación con git: %w: %s",
|
||||
"githelper_failed_git_cli_fallback": "%w; el respaldo con git CLI también falló: %v",
|
||||
"githelper_failed_get_commit": "No se pudo obtener el commit: %w",
|
||||
"githelper_failed_get_head": "No se pudo obtener el HEAD del repositorio: %w",
|
||||
"githelper_failed_get_tree": "No se pudo obtener el árbol: %w",
|
||||
|
|
|
|||
|
|
@ -224,6 +224,9 @@
|
|||
"gemini_wav_generation_failed": "تولید فایل WAV ناموفق بود: %w",
|
||||
"githelper_failed_clone_repository": "شبیهسازی مخزن ناموفق بود: %w",
|
||||
"githelper_failed_create_dest_directory": "ایجاد پوشه مقصد ناموفق بود: %w",
|
||||
"githelper_failed_create_temp_directory": "ایجاد پوشه موقت ناموفق بود: %w",
|
||||
"githelper_failed_git_cli_clone": "شبیهسازی با git ناموفق بود: %w: %s",
|
||||
"githelper_failed_git_cli_fallback": "%w; روش جایگزین git CLI نیز ناموفق بود: %v",
|
||||
"githelper_failed_get_commit": "دریافت کامیت ناموفق بود: %w",
|
||||
"githelper_failed_get_head": "دریافت HEAD مخزن ناموفق بود: %w",
|
||||
"githelper_failed_get_tree": "دریافت درخت ناموفق بود: %w",
|
||||
|
|
|
|||
|
|
@ -224,6 +224,9 @@
|
|||
"gemini_wav_generation_failed": "échec de la génération du fichier WAV : %w",
|
||||
"githelper_failed_clone_repository": "Échec du clonage du dépôt : %w",
|
||||
"githelper_failed_create_dest_directory": "Échec de la création du répertoire de destination : %w",
|
||||
"githelper_failed_create_temp_directory": "Échec de la création du répertoire temporaire : %w",
|
||||
"githelper_failed_git_cli_clone": "Échec du clonage git : %w : %s",
|
||||
"githelper_failed_git_cli_fallback": "%w ; le repli sur git CLI a également échoué : %v",
|
||||
"githelper_failed_get_commit": "Échec de la récupération du commit : %w",
|
||||
"githelper_failed_get_head": "Échec de la récupération du HEAD du dépôt : %w",
|
||||
"githelper_failed_get_tree": "Échec de la récupération de l'arborescence : %w",
|
||||
|
|
|
|||
|
|
@ -224,6 +224,9 @@
|
|||
"gemini_wav_generation_failed": "generazione file WAV fallita: %w",
|
||||
"githelper_failed_clone_repository": "Clonazione del repository fallita: %w",
|
||||
"githelper_failed_create_dest_directory": "Creazione della directory di destinazione fallita: %w",
|
||||
"githelper_failed_create_temp_directory": "Creazione della directory temporanea fallita: %w",
|
||||
"githelper_failed_git_cli_clone": "Clonazione git fallita: %w: %s",
|
||||
"githelper_failed_git_cli_fallback": "%w; anche il fallback git CLI è fallito: %v",
|
||||
"githelper_failed_get_commit": "Recupero del commit fallito: %w",
|
||||
"githelper_failed_get_head": "Recupero dell'HEAD del repository fallito: %w",
|
||||
"githelper_failed_get_tree": "Recupero dell'albero fallito: %w",
|
||||
|
|
|
|||
|
|
@ -224,6 +224,9 @@
|
|||
"gemini_wav_generation_failed": "WAVファイルの生成に失敗しました: %w",
|
||||
"githelper_failed_clone_repository": "リポジトリのクローンに失敗しました: %w",
|
||||
"githelper_failed_create_dest_directory": "宛先ディレクトリの作成に失敗しました: %w",
|
||||
"githelper_failed_create_temp_directory": "一時ディレクトリの作成に失敗しました: %w",
|
||||
"githelper_failed_git_cli_clone": "gitクローンに失敗しました: %w: %s",
|
||||
"githelper_failed_git_cli_fallback": "%w; git CLIフォールバックも失敗しました: %v",
|
||||
"githelper_failed_get_commit": "コミットの取得に失敗しました: %w",
|
||||
"githelper_failed_get_head": "リポジトリHEADの取得に失敗しました: %w",
|
||||
"githelper_failed_get_tree": "ツリーの取得に失敗しました: %w",
|
||||
|
|
|
|||
|
|
@ -224,6 +224,9 @@
|
|||
"gemini_wav_generation_failed": "falha ao gerar arquivo WAV: %w",
|
||||
"githelper_failed_clone_repository": "Falha ao clonar o repositório: %w",
|
||||
"githelper_failed_create_dest_directory": "Falha ao criar o diretório de destino: %w",
|
||||
"githelper_failed_create_temp_directory": "Falha ao criar o diretório temporário: %w",
|
||||
"githelper_failed_git_cli_clone": "Falha na clonagem git: %w: %s",
|
||||
"githelper_failed_git_cli_fallback": "%w; o fallback do git CLI também falhou: %v",
|
||||
"githelper_failed_get_commit": "Falha ao obter o commit: %w",
|
||||
"githelper_failed_get_head": "Falha ao obter o HEAD do repositório: %w",
|
||||
"githelper_failed_get_tree": "Falha ao obter a árvore: %w",
|
||||
|
|
|
|||
|
|
@ -224,6 +224,9 @@
|
|||
"gemini_wav_generation_failed": "falha ao gerar ficheiro WAV: %w",
|
||||
"githelper_failed_clone_repository": "Falha ao clonar o repositório: %w",
|
||||
"githelper_failed_create_dest_directory": "Falha ao criar o diretório de destino: %w",
|
||||
"githelper_failed_create_temp_directory": "Falha ao criar o diretório temporário: %w",
|
||||
"githelper_failed_git_cli_clone": "Falha na clonagem git: %w: %s",
|
||||
"githelper_failed_git_cli_fallback": "%w; o recurso ao git CLI também falhou: %v",
|
||||
"githelper_failed_get_commit": "Falha ao obter o commit: %w",
|
||||
"githelper_failed_get_head": "Falha ao obter o HEAD do repositório: %w",
|
||||
"githelper_failed_get_tree": "Falha ao obter a árvore: %w",
|
||||
|
|
|
|||
|
|
@ -224,6 +224,9 @@
|
|||
"gemini_wav_generation_failed": "生成 WAV 文件失败:%w",
|
||||
"githelper_failed_clone_repository": "克隆仓库失败:%w",
|
||||
"githelper_failed_create_dest_directory": "创建目标目录失败:%w",
|
||||
"githelper_failed_create_temp_directory": "创建临时目录失败:%w",
|
||||
"githelper_failed_git_cli_clone": "git 克隆失败:%w:%s",
|
||||
"githelper_failed_git_cli_fallback": "%w;git CLI 备用方案也失败了:%v",
|
||||
"githelper_failed_get_commit": "获取提交失败:%w",
|
||||
"githelper_failed_get_head": "获取仓库HEAD失败:%w",
|
||||
"githelper_failed_get_tree": "获取树失败:%w",
|
||||
|
|
|
|||
|
|
@ -54,7 +54,7 @@ func FetchFilesFromRepo(opts FetchOptions) error {
|
|||
return nil
|
||||
}
|
||||
|
||||
return fmt.Errorf("%w; git CLI fallback also failed: %v", goGitErr, cliErr)
|
||||
return fmt.Errorf(i18n.T("githelper_failed_git_cli_fallback"), goGitErr, cliErr)
|
||||
}
|
||||
|
||||
// fetchFilesViaGoGit clones a repo in memory using go-git and extracts files.
|
||||
|
|
@ -127,13 +127,13 @@ func fetchFilesViaGoGit(opts FetchOptions) error {
|
|||
func fetchFilesViaGitCLI(opts FetchOptions) error {
|
||||
tmpDir, err := os.MkdirTemp("", "fabric-git-clone-*")
|
||||
if err != nil {
|
||||
return fmt.Errorf("failed to create temp directory: %w", err)
|
||||
return fmt.Errorf(i18n.T("githelper_failed_create_temp_directory"), err)
|
||||
}
|
||||
defer os.RemoveAll(tmpDir)
|
||||
|
||||
cmd := exec.Command("git", "clone", "--depth", "1", opts.RepoURL, tmpDir)
|
||||
if output, err := cmd.CombinedOutput(); err != nil {
|
||||
return fmt.Errorf("git clone failed: %w: %s", err, string(output))
|
||||
return fmt.Errorf(i18n.T("githelper_failed_git_cli_clone"), err, string(output))
|
||||
}
|
||||
|
||||
// Source directory within the clone (trim trailing slash for filepath.Join)
|
||||
|
|
|
|||
Loading…
Reference in a new issue